mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-10239:
Improper check for correct answer in true/false questions
This commit is contained in:
parent
46d798182a
commit
1b36a58597
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user