shortanswer grading: MDL-18347 shortanswer was not grading correctly with custom scoring set to No, merged from 19

This commit is contained in:
mark-nielsen
2009-03-17 16:27:40 +00:00
parent fdec3d4f88
commit ab1e7c397f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -122,7 +122,7 @@
$expectedanswer = str_replace('#####', '.*', $expectedanswer);
}
// see if user typed in any of the correct answers
if (lesson_iscorrect($pageid, $answer->jumpto) and ($lesson->custom && $answer->score > 0) ) {
if ((!$lesson->custom && lesson_iscorrect($pageid, $answer->jumpto)) or ($lesson->custom && $answer->score > 0) ) {
if (!$useregexp) { // we are using 'normal analysis', which ignores case
if (preg_match('/^'.$expectedanswer.'$/i',$useranswer)) {
$ismatch = true;
+1 -1
View File
@@ -1472,7 +1472,7 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
$earned += $essayinfo->score;
$nmanual++;
$manualpoints += $answers[$attempt->answerid]->score;
} else {
} else if (!empty($attempt->answerid)) {
$earned += $answers[$attempt->answerid]->score;
}
} else {