diff --git a/lib/WeBWorK/AchievementItems/ExtendDueDate.pm b/lib/WeBWorK/AchievementItems/ExtendDueDate.pm index ecc5816b0e..f645c59734 100644 --- a/lib/WeBWorK/AchievementItems/ExtendDueDate.pm +++ b/lib/WeBWorK/AchievementItems/ExtendDueDate.pm @@ -79,9 +79,7 @@ sub use_item ($self, $userName, $c) { # Change the seed for all of the problems if the set is currently closed. if (after($set->due_date)) { - my @probIDs = $db->listUserProblems($userName, $setID); - for my $probID (@probIDs) { - my $problem = $db->getUserProblem($userName, $setID, $probID); + for my $problem ($db->getUserProblemsWhere({ user_id => $userName, set_id => $setID })) { $problem->problem_seed($problem->problem_seed % 2**31 + 1); $db->putUserProblem($problem); } diff --git a/lib/WeBWorK/AchievementItems/ReducedCred.pm b/lib/WeBWorK/AchievementItems/ReducedCred.pm index 23a8ff0dc2..297c275d7e 100644 --- a/lib/WeBWorK/AchievementItems/ReducedCred.pm +++ b/lib/WeBWorK/AchievementItems/ReducedCred.pm @@ -85,9 +85,7 @@ sub use_item ($self, $userName, $c) { # Change the seed for all of the problems if the set is currently closed. if (after($set->due_date)) { - my @probIDs = $db->listUserProblems($userName, $setID); - for my $probID (@probIDs) { - my $problem = $db->getUserProblem($userName, $setID, $probID); + for my $problem ($db->getUserProblemsWhere({ user_id => $userName, set_id => $setID })) { $problem->problem_seed($problem->problem_seed % 2**31 + 1); $db->putUserProblem($problem); } diff --git a/lib/WeBWorK/AchievementItems/SuperExtendDueDate.pm b/lib/WeBWorK/AchievementItems/SuperExtendDueDate.pm index eb9cf88da1..ccf960321d 100644 --- a/lib/WeBWorK/AchievementItems/SuperExtendDueDate.pm +++ b/lib/WeBWorK/AchievementItems/SuperExtendDueDate.pm @@ -79,9 +79,7 @@ sub use_item ($self, $userName, $c) { # Change the seed for all of the problems if the set is currently closed. if (after($set->due_date)) { - my @probIDs = $db->listUserProblems($userName, $setID); - for my $probID (@probIDs) { - my $problem = $db->getUserProblem($userName, $setID, $probID); + for my $problem ($db->getUserProblemsWhere({ user_id => $userName, set_id => $setID })) { $problem->problem_seed($problem->problem_seed % 2**31 + 1); $db->putUserProblem($problem); }