diff --git a/lib/WeBWorK/PG.pm b/lib/WeBWorK/PG.pm index 87880142f..e535e9bcf 100644 --- a/lib/WeBWorK/PG.pm +++ b/lib/WeBWorK/PG.pm @@ -173,6 +173,7 @@ sub new_helper ($invocant, %options) { } $translator->post_process_content; + $translator->stringify_answers; # HTML_dpng uses an ImageGenerator. We have to render the queued equations. if ($image_generator) { diff --git a/lib/WeBWorK/PG/Translator.pm b/lib/WeBWorK/PG/Translator.pm index e8440e88c..bf1ba8fa1 100644 --- a/lib/WeBWorK/PG/Translator.pm +++ b/lib/WeBWorK/PG/Translator.pm @@ -49,6 +49,7 @@ WeBWorK::PG::Translator - Evaluate PG code and evaluate answers safely my $rh_problem_result = $pt->grade_problem(%options); # grades the problem. $pt->post_process_content; # Execute macro or problem hooks that further modify the problem content. + $pt->stringify_answers; # Convert objects to strings in the answer hash =head1 DESCRIPTION @@ -1059,7 +1060,6 @@ sub grade_problem { use strict; die $@ if $@; - $self->stringify_answers; return ($self->{rh_problem_result}, $self->{rh_problem_state}); }