From: moodler Date: Fri, 18 Oct 2002 05:41:24 +0000 (+0000) Subject: Fixed the setting of answers for true-false questions X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e757af1662ff6ef8240834eb11cd8ddbc4d4c0e1;p=moodle.git Fixed the setting of answers for true-false questions --- diff --git a/mod/quiz/question.php b/mod/quiz/question.php index 2448dd37bd..79f7c05c95 100644 --- a/mod/quiz/question.php +++ b/mod/quiz/question.php @@ -112,7 +112,7 @@ $true->answer = get_string("true", "quiz"); $true->question = $question->id; - $true->fraction = "1.0"; + $true->fraction = $form->answer; $true->feedback = $form->feedbacktrue; if (!$true->id = insert_record("quiz_answers", $true)) { error("Could not insert quiz answer \"true\")!"); @@ -120,7 +120,7 @@ $false->answer = get_string("false", "quiz"); $false->question = $question->id; - $false->fraction = "0"; + $false->fraction = 1 - (int)$form->answer; $false->feedback = $form->feedbackfalse; if (!$false->id = insert_record("quiz_answers", $false)) { error("Could not insert quiz answer \"false\")!");