MDL-10239:

Improper check for correct answer in true/false questions
This commit is contained in:
thepurpleblob 2007-07-26 15:08:16 +00:00
parent 46d798182a
commit 1b36a58597

View File

@ -558,9 +558,10 @@ function process_tf($quest, &$questions) {
$question->qtype = TRUEFALSE;
$question->single = 1; // Only one answer is allowed
// first choice is true, second is false.
if ($quest->responses[0]->fraction == 1) {
// 0th [response] is the correct answer.
$responses = $quest->responses;
$correctresponse = $responses[0]->ident[0]['varequal'][0]['#'];
if ($correctresponse != 'false') {
$correct = true;
}
else {