Skip to content

Commit

Permalink
make it so URLs in feedback emails always show the problem grader
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Jordan committed Feb 1, 2025
1 parent 7cf323d commit e7f0af0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/WeBWorK/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -358,11 +358,18 @@ sub generateURLs ($c, %params) {

if ($userName) {
my $routePath;
my @args;
my $args = {};
if (defined $params{set_id} && $params{set_id} ne '') {
if ($params{problem_id}) {
$routePath = $c->url_for('problem_detail', setID => $params{set_id}, problemID => $params{problem_id});
@args = qw/displayMode showOldAnswers showCorrectAnswers showHints showSolutions/;
$args = {
displayMode => undef,
showOldAnswers => undef,
showCorrectAnswers => undef,
showHints => undef,
showSolutions => undef,
showProblemGrader => 1
};
} else {
$routePath = $c->url_for('problem_list', setID => $params{set_id});
}
Expand All @@ -372,10 +379,10 @@ sub generateURLs ($c, %params) {
$emailableURL = $c->systemLink(
$routePath,
authen => 0,
params => [ 'effectiveUser', @args ],
params => { effectiveUser => undef, %{$args} },
use_abs_url => 1,
);
$returnURL = $c->systemLink($routePath, params => [@args]);
$returnURL = $c->systemLink($routePath);
} else {
$emailableURL = '(not available)';
$returnURL = '';
Expand Down

0 comments on commit e7f0af0

Please sign in to comment.