Skip to content

Commit 516ccb7

Browse files
author
dlglin
committed
Correct bug where Grades.pm writes problem_user data when it should not
Fix Grades.pm so that it only updates problem_user records if they are actually broken
1 parent 772512a commit 516ccb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/WeBWorK/ContentGenerator/Grades.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,14 @@ sub grade_set {
498498
my $attempted = $problemRecord->attempted;
499499
my $num_correct = $problemRecord->num_correct || 0;
500500
my $num_incorrect = $problemRecord->num_incorrect || 0;
501-
$num_of_attempts = $num_correct + $num_incorrect;
501+
$num_of_attempts += $num_correct + $num_incorrect;
502502

503503
#######################################################
504504
# This is a fail safe mechanism that makes sure that
505505
# the problem is marked as attempted if the status has
506506
# been set or if the problem has been attempted
507507
# DBFIXME this should happen in the database layer, not here!
508-
if (!$attempted && ($status || $num_of_attempts)) {
508+
if (!$attempted && ($status || $num_correct || $num_incorrect )) {
509509
$attempted = 1;
510510
$problemRecord->attempted('1');
511511
# DBFIXME: this is another case where it

0 commit comments

Comments
 (0)