id = $id; $this->title = $title; $this->description = $description; $this->questions = array(); $this->results = null; } public function addQuestion($question) { array_push($this->questions, $question); } public function setResults($surveyResults) { $this->results = $surveyResults; } public static function getSurvey($info) { $id = $info['surveyID']; $title = $info['surveyTitle']; $description = $info['surveyDescription']; $survey = new Survey($id, $title, $description); $numQ = 1; //number questions while (isset($info['questionTitle' . $numQ])) { $id = $info['questionID' . $numQ]; $code = $info['questionCode' . $numQ]; $title = $info['questionTitle' . $numQ]; $type = $info['questionType' . $numQ]; $description = $info['questionDescription' . $numQ]; $question = new Question($id, $code, $title, $type, $description); $numA = 1; //number answers while (isset($info['q' . $numQ . 'ans' . $numA])) { $answer = $info['q' . $numQ . 'ans' . $numA]; $question->answers[$numA] = $answer; $numA++; } $survey->questions[$numQ] = $question; $numQ++; } return $survey; } /** * TODO: Should return Results-object from reading RDF-database * @param type $surveyID */ public static function getResults($surveyID) { } } ?>