| 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: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.164 2004/09/10 22:40:52 sh002i Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Problem.pm,v 1.165 2004/10/06 21:01:46 gage 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. |
| … | |
… | |
| 1016 | print CGI::start_div({class=>"scoreSummary"}); |
1016 | print CGI::start_div({class=>"scoreSummary"}); |
| 1017 | |
1017 | |
| 1018 | # score summary |
1018 | # score summary |
| 1019 | my $attempts = $problem->num_correct + $problem->num_incorrect; |
1019 | my $attempts = $problem->num_correct + $problem->num_incorrect; |
| 1020 | my $attemptsNoun = $attempts != 1 ? "times" : "time"; |
1020 | my $attemptsNoun = $attempts != 1 ? "times" : "time"; |
|
|
1021 | my $problem_status = $problem->status || 0; |
| 1021 | my $lastScore = sprintf("%.0f%%", $problem->status * 100); # Round to whole number |
1022 | my $lastScore = sprintf("%.0f%%", $problem_status * 100); # Round to whole number |
| 1022 | my ($attemptsLeft, $attemptsLeftNoun); |
1023 | my ($attemptsLeft, $attemptsLeftNoun); |
| 1023 | if ($problem->max_attempts == -1) { |
1024 | if ($problem->max_attempts == -1) { |
| 1024 | # unlimited attempts |
1025 | # unlimited attempts |
| 1025 | $attemptsLeft = "unlimited"; |
1026 | $attemptsLeft = "unlimited"; |
| 1026 | $attemptsLeftNoun = "attempts"; |
1027 | $attemptsLeftNoun = "attempts"; |