Skip to content

Commit

Permalink
Fix a debugging messages in the formatRenderedProblem method.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
drgrice1 committed Jan 25, 2025
1 parent fd501c8 commit 1ab5a8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/FormatRenderedProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ sub formatRenderedProblem {
}

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

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

Expand Down

0 comments on commit 1ab5a8d

Please sign in to comment.