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

www lon-capa-cvs-allow@mail.lon-capa.org
Tue, 05 Feb 2008 18:32:35 -0000


www		Tue Feb  5 13:32:35 2008 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  If there is nothing to save, there's nothing to save.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.507 loncom/homework/grades.pm:1.508
--- loncom/homework/grades.pm:1.507	Mon Feb  4 18:30:05 2008
+++ loncom/homework/grades.pm	Tue Feb  5 13:32:34 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.507 2008/02/04 23:30:05 raeburn Exp $
+# $Id: grades.pm,v 1.508 2008/02/05 18:32:34 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3960,31 +3960,31 @@
 		$grades{$store_key}=$entries{$fields{$dest}};
 	    }
 	}
-	if (! %grades) { push(@skipped,"$username:$domain no data to save"); }
-	$grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}";
-	my $result=&Apache::lonnet::cstore(\%grades,$symb,
+	if (! %grades) { 
+           push(@skipped,&mt("[_1]: no data to save","$username:$domain")); 
+        } else {
+	   $grades{"resource.regrader"}="$env{'user.name'}:$env{'user.domain'}";
+	   my $result=&Apache::lonnet::cstore(\%grades,$symb,
 					   $env{'request.course.id'},
 					   $domain,$username);
-	if ($result eq 'ok') {
-	    $request->print('.');
-	} else {
-	    $request->print("<p>
-                              <span class=\"LC_error\">
-                                 Failed to save student $username:$domain.
-                                 Message when trying to save was ($result)
-                              </span>
-                             </p>" );
-	}
-	$request->rflush();
-	$countdone++;
+	   if ($result eq 'ok') {
+	      $request->print('.');
+	   } else {
+	      $request->print("<p><span class=\"LC_error\">".
+                              &mt("Failed to save data for student [_1]. Message when trying to save was: [_2]",
+                                  "$username:$domain",$result)."</span></p>");
+	   }
+	   $request->rflush();
+	   $countdone++;
+        }
     }
-    $request->print("<br />Saved $countdone students\n");
+    $request->print('<br /><span class="LC_info">'.&mt("Saved [_1] students",$countdone)."</span>\n");
     if (@skipped) {
-	$request->print('<p><h4><b>Skipped Students</b></h4></p>');
+	$request->print('<p><span class="LC_warning">'.&mt('Skipped Students').'</span></p>');
 	foreach my $student (@skipped) { $request->print("$student<br />\n"); }
     }
     if (@notallowed) {
-	$request->print('<p><span class="LC_error">Students Not Allowed to Modify</span></p>');
+	$request->print('<p><span class="LC_error">'.&mt('Students Not Allowed to Modify').'</span></p>');
 	foreach my $student (@notallowed) { $request->print("$student<br />\n"); }
     }
     $request->print("<br />\n");