Permalink
Browse files

shortanswer grading: MDL-18347 shortanswer was not grading correctly …

…with custom scoring set to No
  • Loading branch information...
1 parent f40fb53 commit 589358b7f3e05fd3e966fcaaf9b4dab6105b98c0 mark-nielsen committed Mar 17, 2009
Showing with 2 additions and 2 deletions.
  1. +1 −1 mod/lesson/action/continue.php
  2. +1 −1 mod/lesson/locallib.php
@@ -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;
View
@@ -1444,7 +1444,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 {

0 comments on commit 589358b

Please sign in to comment.