--- trunk/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm 2003/12/09 01:12:32 1663 +++ trunk/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm 2004/01/23 13:13:53 1738 @@ -1,7 +1,7 @@ ################################################################################ # WeBWorK Online Homework Delivery System # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ -# $CVSHeader$ +# $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.110 2003/12/10 18:50:36 gage Exp $ # # This program is free software; you can redistribute it and/or modify it under # the terms of either: (a) the GNU General Public License as published by the @@ -35,7 +35,6 @@ use WeBWorK::DB::Utils qw(global2user user2global findDefaults); use WeBWorK::Timing; -my $timer0_ON=0; # times pg translation phase ############################################################ # @@ -278,7 +277,7 @@ ##### translation ##### - $WeBWorK::timer0->continue("begin pg processing") if $timer0_ON; + $WeBWorK::timer->continue("begin pg processing") if defined($WeBWorK::timer); my $pg = WeBWorK::PG->new( $courseEnv, $effectiveUser, @@ -296,7 +295,7 @@ }, ); - $WeBWorK::timer0->continue("end pg processing") if $timer0_ON; + $WeBWorK::timer->continue("end pg processing") if defined($WeBWorK::timer); ##### fix hint/solution options ##### $can{showHints} &&= $pg->{flags}->{hintExists} @@ -383,7 +382,7 @@ } sub nav { - $WeBWorK::timer0->continue("begin nav subroutine") if $timer0_ON; + $WeBWorK::timer->continue("begin nav subroutine") if defined($WeBWorK::timer); my $self = shift; my $args = $_[-1]; my $setName = $self->{set}->set_id; @@ -416,7 +415,7 @@ : "") , "navNext"; my $result = $self->navMacro($args, $tail, @links); - $WeBWorK::timer0->continue("end nav subroutine") if $timer0_ON; + $WeBWorK::timer->continue("end nav subroutine") if defined($WeBWorK::timer); return $result; } @@ -470,7 +469,7 @@ } ##### answer processing ##### - $WeBWorK::timer0->continue("begin answer processing") if $timer0_ON; + $WeBWorK::timer->continue("begin answer processing") if defined($WeBWorK::timer); # if answers were submitted: my $scoreRecordedMessage; if ($submitAnswers) { @@ -566,7 +565,7 @@ } } - $WeBWorK::timer0->continue("end answer processing") if $timer0_ON; + $WeBWorK::timer->continue("end answer processing") if defined($WeBWorK::timer); ##### output ##### @@ -840,7 +839,7 @@ my $answerMessage = $showMessages ? $answerResult->{ans_message} : ""; #FIXME --Can we be sure that $answerScore is an integer-- could the problem give partial credit? $numCorrect += $answerScore > 0; - my $resultString = $answerScore ? "correct" : "incorrect"; + my $resultString = $answerScore == 1 ? "correct" : "incorrect"; # get rid of the goofy prefix on the answer names (supposedly, the format # of the answer names is changeable. this only fixes it for "AnSwEr"