Skip to content

Commit

Permalink
Merge pull request #2248 from Alex-Jordan/quiz-starting-beyond-one
Browse files Browse the repository at this point in the history
account for test that starts at a number other than 1
  • Loading branch information
drgrice1 authored Nov 16, 2023
2 parents 5494343 + c0163db commit d5e79fd
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->listProblemVersions($user_id, $the_set_id, $the_set_version))[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->listProblemVersions($effectiveUserID, $c->stash->{setID}, $versionNum))[0]
)
))
{
$c->stash->{userSet}->version_last_attempt_time(int($c->submitTime));
Expand Down

0 comments on commit d5e79fd

Please sign in to comment.