| … | |
… | |
| 150 | $self->{must} = \%must; |
150 | $self->{must} = \%must; |
| 151 | $self->{can} = \%can; |
151 | $self->{can} = \%can; |
| 152 | $self->{will} = \%will; |
152 | $self->{will} = \%will; |
| 153 | |
153 | |
| 154 | $self->{pg} = $pg; |
154 | $self->{pg} = $pg; |
|
|
155 | } |
|
|
156 | |
|
|
157 | sub if_warnings($$) { |
|
|
158 | my ($self, $arg) = @_; |
|
|
159 | return $self->{pg}->{warnings} ne ""; |
|
|
160 | } |
|
|
161 | |
|
|
162 | sub if_errors($$) { |
|
|
163 | my ($self, $arg) = @_; |
|
|
164 | return $self->{pg}->{flags}->{error_flag}; |
| 155 | } |
165 | } |
| 156 | |
166 | |
| 157 | sub header { |
167 | sub header { |
| 158 | my $self = shift; |
168 | my $self = shift; |
| 159 | |
169 | |
| … | |
… | |
| 336 | CGI::p(CGI::i($pg->{result}->{msg})), |
346 | CGI::p(CGI::i($pg->{result}->{msg})), |
| 337 | CGI::p($pg->{body_text}), |
347 | CGI::p($pg->{body_text}), |
| 338 | CGI::p(CGI::submit(-name=>"submitAnswers", -label=>"Submit Answers")), |
348 | CGI::p(CGI::submit(-name=>"submitAnswers", -label=>"Submit Answers")), |
| 339 | CGI::endform(); |
349 | CGI::endform(); |
| 340 | |
350 | |
|
|
351 | # warning output |
|
|
352 | if ($pg->{warnings} ne "") { |
|
|
353 | print CGI::hr(), warningOutput($pg->{warnings}); |
|
|
354 | } |
|
|
355 | |
| 341 | # debugging stuff |
356 | # debugging stuff |
| 342 | #print |
357 | #print |
| 343 | # hr(), |
358 | # hr(), |
| 344 | # h2("debugging information"), |
359 | # h2("debugging information"), |
| 345 | # h3("form fields"), |
360 | # h3("form fields"), |
| … | |
… | |
| 369 | If you are a student, contact your professor to have the error corrected. |
384 | If you are a student, contact your professor to have the error corrected. |
| 370 | If you are a professor, please consut the error output below for more informaiton. |
385 | If you are a professor, please consut the error output below for more informaiton. |
| 371 | EOF |
386 | EOF |
| 372 | CGI::h3("Error messages"), CGI::blockquote(CGI::pre($error)), |
387 | CGI::h3("Error messages"), CGI::blockquote(CGI::pre($error)), |
| 373 | CGI::h3("Error context"), CGI::blockquote(CGI::pre($details)); |
388 | CGI::h3("Error context"), CGI::blockquote(CGI::pre($details)); |
|
|
389 | } |
|
|
390 | |
|
|
391 | # this is used by ProblemSet.pm too, so don't fuck it up |
|
|
392 | sub warningOutput($) { |
|
|
393 | my $warnings = shift; |
|
|
394 | |
|
|
395 | return |
|
|
396 | CGI::h2("Software Warnings"), |
|
|
397 | CGI::p(<<EOF), |
|
|
398 | WeBWorK has encountered warnings while attempting to process this problem. |
|
|
399 | It is likely that this indicates an error or ambiguity in the problem itself. |
|
|
400 | If you are a student, contact your professor to have the problem corrected. |
|
|
401 | If you are a professor, please consut the error output below for more informaiton. |
|
|
402 | EOF |
|
|
403 | CGI::h3("Warning messages"), |
|
|
404 | CGI::blockquote(CGI::pre($warnings)), |
|
|
405 | ; |
| 374 | } |
406 | } |
| 375 | |
407 | |
| 376 | sub attemptResults($$$) { |
408 | sub attemptResults($$$) { |
| 377 | my $pg = shift; |
409 | my $pg = shift; |
| 378 | my $showAttemptAnswers = shift; |
410 | my $showAttemptAnswers = shift; |