Merging fix for MDL-11900 from MOODLE_19_STABLE

This commit is contained in:
mark-nielsen
2007-12-29 21:50:53 +00:00
parent a46bb28882
commit c0fe568e2c
+20
View File
@@ -237,6 +237,8 @@
$nhits = 0;
$correctresponse = '';
$wrongresponse = '';
$correctanswerid = 0;
$wronganswerid = 0;
// store student's answers for displaying on feedback page
foreach ($answers as $answer) {
foreach ($useranswers as $key => $answerid) {
@@ -263,6 +265,10 @@
// leave in its "raw" state - will converted into a proper page id later
$correctpageid = $answer->jumpto;
}
// save the answer id for scoring
if ($correctanswerid == 0) {
$correctanswerid = $answer->id;
}
// ...also save any response from the correct answers...
if (trim(strip_tags($answer->response))) {
$correctresponse = $answer->response;
@@ -273,6 +279,10 @@
// leave in its "raw" state - will converted into a proper page id later
$wrongpageid = $answer->jumpto;
}
// save the answer id for scoring
if ($wronganswerid == 0) {
$wronganswerid = $answer->id;
}
// ...and from the incorrect ones, don't know which to use at this stage
if (trim(strip_tags($answer->response))) {
$wrongresponse = $answer->response;
@@ -293,6 +303,10 @@
// leave in its "raw" state - will converted into a proper page id later
$correctpageid = $answer->jumpto;
}
// save the answer id for scoring
if ($correctanswerid == 0) {
$correctanswerid = $answer->id;
}
// ...also save any response from the correct answers...
if (trim(strip_tags($answer->response))) {
$correctresponse = $answer->response;
@@ -303,6 +317,10 @@
// leave in its "raw" state - will converted into a proper page id later
$wrongpageid = $answer->jumpto;
}
// save the answer id for scoring
if ($wronganswerid == 0) {
$wronganswerid = $answer->id;
}
// ...and from the incorrect ones, don't know which to use at this stage
if (trim(strip_tags($answer->response))) {
$wrongresponse = $answer->response;
@@ -314,9 +332,11 @@
$correctanswer = true;
$response = $correctresponse;
$newpageid = $correctpageid;
$answerid = $correctanswerid;
} else {
$response = $wrongresponse;
$newpageid = $wrongpageid;
$answerid = $wronganswerid;
}
} else {
// only one answer allowed