Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account for test that starts at a number other than 1 #2248

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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