@@ -594,10 +594,6 @@ async sub pre_header_initialize ($c) {
594594 }
595595 );
596596
597- # Warnings in the renderPG subprocess will not be caught by the global warning handler of this process.
598- # So rewarn them and let the global warning handler take care of it.
599- warn $pg -> {warnings } if $pg -> {warnings };
600-
601597 debug(' end pg processing' );
602598
603599 $pg -> {body_text } .= $c -> hidden_field(
@@ -609,20 +605,6 @@ async sub pre_header_initialize ($c) {
609605 $can {showHints } &&= $pg -> {flags }{hintExists };
610606 $can {showSolutions } &&= $pg -> {flags }{solutionExists };
611607
612- # Record errors
613- $c -> {pgdebug } = $pg -> {debug_messages } if ref $pg -> {debug_messages } eq ' ARRAY' ;
614- $c -> {pgwarning } = $pg -> {warning_messages } if ref $pg -> {warning_messages } eq ' ARRAY' ;
615- $c -> {pginternalerrors } = $pg -> {internal_debug_messages } if ref $pg -> {internal_debug_messages } eq ' ARRAY' ;
616- # $c->{pgerrors} is defined if any of the above are defined, and is nonzero if any are non-empty.
617- $c -> {pgerrors } = @{ $c -> {pgdebug } // [] } || @{ $c -> {pgwarning } // [] } || @{ $c -> {pginternalerrors } // [] }
618- if defined $c -> {pgdebug } || defined $c -> {pgwarning } || defined $c -> {pginternalerrors };
619-
620- # If $c->{pgerrors} is not defined, then the PG messages arrays were not defined,
621- # which means $pg->{pgcore} was not defined and the translator died.
622- warn ' Processing of this PG problem was not completed. Probably because of a syntax error. '
623- . ' The translator died prematurely and no PG warning messages were transmitted.'
624- unless defined $c -> {pgerrors };
625-
626608 # Store fields
627609 $c -> {want } = \%want ;
628610 $c -> {can } = \%can ;
@@ -635,53 +617,6 @@ async sub pre_header_initialize ($c) {
635617 return ;
636618}
637619
638- sub warnings ($c ) {
639- my $output = $c -> c;
640-
641- # Display warning messages
642- if (!defined $c -> {pgerrors }) {
643- push (
644- @$output ,
645- $c -> tag(
646- ' div' ,
647- $c -> c(
648- $c -> tag(' h3' , style => ' color:red;' , $c -> maketext(' PG question failed to render' )),
649- $c -> tag(' p' , $c -> maketext(' Unable to obtain error messages from within the PG question.' ))
650- )-> join (' ' )
651- )
652- );
653- } elsif ($c -> {pgerrors } > 0) {
654- my @pgdebug = @{ $c -> {pgdebug } // [] };
655- my @pgwarning = @{ $c -> {pgwarning } // [] };
656- my @pginternalerrors = @{ $c -> {pginternalerrors } // [] };
657- push (
658- @$output ,
659- $c -> tag(
660- ' div' ,
661- $c -> c(
662- $c -> tag(' h2' , $c -> maketext(' PG question processing error messages' )),
663- @pgdebug ? $c -> c(
664- $c -> tag(' h3' , $c -> maketext(' PG debug messages' )),
665- $c -> tag(' p' , $c -> c(@pgdebug )-> join ($c -> tag(' br' )))
666- )-> join (' ' ) : ' ' ,
667- @pgwarning ? $c -> c(
668- $c -> tag(' h3' , $c -> maketext(' PG warning messages' )),
669- $c -> tag(' p' , $c -> c(@pgwarning )-> join ($c -> tag(' br' )))
670- )-> join (' ' ) : ' ' ,
671- @pginternalerrors ? $c -> c(
672- $c -> tag(' h3' , $c -> maketext(' PG internal errors' )),
673- $c -> tag(' p' , $c -> c(@pginternalerrors )-> join ($c -> tag(' br' )))
674- )-> join (' ' ) : ' '
675- )-> join (' ' )
676- )
677- );
678- }
679-
680- push (@$output , $c -> SUPER::warnings());
681-
682- return $output -> join (' ' );
683- }
684-
685620sub head ($c ) {
686621 return ' ' if ($c -> {invalidSet });
687622 return $c -> {pg }{head_text } if $c -> {pg }{head_text };
@@ -1042,14 +977,7 @@ sub output_problem_body ($c) {
1042977 } else {
1043978 # For students render the body text of the problem with a message about error details.
1044979 return $c -> c(
1045- $c -> tag(
1046- ' div' ,
1047- id => ' output_problem_body' ,
1048- class => ' text-dark' ,
1049- style => ' color-scheme: light' ,
1050- data => { bs_theme => ' light' },
1051- $c -> b($c -> {pg }{body_text })
1052- ),
980+ $c -> tag(' div' , $c -> b($c -> {pg }{body_text })),
1053981 $c -> include(
1054982 ' ContentGenerator/Base/error_output' ,
1055983 error => $c -> {pg }{errors },
@@ -1534,7 +1462,8 @@ sub output_past_answer_button ($c) {
15341462 $c -> hidden_field(selected_sets => $c -> {problem }-> set_id),
15351463 $c -> hidden_field(selected_users => $c -> {problem }-> user_id),
15361464 $c -> tag(
1537- ' p' ,
1465+ ' div' ,
1466+ class => ' mb-3' ,
15381467 $c -> submit_button(
15391468 $c -> maketext(' Show Past Answers' ),
15401469 name => ' action' ,
0 commit comments