Changeset 298 for Dev/branches/jos-branch/server/classes/models/Survey.php
- Timestamp:
- 03/01/12 15:02:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jos-branch/server/classes/models/Survey.php
r285 r298 32 32 public function evaluate() 33 33 { 34 34 35 if(is_string($this->creator)) 35 36 { 36 $result = User::get(array("uid" => $this->creator)); 37 $crea = ResearchToolObject::stripUri($this->creator); 38 $result = User::get(array("uid" => $crea["uid"])); 37 39 if(!isset($result[0])) 38 40 return false; … … 45 47 foreach($this->questions as $question) 46 48 { 47 $result = Question::get(array("code" => $question)); 49 $ques = ResearchToolObject::stripUri($question); 50 $result = Question::get(array("uid" => $ques["uid"])); 48 51 if(!isset($result[0])) 49 52 return false; … … 93 96 94 97 $predicateCreator = new Resource(CREATOR); 95 $surveyCreator = new Literal($this->creator->uid);98 $surveyCreator = new Resource(USER . '/' . $this->creator->uid); 96 99 $model->add(new Statement($resourceSurvey, $predicateCreator, $surveyCreator)); 97 100 … … 100 103 foreach($this->questions as $question) 101 104 { 102 $questionUid = new Literal($question->uid);105 $questionUid = new Resource(QUESTION . '/' . $question->uid); 103 106 $predicateQuid = new Resource(HAS_QUESTION); 104 107 $model->add(new Statement($resourceSurvey,$predicateQuid,$questionUid)); … … 145 148 { 146 149 $questions = Survey::getQuestions($model, $result['?uid']->label); 147 $creator = $result['?creator']-> label;150 $creator = $result['?creator']->uri; 148 151 $surveys[] = new Survey($result['?uid']->label, $result['?title']->label, $result['?description']->label, $creator, $questions); 149 152 }
Note: See TracChangeset
for help on using the changeset viewer.