Ignore:
Timestamp:
09/19/11 16:52:43 (14 years ago)
Author:
basvannuland
Message:

question creation getinfo fixed

File:
1 edited

Legend:

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

    r112 r113  
    5656        $questionInfo = array();
    5757       
    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);
    6659       
    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)
    7365        {
    74             for($aNumber = 1;$aNumber<=sizeof($resultAnswers);$aNumber++)
     66            for($aNumber = 1;$aNumber<=sizeof($question['answers']);$aNumber++)
    7567            {
    76                 $questionInfo['ans'.$aNumber] = $resultAnswers[$aNumber-1]['?answerDescription']->label;
     68                $questionInfo['ans'.$aNumber] = $question['answers'][$aNumber-1]['?answerDescription']->label;
    7769            }
    7870        }
Note: See TracChangeset for help on using the changeset viewer.