From 057df45b98a7b5731a68612407f0f8c5f1ac4197 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 13 Apr 2026 07:52:54 -0500 Subject: [PATCH] Fix a minor issue resulting from #2935. There is no longer a `pgwarning` key set on the controller object for the `lib/WeBWorK/ContentGenerator/Problem.pm` module and never was a `pgwarning` key for the returned pg object in the `lib/ContentGenerator/GatewayQuiz.pm` module. So use the correct key on the returned pg object in both cases. That is the `warning_messages` key. The warning messages were still being shown at the bottom, but not the message at the top of the page notifying of the existence of those warnings. Since the warnings at the bottom might not be visible, the warnings may be missed. --- lib/WeBWorK/ContentGenerator/GatewayQuiz.pm | 2 +- templates/ContentGenerator/Problem.html.ep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm index 246ab07820..9a9ca95f8f 100644 --- a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -1512,7 +1512,7 @@ async sub getProblemHTML ($c, $effectiveUser, $set, $formFields, $mergedProblem) if $c->{can}{checkAnswers} && (!$c->{submitAnswers} || defined $c->param('problem_data_' . $mergedProblem->problem_id)); - $c->stash->{haveProblemWarnings} = 1 if $pg->{warnings} || @{ $pg->{pgwarning} // [] }; + $c->stash->{haveProblemWarnings} = 1 if $pg->{warnings} || @{ $pg->{warning_messages} // [] }; return $pg; } diff --git a/templates/ContentGenerator/Problem.html.ep b/templates/ContentGenerator/Problem.html.ep index 1a56d2af51..fb98ec10ab 100644 --- a/templates/ContentGenerator/Problem.html.ep +++ b/templates/ContentGenerator/Problem.html.ep @@ -65,7 +65,7 @@ % stash->{footerWidthClass} = 'col-lg-10'; % <%== $c->post_header_text =%> -% if ($c->{pg}{warnings} || @{ $c->{pgwarning} // [] }) { +% if ($c->{pg}{warnings} || @{ $c->{pg}{warning_messages} // [] }) {
<%== maketext('Warning: There may be something wrong with this question. '