diff --git a/lib/AnswerHash.pm b/lib/AnswerHash.pm index 06ffc11f5c..0a8d9f2146 100755 --- a/lib/AnswerHash.pm +++ b/lib/AnswerHash.pm @@ -252,7 +252,7 @@ sub input { #$rh_ans->input('foo') is a synonym for $rh_ans->{student_ans}='f sub score { my $self = shift; my $score = shift; - $self->{score} = $score if defined($score); + $self->{score} = $score || 0 if defined($score); $self->{score}; } diff --git a/lib/Value/AnswerChecker.pm b/lib/Value/AnswerChecker.pm index 7abbda7099..2ae6c1f6f9 100644 --- a/lib/Value/AnswerChecker.pm +++ b/lib/Value/AnswerChecker.pm @@ -1696,7 +1696,7 @@ sub cmp_list_compare { # # Check for empty lists # - if (scalar(@correct) == 0) { $ans->score($m == 0); return } + if (scalar(@correct) == 0) { $ans->score($m == 0 ? 1 : 0); return } # # Loop through student answers looking for correct ones