| … | |
… | |
| 210 | my $interactive = CGI::a({-href=>$interactiveURL}, "Problem $name"); |
210 | my $interactive = CGI::a({-href=>$interactiveURL}, "Problem $name"); |
| 211 | my $attempts = $problem->num_correct + $problem->num_incorrect; |
211 | my $attempts = $problem->num_correct + $problem->num_incorrect; |
| 212 | my $remaining = $problem->max_attempts < 0 |
212 | my $remaining = $problem->max_attempts < 0 |
| 213 | ? "unlimited" |
213 | ? "unlimited" |
| 214 | : $problem->max_attempts - $attempts; |
214 | : $problem->max_attempts - $attempts; |
| 215 | my $status = $problem->status * 100 . "%"; |
215 | my $status = sprintf("%.0f%%", $problem->status * 100); # round to whole number |
| 216 | |
216 | |
| 217 | return CGI::Tr(CGI::td({-nowrap=>1}, [ |
217 | return CGI::Tr(CGI::td({-nowrap=>1}, [ |
| 218 | $interactive, |
218 | $interactive, |
| 219 | $attempts, |
219 | $attempts, |
| 220 | $remaining, |
220 | $remaining, |