Skip to content

Commit 313eb68

Browse files
committed
Fix a debugging messages in the formatRenderedProblem method.
The `formatRenderedProblem` method of the `FormatRenderedProblem` module ensures that the `debug_messages` key of the rendered problem result is an array reference, but checks the wrong thing. It checks if the result itself is an array reference instead of the `debug_messages` hash key of the result. Since the result is always a hash reference and never an array reference, this means that the debugging messages from PG are always wiped out and replaced with a reference to an empty array. This was discovered when investigating #2661. If we want to switch the PG problem editor to using the `debug` output format of the `formatRenderedProblem` method we could, but in order to get the benefit of that change we need this.
1 parent 55983f1 commit 313eb68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/FormatRenderedProblem.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ sub formatRenderedProblem {
187187
if $ws->c->current_route eq 'render_rpc' && ($ws->c->param('displayMode') // '') eq 'PTX';
188188
}
189189

190-
# Make sure this is defined and is an array reference as saveGradeToLTI might add to it.
191-
$rh_result->{debug_messages} = [] unless defined $rh_result && ref $rh_result eq 'ARRAY';
190+
# Make sure $rh_result->{debug_messages} an array reference as saveGradeToLTI might add to it.
191+
$rh_result->{debug_messages} = [] unless ref $rh_result->{debug_messages} eq 'ARRAY';
192192

193193
$forbidGradePassback = 1 if !$forbidGradePassback && !$submitMode;
194194

0 commit comments

Comments
 (0)