qtype_multichoice MDL-24937 multichoice questions were getting marked as answered even when they weren't.
This commit is contained in:
@@ -159,6 +159,7 @@ $string['categorynamecantbeblank'] = 'The category name cannot be blank.';
|
||||
$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';
|
||||
|
||||
@@ -358,6 +358,23 @@ class question_multichoice_qtype extends default_questiontype {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user