[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 09 Dec 2003 17:00:07 -0000


matthew		Tue Dec  9 12:00:07 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Modified logic in StudentTriesOnSequence to address bug 2464.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.77 loncom/interface/statistics/lonstudentassessment.pm:1.78
--- loncom/interface/statistics/lonstudentassessment.pm:1.77	Mon Dec  8 14:37:07 2003
+++ loncom/interface/statistics/lonstudentassessment.pm	Tue Dec  9 12:00:07 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.77 2003/12/08 19:37:07 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.78 2003/12/09 17:00:07 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1491,44 +1491,56 @@
             $performance_length++;
             my $symbol = ' '; # default to space
             #
+            my $awarded = 0;
+            if (exists($resource_data->{'resource.'.$partnum.'.awarded'})) {
+                $awarded = $resource_data->{'resource.'.$partnum.'.awarded'};
+                $awarded = 0 if (! $awarded);
+            }
+            #
+            my $status = '';
             if (exists($resource_data->{'resource.'.$partnum.'.solved'})) {
-                my $status = $resource_data->{'resource.'.$partnum.'.solved'};
-                if ($status eq 'correct_by_override') {
-                    $symbol = '+';
-                    $sum++;
-                } elsif ($status eq 'incorrect_by_override') {
-                    $symbol = '-';
-                } elsif ($status eq 'ungraded_attempted') {
-                    $symbol = '#';
-                } elsif ($status eq 'incorrect_attempted')  {
-                    $symbol = '.';
-                } elsif ($status eq 'excused') {
+                $status = $resource_data->{'resource.'.$partnum.'.solved'};
+            }
+            #
+            my $tries = 0;
+            if(exists($resource_data->{'resource.'.$partnum.'.tries'})) {
+                $tries = $resource_data->{'resource.'.$partnum.'.tries'};
+            }
+            #
+            if ($awarded > 0) {
+                # The student has gotten the problem correct to some degree
+                if ($status eq 'excused') {
                     $symbol = 'x';
                     $max--;
-                } elsif (($status eq 'correct_by_scantron' ||
-                          $status eq 'correct_by_student') &&
-                    exists($resource_data->{'resource.'.$partnum.'.tries'})){
-                    $tries = $resource_data->{'resource.'.$partnum.'.tries'};
+                } elsif ($status eq 'correct_by_override') {
+                    $symbol = '+';
+                    $sum++;
+                } elsif ($tries > 0) {
                     if ($tries > 9) {
                         $symbol = '*';
-                    } elsif ($tries > 0) {
-                        $symbol = $tries;
                     } else {
-                        $symbol = ' ';
+                        $symbol = $tries;
                     }
                     $sum++;
-                } elsif (exists($resource_data->{'resource.'.
-                                                     $partnum.'.tries'})){
-                    $symbol = '.';
                 } else {
-                    $symbol = ' ';
+                    $symbol = '+';
+                    $sum++;
                 }
             } else {
-                # Unsolved.  Did they try?
-                if (exists($resource_data->{'resource.'.$partnum.'.tries'})){
+                # The student has the problem incorrect or it is ungraded
+                if ($status eq 'excused') {
+                    $symbol = 'x';
+                    $max--;
+                } elsif ($status eq 'incorrect_by_override') {
+                    $symbol = '-';
+                } elsif ($status eq 'ungraded_attempted') {
+                    $symbol = '#';
+                } elsif ($status eq 'incorrect_attempted' ||
+                         $tries > 0)  {
                     $symbol = '.';
                 } else {
-                    $symbol = ' ';
+                    # Problem is wrong and has not been attempted.
+                    $symbol=' ';
                 }
             }
             #