diff --git a/conf/defaults.config b/conf/defaults.config index eb631e9790..d024c7ff1f 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -81,6 +81,11 @@ $mail{feedbackSubjectFormat} = "[WWfeedback] course:%c user:%u set:%s prob:%p se # 2: as in 1, plus the problem environment (debugging data) $mail{feedbackVerbosity} = 1; +# If this is 1, then the links included in feedback emails when feedback is sent +# from a problem will open the problem grader when followed. If this is 0, then +# the problem grader will not be open when those links are followed. +$mail{linksOpenProblemGrader} = 1; + # Should the studentID be included in the feedback email when feedbackVerbosity > 0: # The default is yes $blockStudentIDinFeedback = 0; diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist index f8c90710d9..fa6d1eed78 100644 --- a/conf/localOverrides.conf.dist +++ b/conf/localOverrides.conf.dist @@ -61,6 +61,11 @@ $mail{feedbackRecipients} = [ #'prof2@yourserver.yourdomain.edu', ]; +# If this is 1, then the links included in feedback emails when feedback is sent +# from a problem will open the problem grader when followed. If this is 0, then +# the problem grader will not be open when those links are followed. +#$mail{linksOpenProblemGrader} = 0; + # Should the studentID be included in the feedback email when feedbackVerbosity > 0: # The default is yes. Uncomment the line below to block it from being included. # Blocking it from being included is recommended if the studentID is "personal" diff --git a/lib/WeBWorK/ConfigValues.pm b/lib/WeBWorK/ConfigValues.pm index 27ccd65cbb..811e90bb53 100644 --- a/lib/WeBWorK/ConfigValues.pm +++ b/lib/WeBWorK/ConfigValues.pm @@ -886,6 +886,17 @@ sub getConfigValues ($ce) { ), type => 'boolean' }, + { + var => 'mail{linksOpenProblemGrader}', + doc => x('Feedback links open problem grader'), + doc2 => x( + 'If this is true, then the links included in feedback emails sent from a problem will have the ' + . 'problem grader open when followed. If this is false, then the problem grader will not ' + . 'be open when those links are followed. The problem grader may still be opened in any ' + . 'case by using the "Show Problem Grader" button.' + ), + type => 'boolean' + }, ], ]; diff --git a/lib/WeBWorK/Utils.pm b/lib/WeBWorK/Utils.pm index 86a2e91a90..0b29c26c98 100644 --- a/lib/WeBWorK/Utils.pm +++ b/lib/WeBWorK/Utils.pm @@ -356,7 +356,7 @@ sub generateURLs ($c, %params) { for my $name ('displayMode', 'showCorrectAnswers', 'showHints', 'showOldAnswers', 'showSolutions') { $args{$name} = [ $c->param($name) ] if defined $c->param($name) && $c->param($name) ne ''; } - $args{showProblemGrader} = 1; + $args{showProblemGrader} = 1 if $c->ce->{mail}{linksOpenProblemGrader}; } else { $routePath = $c->url_for('problem_list', setID => $params{set_id}); }