Changeset 114 for Dev/trunk/classes/Question.php
- Timestamp:
- 09/19/11 18:04:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/Question.php
r112 r114 19 19 public $category; 20 20 21 public function __construct($code, $title , $type = null, $description = null)21 public function __construct($code, $title = null, $type = null, $description = null) 22 22 { 23 23 $this->code = $code; … … 34 34 } 35 35 36 public static function getQuestion($ questionInfo)36 public static function getQuestion($code, $info) 37 37 { 38 $question = new Question($code); 39 $question->title = $info['questionTitle']; 40 $question->type = $info['questionType']; 41 if(isset($info['questionDescription'])) 42 $question->description = $info['questionDescription']; 43 $question->category = $info['questionCategory']; 38 44 45 $i = 1; 46 while (isset($info['ans' . $i])) 47 { 48 array_push($question->answers, $info['ans' . $i]); 49 $i++; 50 } 51 52 return $question; 39 53 } 40 54
Note: See TracChangeset
for help on using the changeset viewer.