[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /homework grades.pm

raeburn raeburn@source.lon-capa.org
Sun, 27 Dec 2009 02:05:40 -0000


raeburn		Sun Dec 27 02:05:40 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/homework	grades.pm 
  Log:
  - Backport 1.576.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.574.2.5 loncom/homework/grades.pm:1.574.2.6
--- loncom/homework/grades.pm:1.574.2.5	Sun Dec 27 01:51:07 2009
+++ loncom/homework/grades.pm	Sun Dec 27 02:05:40 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.574.2.5 2009/12/27 01:51:07 raeburn Exp $
+# $Id: grades.pm,v 1.574.2.6 2009/12/27 02:05:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9050,13 +9050,13 @@
           my $sum=0;
           my $realnumber=$number;
           for (my $i=0;$i<$number;$i++) {
-             if ($answer[$i]) {
+             if  ($correct[$i] eq '-') {
+                $realnumber--;
+             } elsif ($answer[$i]) {
                 if ($gradingmechanism eq 'attendance') {
                    $sum+=$pcorrect;
-                } elsif ($answer[$i] eq '*') {
+                } elsif ($correct[$i] eq '*') {
                    $sum+=$pcorrect;
-                } elsif ($answer[$i] eq '-') {
-                   $realnumber--;
                 } else {
                    if ($answer[$i] eq $correct[$i]) {
                       $sum+=$pcorrect;