| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.184 2005/08/26 17:30:05 jj Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.185 2005/09/16 18:50:50 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 248 | my $correctAnswer = $answerResult->{correct_ans}; |
248 | my $correctAnswer = $answerResult->{correct_ans}; |
| 249 | my $answerScore = $answerResult->{score}; |
249 | my $answerScore = $answerResult->{score}; |
| 250 | my $answerMessage = $showMessages ? $answerResult->{ans_message} : ""; |
250 | my $answerMessage = $showMessages ? $answerResult->{ans_message} : ""; |
| 251 | $answerMessage =~ s/\n/<BR>/g; |
251 | $answerMessage =~ s/\n/<BR>/g; |
| 252 | $numCorrect += $answerScore >= 1; |
252 | $numCorrect += $answerScore >= 1; |
| 253 | $numBlanks++ unless $studentAnswer =~/\S/; # unless student answer contains entry |
253 | $numBlanks++ unless $studentAnswer =~/\S/ || $answerScore >= 1; # unless student answer contains entry |
| 254 | my $resultString = $answerScore >= 1 ? "correct" : |
254 | my $resultString = $answerScore >= 1 ? "correct" : |
| 255 | $answerScore > 0 ? int($answerScore*100)."% correct" : |
255 | $answerScore > 0 ? int($answerScore*100)."% correct" : |
| 256 | "incorrect"; |
256 | "incorrect"; |
| 257 | $fully = 'completely ' if $answerScore >0 and $answerScore < 1; |
257 | $fully = 'completely ' if $answerScore >0 and $answerScore < 1; |
| 258 | |
258 | |