Skip to content

Commit

Permalink
don't assume quiz problem numbers include number 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Nov 13, 2023
1 parent 91d7e14 commit 524c77f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/WeBWorK/ContentGenerator/Hardcopy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,8 @@ sub display_form ($c) {
my $the_set_id = $1;
my $the_set_version = $2;
$mergedSet = $db->getMergedSetVersion($user_id, $the_set_id, $the_set_version);
my $mergedProblem = $db->getMergedProblemVersion($user_id, $the_set_id, $the_set_version, 1);
my $mergedProblem = $db->getMergedProblemVersion($user_id, $the_set_id, $the_set_version,
($db->listUserProblems($user_id, $the_set_id))[0]);

# Get the parameters needed to determine if correct answers may be shown.
my $maxAttempts = $mergedSet->attempts_per_version() || 0;
Expand Down
5 changes: 4 additions & 1 deletion lib/WeBWorK/ContentGenerator/LoginProctor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ async sub initialize ($c) {
$db->getPermissionLevel($userID),
$c->{effectiveUser},
$c->stash->{userSet},
$db->getMergedProblemVersion($effectiveUserID, $c->stash->{setID}, $versionNum, 1)
$db->getMergedProblemVersion(
$effectiveUserID, $c->stash->{setID},
$versionNum, ($db->listUserProblems($effectiveUserID, $c->stash->{setID}))[0]
)
))
{
$c->stash->{userSet}->version_last_attempt_time(int($c->submitTime));
Expand Down

0 comments on commit 524c77f

Please sign in to comment.