Changeset 113
- Timestamp:
- 09/19/11 16:52:43 (14 years ago)
- Location:
- Dev/trunk/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/QuestionCreationDatabaseInterface.php
r112 r113 56 56 $questionInfo = array(); 57 57 58 $questionTitleObject = $this->questionRDFReader->readQuestionTitle($qCode); 59 $questionInfo['questionTitle'] = $questionTitleObject[0]['?questionTitle']->label; 60 61 $questionDescriptionObject = $this->questionRDFReader->readQuestionDescription($qCode); 62 $questionInfo['questionDescription'] = $questionDescriptionObject[0]['?questionDescription']->label; 63 64 $questionTypeObject = $this->questionRDFReader->readQuestionType($qCode); 65 $questionInfo['questionType'] = $questionTypeObject[0]['?questionType']->label; 58 $question = $this->questionRDFReader->readQuestionByCode($qCode); 66 59 67 $questionCategoryObject = $this->questionRDFReader->readQuestionCategory($qCode); 68 $questionInfo['questionCategory'] = $questionTypeObject[0]['?questionCategory']->label; 69 70 $resultAnswers = $this->questionRDFReader->readQuestionAnswers($qCode); 71 72 if ($resultAnswers != null) 60 $questionInfo['questionTitle'] = $question['title'][0]['?questionTitle']->label; 61 $questionInfo['questionDescription'] = $question['description'][0]['?questionDescription']->label; 62 $questionInfo['questionType'] = $question['type'][0]['?questionType']->label; 63 $questionInfo['questionCategory'] = $question['category'][0]['?questionCategory']->label; 64 if ($question['answers'] != null) 73 65 { 74 for($aNumber = 1;$aNumber<=sizeof($ resultAnswers);$aNumber++)66 for($aNumber = 1;$aNumber<=sizeof($question['answers']);$aNumber++) 75 67 { 76 $questionInfo['ans'.$aNumber] = $ resultAnswers[$aNumber-1]['?answerDescription']->label;68 $questionInfo['ans'.$aNumber] = $question['answers'][$aNumber-1]['?answerDescription']->label; 77 69 } 78 70 } -
Dev/trunk/classes/QuestionRDFReader.php
r109 r113 16 16 if (!is_dir($this->filePath)) 17 17 mkdir($this->filePath); 18 19 } 20 21 public function loadQuestions() 22 { 23 if(file_exists($this->filePath.'questions.rdf')) 24 { 25 $this->model->load($this->filePath.'questions.rdf'); 26 return true; 27 } 28 else 29 { 30 return false; 31 } 18 $this->reloadQuestions(); 32 19 } 33 20 … … 50 37 $result['description'] = $this->readQuestionDescription($questionCode); 51 38 $result['type'] = $this->readQuestionType($questionCode); 52 $result['code'] = $this->readQuestionCode($questionCode);53 39 $result['category'] = $this->readQuestionCategory($questionCode); 54 40 $result['answers'] = $this->readQuestionAnswers($questionCode); … … 92 78 { 93 79 _question predicates:resource_type resources:question ; 94 predicates:question_code "' . $questionCode . '" ;80 predicates:question_code "' . $questionCode . '" ; 95 81 predicates:title ?questionTitle 96 82 }';
Note: See TracChangeset
for help on using the changeset viewer.