Skip to content

Commit

Permalink
ensure seed does not overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Nov 23, 2024
1 parent 633c7e9 commit b90be6b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/WeBWorK/AchievementItems/ExtendDueDate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub use_item ($self, $userName, $c) {
my @probIDs = $db->listUserProblems($userName, $setID);
for my $probID (@probIDs) {
my $problem = $db->getUserProblem($userName, $setID, $probID);
$problem->problem_seed($problem->problem_seed + 100);
$problem->problem_seed($problem->problem_seed % 2**31 + 1);
$db->putUserProblem($problem);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/AchievementItems/ReducedCred.pm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ sub use_item ($self, $userName, $c) {
my @probIDs = $db->listUserProblems($userName, $setID);
for my $probID (@probIDs) {
my $problem = $db->getUserProblem($userName, $setID, $probID);
$problem->problem_seed($problem->problem_seed + 100);
$problem->problem_seed($problem->problem_seed % 2**31 + 1);
$db->putUserProblem($problem);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/AchievementItems/SuperExtendDueDate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sub use_item ($self, $userName, $c) {
my @probIDs = $db->listUserProblems($userName, $setID);
for my $probID (@probIDs) {
my $problem = $db->getUserProblem($userName, $setID, $probID);
$problem->problem_seed($problem->problem_seed + 100);
$problem->problem_seed($problem->problem_seed % 2**31 + 1);
$db->putUserProblem($problem);
}
}
Expand Down

0 comments on commit b90be6b

Please sign in to comment.