[system] / branches / gage_dev / webwork2 / lib / WeBWorK / ContentGenerator / Problem.pm Repository:
ViewVC logotype

Diff of /branches/gage_dev/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 555 Revision 558
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
157sub if_warnings($$) {
158 my ($self, $arg) = @_;
159 return $self->{pg}->{warnings} ne "";
160}
161
162sub if_errors($$) {
163 my ($self, $arg) = @_;
164 return $self->{pg}->{flags}->{error_flag};
155} 165}
156 166
157sub header { 167sub 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"),
369If you are a student, contact your professor to have the error corrected. 384If you are a student, contact your professor to have the error corrected.
370If you are a professor, please consut the error output below for more informaiton. 385If you are a professor, please consut the error output below for more informaiton.
371EOF 386EOF
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
392sub warningOutput($) {
393 my $warnings = shift;
394
395 return
396 CGI::h2("Software Warnings"),
397 CGI::p(<<EOF),
398WeBWorK has encountered warnings while attempting to process this problem.
399It is likely that this indicates an error or ambiguity in the problem itself.
400If you are a student, contact your professor to have the problem corrected.
401If you are a professor, please consut the error output below for more informaiton.
402EOF
403 CGI::h3("Warning messages"),
404 CGI::blockquote(CGI::pre($warnings)),
405 ;
374} 406}
375 407
376sub attemptResults($$$) { 408sub attemptResults($$$) {
377 my $pg = shift; 409 my $pg = shift;
378 my $showAttemptAnswers = shift; 410 my $showAttemptAnswers = shift;

Legend:
Removed from v.555  
changed lines
  Added in v.558

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9