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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 08 Nov 2002 22:16:47 -0000


matthew		Fri Nov  8 17:16:47 2002 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Added a button 'Display without links' which will cause the chart to be
  sent out without 8 gigabytes of links in it.  This is to deal with a problem
  people have had with the chart - the page gets so large they cannot
  copy and paste the data out of it without their browser/os/brain crashing.
  Since the chart is appearantly used instead of the spreadsheet to assign
  grades, making its output a little easire to parse is probably worthwhile.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.17 loncom/interface/statistics/lonstudentassessment.pm:1.18
--- loncom/interface/statistics/lonstudentassessment.pm:1.17	Thu Oct 24 16:58:06 2002
+++ loncom/interface/statistics/lonstudentassessment.pm	Fri Nov  8 17:16:47 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonstudentassessment.pm,v 1.17 2002/10/24 20:58:06 minaeibi Exp $
+# $Id: lonstudentassessment.pm,v 1.18 2002/11/08 22:16:47 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -219,6 +219,17 @@
     $Str .= '</td><td>'."\n";
     $Str .= '<input type="submit" name="DefaultColumns" ';
     $Str .= 'value="Default Column Display" />'."\n";
+    $Str .= '</td><td>'."\n";
+    $Str .= '<input type="submit" name="displaymode" ';
+    if (! exists($ENV{'form.displaymode'}) ||
+        lc($ENV{'form.displaymode'}) eq 'display with links') {
+        $Str .= 'value="Display without links" />';
+        # Set the current value, in case it is undefined
+        $ENV{'form.displaymode'} = 'Display with links'; 
+    } else {
+        $Str .= 'value="Display with links" />';
+    }
+    $Str .= "\n";
     $Str .= '</td></tr></table>'."\n";
 
     return $Str;
@@ -265,7 +276,7 @@
 =item &FormatStudentData()
 
 First, FormatStudentInformation is called and prefixes the course information.
-This function produces a formatted string of the student's course information.
+This function produces a formatted string of the student\'s course information.
 Each column of data represents all the problems for a given sequence.  For
 valid grade data, a link is created for that problem to a submission record
 for that problem.
@@ -327,17 +338,21 @@
                 }
                 $hasVersion = 'true';
                 $hasData = 'true';
-                $Str .= '<a href="/adm/grades?symb=';
-                $Str .= &Apache::lonnet::escape($problem);
-                $Str .= '&student='.$username.'&domain='.$domain;
-                $Str .= '&command=submission">'; 
+                if (lc($ENV{'form.displaymode'}) ne 'display without links') {
+                    $Str .= '<a href="/adm/grades?symb=';
+                    $Str .= &Apache::lonnet::escape($problem);
+                    $Str .= '&student='.$username.'&domain='.$domain;
+                    $Str .= '&command=submission">'; 
+                }
                 my $code = $cache->{$name.':'.$problemID.':'.$_.':code'};
                 my $tries = $cache->{$name.':'.$problemID.':'.$_.':tries'};
                 if($code eq '*' && $tries < 10 && $tries ne '') {
                     $code = $tries;
                 }
                 $Str .= $code;
-                $Str .= '</a>';
+                if (lc($ENV{'form.displaymode'}) ne 'display without links') {
+                    $Str .= '</a>';
+                }
                 $characterCount++;
             }
         }