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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 14 Jan 2005 21:15:09 -0000


matthew		Fri Jan 14 16:15:09 2005 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Bug 3390: When outputting number of attempts, indicate those who did not
  get the problem correct by prepending '-' to the number.  Added 
  'non_html_notes' so I can warn the instructor about the negative values.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.245 loncom/interface/loncommon.pm:1.246
--- loncom/interface/loncommon.pm:1.245	Tue Jan  4 09:46:17 2005
+++ loncom/interface/loncommon.pm	Fri Jan 14 16:15:09 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.245 2005/01/04 14:46:17 matthew Exp $
+# $Id: loncommon.pm,v 1.246 2005/01/14 21:15:09 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -894,6 +894,7 @@
     $format->{'h1'}   = $workbook->add_format(bold=>1, size=>18);
     $format->{'h2'}   = $workbook->add_format(bold=>1, size=>16);
     $format->{'h3'}   = $workbook->add_format(bold=>1, size=>14);
+    $format->{'i'}    = $workbook->add_format(italic=>1);
     $format->{'date'} = $workbook->add_format(num_format=>
                                             'mm/dd/yyyy hh:mm:ss');
     return $format;
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.108 loncom/interface/statistics/lonstudentassessment.pm:1.109
--- loncom/interface/statistics/lonstudentassessment.pm:1.108	Wed Jan  5 15:01:46 2005
+++ loncom/interface/statistics/lonstudentassessment.pm	Fri Jan 14 16:15:09 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.108 2005/01/05 20:01:46 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.109 2005/01/14 21:15:09 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -519,6 +519,7 @@
        maximum_row => 0,
        shortdesc => 'Number of Tries before success on each Problem Part',
        longdesc =>'The number of tries before success on each problem part.',
+       non_html_notes => 'negative values indicate an incorrect problem',
        },
      { name  =>'Parts Correct',
        base  =>'tries',
@@ -954,6 +955,7 @@
     # Determine rows 
     my $header_row = $rows_output++;
     my $description_row = $rows_output++;
+    my $notes_row = $rows_output++;
     $rows_output++;        # blank row
     my $summary_header_row;
     if ($chosen_output->{'summary_table'}) {
@@ -1028,7 +1030,13 @@
     $cols_output = 0;
     $excel_sheet->write($description_row,$cols_output++,
                         $chosen_output->{'shortdesc'},
-                        $format->{'h3'});
+                        $format->{'b'});
+    #
+    $cols_output = 0;
+    $excel_sheet->write($notes_row,$cols_output++,
+                        $chosen_output->{'non_html_notes'},
+                        $format->{'i'});
+    
     ##############################################
     # Output headings for the raw data
     ##############################################
@@ -1516,6 +1524,12 @@
     print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'.
         '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'.
             "\n";
+    foreach my $item ('shortdesc','non_html_notes') {
+        next if (! exists($chosen_output->{$item}));
+        print $outputfile 
+            '"'.&Apache::loncommon::csv_translate($chosen_output->{$item}).'"'.
+            "\n";
+    }
     #
     # Print out the headings
     my $sequence_row = '';
@@ -1773,10 +1787,16 @@
                 }
             }
             #
-            if (! defined($tries) || $symbol eq '.') {
-                $tries = $symbol;
+            if (! defined($tries)) {
+                $tries = 0;
+            }
+            if ($status =~ /^(incorrect|ungraded)/) {
+                # Bug 3390: show '-' for tries on incorrect problems 
+                # (csv & excel only)
+                push(@TriesData,-$tries);
+            } else {
+                push (@TriesData,$tries);
             }
-            push (@TriesData,$tries);
             #
             if ( ($links eq 'yes' && $symbol ne ' ') ||
                  ($links eq 'all')) {