answerList=0; $this->type=0; $this->changedAnswers=0; $this->answersCorrect=0; $this->missing=0; $this->answerList = array(); $this->action="index.php?site=collect_question&action=setAnswers"; } function setChangedAnswers($changed_answers){ $this->changedAnswers=$changed_answers; } function setQuestionType($type) { $this->type=$type; } function setMissing() { $this->missing=true; } function setAnswerType($type) { $this->type=$type; } function setType(){ switch ($this->type) { case 1 : { // Einfachauswahl $this->formHead(); $this->ShowFormSingleSelection(); break; } case 2 : { // Mehrfachauswahl $this->formHead(); $this->ShowFormMultipleChoice(); break; } case 3 : { //Richtig/Falsch $this->formHead(); $this->ShowFormCorrectWrong(); break; } case 4 : { //Lückentext mit Auswahl $this->ShowFormFillInTheBlanks(); break; } } } function showAnswers() { echo"
"; } function setAnswersCorrect($correctAnswers){ $this->answersCorrect=$correctAnswers; } function setQuestionID($q_id){ $this->quID= $q_id; } function getAnswers(){ $sql="SELECT a_id, answer, correct FROM answers WHERE q_id=".intval($_SESSION['values']['question']['q_id']).""; $query= mysql_query($sql); $i=0; // zähler while($answers =mysql_fetch_array($query ,MYSQL_BOTH )){ $this->answerList[$i]['a_id']=$answers['a_id']; // in arra speichern $this->answerList[$i]['answer']=$answers['answer']; $this->answerList[$i]['correct']=$answers['correct']; $i++; } $_SESSION['values']['answerList']=$this->answerList; } function setAnswerList(){ $this->answerList=$_SESSION ['values']['answerList']; } function changeCorrect($a_id){ switch ($this->type){ case 1 : { // Einfachauswahl nur eine Antwort darf richtig sein for ($i=0;$i