Skip to content

Commit

Permalink
Fix issue with generating a single hardcopy test version.
Browse files Browse the repository at this point in the history
  The $selected_set_id name was updated to be displayed, but was still
  being used as the set id parameter. This moves the display change to
  the line it is being used to ensure the set id parameter is unchanged.

  Fixes openwebwork#1930
  • Loading branch information
somiaj committed Apr 6, 2023
1 parent 8208c3d commit 27ab3df
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions lib/WeBWorK/ContentGenerator/Hardcopy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ sub display_form ($c) {
$canShowCorrectAnswers = $perm_view_answers
|| (defined($mergedSet) && after($mergedSet->answer_date));
}
# Make display for versioned sets a bit nicer
$selected_set_id =~ s/,v(\d+)$/ (version $1)/;
}

return $c->include(
Expand Down
2 changes: 1 addition & 1 deletion templates/ContentGenerator/Hardcopy/form.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<p>
<%== maketext(
'Download hardcopy of set [_1] for [_2]?',
tag('span', dir => 'ltr', format_set_name_display($selected_set_id)),
tag('span', dir => 'ltr', format_set_name_display($selected_set_id =~ s/,v(\d+)$/ (version $1)/r)),
join(' ', $user->first_name, $user->last_name)
) =%>
</p>
Expand Down

0 comments on commit 27ab3df

Please sign in to comment.