mod-lesson MDL-22349 Fixed bug with matching lesson type and empty correct response. Kudos to Michael Lipp for the patch
This commit is contained in:
@@ -415,12 +415,7 @@
|
||||
|
||||
$response = '';
|
||||
if ($ncorrect == count($answers)-2) { // dont count correct/wrong responses in the total.
|
||||
foreach ($answers as $answer) {
|
||||
if ($answer->response == NULL && $answer->answer != NULL) {
|
||||
$response = $answer->answer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$response = reset($answers)->answer;
|
||||
if (isset($correctpageid)) {
|
||||
$newpageid = $correctpageid;
|
||||
}
|
||||
@@ -429,16 +424,8 @@
|
||||
}
|
||||
$correctanswer = true;
|
||||
} else {
|
||||
$t = 0;
|
||||
foreach ($answers as $answer) {
|
||||
if ($answer->response == NULL && $answer->answer != NULL) {
|
||||
if ($t == 1) {
|
||||
$response = $answer->answer;
|
||||
break;
|
||||
}
|
||||
$t++;
|
||||
}
|
||||
}
|
||||
reset($answers);
|
||||
$response = next($answers)->answer;
|
||||
$newpageid = $wrongpageid;
|
||||
$answerid = $wronganswerid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user