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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 15 Dec 2005 17:53:20 -0000


albertel		Thu Dec 15 12:53:20 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - detect errors in the storage of student data. BUG#4507
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.301 loncom/homework/grades.pm:1.302
--- loncom/homework/grades.pm:1.301	Fri Dec  2 14:56:36 2005
+++ loncom/homework/grades.pm	Thu Dec 15 12:53:20 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.301 2005/12/02 19:56:36 albertel Exp $
+# $Id: grades.pm,v 1.302 2005/12/15 17:53:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3291,12 +3291,14 @@
 <form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload">
 <h3><font color="#339933">Uploading Class Grade Options</font></h3>
 <input type="hidden" name="command"    value="csvuploadassign" />
+<!--
 <p>
 <label>
    <input type="checkbox" name="show_full_results" />
    Show a table of all changes
 </label>
 </p>
+-->
 <p>
 <label>
    <input type="checkbox" name="overwite_scores" checked="checked" />
@@ -3415,9 +3417,19 @@
 	if (! %grades) { push(@skipped,"$username:$domain no data to store"); }
 	$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}";
 #	&Apache::lonnet::logthis(" storing ".(join('-',%grades)));
-	&Apache::lonnet::cstore(\%grades,$symb,$env{'request.course.id'},
-				$domain,$username);
-	$request->print('.');
+	my $result=&Apache::lonnet::cstore(\%grades,$symb,
+					   $env{'request.course.id'},
+					   $domain,$username);
+	if ($result eq 'ok') {
+	    $request->print('.');
+	} else {
+	    $request->print("<p>
+                              <font color='red'>
+                                 Failed to store student $username\@$domain.
+                                 Message when trying to store was ($result)
+                              </font>
+                             </p>" );
+	}
 	$request->rflush();
 	$countdone++;
     }