Used the opportunity and re-formatted the file consistently, without using tabs.

This commit is contained in:
Bernhard Fröhlich 2013-04-10 22:22:33 +02:00
parent 7711fd61e8
commit e0538cf1a0

View file

@ -86,8 +86,7 @@ class Quiz
$i++;
}
$_SESSION['values']['questionList']=$this->questionList;
}
else{
} else {
echo "<h5>".Class_Quiz_01." </h5>";
$value ="notEnoughQuestions";
return $value;
@ -213,7 +212,6 @@ class Quiz
}
function FillInTheBlanks($i,$value,$question) {
echo '<td class="answer" valign="top" colspan="2">';
$correctAns=$this->question->getCorrectAnswerFillInTheBlanks($question); // korrekte Antworen ermitteln
$numberOfAnswers=$this->questionList[$i]['numberOfAnswers'];
@ -237,7 +235,6 @@ class Quiz
}
echo"</select>";
}
else if((strstr($array[$k],']'))){
$array[$k]=str_replace("]",'', $array[$k]); // Klammer entfernen
echo $array[$k];
@ -251,9 +248,7 @@ class Quiz
}
function evaluateQuiz() {
echo"<div>";
echo "<fieldset>";
@ -271,19 +266,24 @@ class Quiz
}
$this->topicID=$this->questionList[$i]['t_id'];
switch($this->questionList[$i]['qt_id']){
case 1: {$this->evaluateSingleSelection($i,$value);
case 1: {
$this->evaluateSingleSelection($i,$value);
break;}
case 2: {$this->evaluateMultipleChoice($i,$value);
break;}
case 3: { $this->evaluateSingleSelection($i,$value); // Kann die selbe Maske verwendet werden
break;}
case 4:{ //$this->getDBAnswers();
break;
}
case 2: {
$this->evaluateMultipleChoice($i,$value);
break;
}
case 3: {
$this->evaluateSingleSelection($i,$value); // Kann die selbe Maske verwendet werden
break;
}
case 4:{
//$this->getDBAnswers();
$this->evaluateFillInTheBlanks($i,$value,$question);
break;}
break;
}
}
}
@ -330,7 +330,7 @@ class Quiz
echo"</tr>";
}
if(isset($this->selectedAnswers[$value]) && isset($this->answerList[$value][$j]['correct']) &&
if (isset($this->selectedAnswers[$value]) && isset($this->answerList[$value][$j]['correct']) &&
$this->selectedAnswers[$value]==$this->answerList[$value][$j]['a_id'] && $this->answerList[$value][$j]['correct']==1) {
$correct[]=1;
}
@ -385,8 +385,6 @@ class Quiz
}
function evaluateFillInTheBlanks($i,$value,$question){
$addSlashes= preg_quote($question, '[^]'); // Slash hinzufügen wenn KLammer gefunden wird
$array=explode('\\',$addSlashes); // String teilen
// Was Benutzer markiert hat
@ -435,7 +433,7 @@ class Quiz
$this->checkAnswers($correct,$value);
}
function checkAnswers($correct,$value) {
function checkAnswers($correct,$value) {
$check = in_array(0, $correct); // Prüfen ob im Array der Wert 0 ist, denn dann wurde mindestens eine Antwort falsch beantwortet
echo "\n<tr>";
if(!$check)echo"<td class='symbol' colspan='7'><img src='images/correct.png' alt='' /></td>";
@ -444,7 +442,7 @@ function checkAnswers($correct,$value) {
echo"<td class='symbol' colspan='7'><img src='images/wrong.png' alt='' /></td>";
}
echo "</tr>";
}
}
function updateStatistic() {
for($i=1;$i<=$this->questionLimit;$i++) {