Ignore:
Timestamp:
08/25/11 17:52:09 (14 years ago)
Author:
basvannuland
Message:

start with answer saving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/SurveyAnswerRDFReader.php

    r62 r83  
    44{       
    55    protected $model;
     6    protected $respondentID;
     7   
    68    protected $filePath;
    79
    8     public function __construct($surveyUID,$sessionID)
     10    public function __construct($surveyUID,$sessionID,$respondentID)
    911    {
    1012
     
    1214        $factory = new ModelFactory();
    1315        $this->model = $factory->getDefaultModel();
    14         $this->filePath = 'data/surveys/survey_'.$surveyUID . '.rdf';
    1516       
    16         $this->model->load($this->filePath);
     17        $this->respondentID = $respondentID;
     18       
     19        $this->filePath = 'data/sessions/' .  $sessionID . '/survey_'.$surveyUID . '/';
    1720    }
    1821
    19     public function loadAnsers($userID)
     22    public function loadAnsers()
    2023    {
    21         $this->model->load($this->filePath.'/answer_'.$this->userUID.'.rdf');
     24        if(file_exists($this->filePath.'questions.rdf'))
     25        {
     26            $this->model->load($this->filePath.'/answer_'.$this->respondentID.'.rdf');
     27            return true;
     28        }
     29        else
     30        {
     31            return false;
     32        }
    2233    }
    2334
     
    5667    }
    5768
    58     public function getAnswerByRespondent($respondentID)
     69    public function getAnswersByRespondent($respondentID)
    5970    {
    6071        $this->tempModel->loadModel($this->model);
Note: See TracChangeset for help on using the changeset viewer.