Skip to content

Commit

Permalink
qtype_multichoice MDL-24937 multichoice questions were getting marked…
Browse files Browse the repository at this point in the history
… as answered even when they weren't.
  • Loading branch information
timhunt committed Nov 1, 2010
1 parent 49a874c commit f2ca88b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions mod/quiz/lang/en/quiz.php
Expand Up @@ -159,6 +159,7 @@
$string['categorynoedit'] = 'You do not have editing privileges in the category \'{$a}\'.';
$string['categoryupdated'] = 'The category was successfully updated';
$string['close'] = 'Close window';
$string['closed'] = 'Closed';
$string['closebeforeopen'] = 'Could not update the quiz. You have specified a close date before the open date.';
$string['closepreview'] = 'Close preview';
$string['closereview'] = 'Close review';
Expand Down
17 changes: 17 additions & 0 deletions question/type/multichoice/questiontype.php
Expand Up @@ -358,6 +358,23 @@ function print_question_formulation_and_controls(&$question, &$state, $cmoptions
include("$CFG->dirroot/question/type/multichoice/display.html");
}

function compare_responses($question, $state, $teststate) {
if ($question->options->single) {
if (!empty($state->responses[''])) {
return $state->responses[''] == $teststate->responses[''];
} else {
return empty($teststate->response['']);
}
} else {
foreach ($question->options->answers as $ansid => $notused) {
if (empty($state->responses[$ansid]) != empty($teststate->responses[$ansid])) {
return false;
}
}
return true;
}
}

function grade_responses(&$question, &$state, $cmoptions) {
$state->raw_grade = 0;
if($question->options->single) {
Expand Down

0 comments on commit f2ca88b

Please sign in to comment.