| 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/Grades.pm,v 1.17 2005/09/19 17:11:26 jj Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Grades.pm,v 1.18 2005/10/08 21:55:36 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. |
| … | |
… | |
| 335 | $totalRight += round_score($status*$probValue) if $valid_status; |
335 | $totalRight += round_score($status*$probValue) if $valid_status; |
| 336 | } |
336 | } |
| 337 | |
337 | |
| 338 | |
338 | |
| 339 | my $avg_num_attempts = ($num_of_problems) ? $num_of_attempts/$num_of_problems : 0; |
339 | my $avg_num_attempts = ($num_of_problems) ? $num_of_attempts/$num_of_problems : 0; |
| 340 | my $successIndicator = ($avg_num_attempts) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; |
340 | my $successIndicator = ($avg_num_attempts && $total) ? ($totalRight/$total)**2/$avg_num_attempts : 0 ; |
| 341 | |
341 | |
| 342 | push @rows, CGI::Tr( |
342 | push @rows, CGI::Tr( |
| 343 | CGI::td(CGI::a({-href=>$act_as_student_set_url}, WeBWorK::ContentGenerator::underscore2nbsp($setName))), |
343 | CGI::td(CGI::a({-href=>$act_as_student_set_url}, WeBWorK::ContentGenerator::underscore2nbsp($setName))), |
| 344 | CGI::td(sprintf("%0.2f",$totalRight)), # score |
344 | CGI::td(sprintf("%0.2f",$totalRight)), # score |
| 345 | CGI::td($total), # out of |
345 | CGI::td($total), # out of |