--- loncom/homework/grades.pm	2003/12/04 23:23:16	1.166
+++ loncom/homework/grades.pm	2003/12/05 19:54:51	1.169
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.166 2003/12/04 23:23:16 albertel Exp $
+# $Id: grades.pm,v 1.169 2003/12/05 19:54:51 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -48,7 +48,8 @@ use Apache::lonhomework;
 use Apache::loncoursedata;
 use Apache::lonmsg qw(:user_normal_msg);
 use Apache::Constants qw(:common);
-use String::Similarity;
+use Apache::lonlocal;
+#use String::Similarity;
 
 my %oldessays=();
 my %perm=();
@@ -168,7 +169,7 @@ sub showResourceInfo {
     my $col=3;
     if ($checkboxes) { $col=4; }
     my $result ='<table border="0">'.
-	'<tr><td colspan="'.$col.'"><font size="+1"><b>Current Resource: </b>'.
+	'<tr><td colspan="'.$col.'"><font size="+1"><b>'.&mt('Current Resource').': </b>'.
 	$probTitle.'</font></td></tr>'."\n";
     my ($partlist,$handgrade,$responseType) = &response_type($url);
     my %resptype = ();
@@ -1678,10 +1679,11 @@ KEYWORDS
 	my $toGrade.='<input type="button" value="Grade Student" '.
 	    'onClick="javascript:checksubmit(this.form,\'Grade Student\',\''
 	    .$counter.'\');" TARGET=_self> &nbsp;'."\n" if (&canmodify($usec));
-	$toGrade.='</td></tr></table></td></tr></table></form>'."\n";
-	$toGrade.=&show_grading_menu_form($symb,$url) 
-	    if (($ENV{'form.command'} eq 'submission') || 
-		($ENV{'form.command'} eq 'processGroup' && $counter == $total));
+	$toGrade.='</td></tr></table></td></tr></table>'."\n";
+	if (($ENV{'form.command'} eq 'submission') || 
+	    ($ENV{'form.command'} eq 'processGroup' && $counter == $total)) {
+	    $toGrade.='</form>'.&show_grading_menu_form($symb,$url) 
+	}
 	$request = print($toGrade);
 	return;
     }
@@ -2247,8 +2249,14 @@ sub viewgrades {
     &viewgrades_js($request);
 
     my ($symb,$url) = ($ENV{'form.symb'},$ENV{'form.url'}); 
-    my $result='<h3><font color="#339933">Manual Grading</font></h3>';
+    #need to make sure we have the correct data for later EXT calls, 
+    #thus invalidate the cache
+    &Apache::lonnet::devalidatecourseresdata(
+                 $ENV{'course.'.$ENV{'request.course.id'}.'.num'},
+                 $ENV{'course.'.$ENV{'request.course.id'}.'.domain'});
+    &Apache::lonnet::clear_EXT_cache_status();
 
+    my $result='<h3><font color="#339933">'.&mt('Manual Grading').'</font></h3>';
     $result.='<font size=+1><b>Current Resource: </b>'.$ENV{'form.probTitle'}.'</font>'."\n";
 
     #view individual student submission form - called using Javascript viewOneStudent
@@ -3031,6 +3039,14 @@ sub displayPage {
     my ($classlist,undef,$fullname) = &getclasslist($getsec,'1');
     my ($uname,$udom) = split(/:/,$ENV{'form.student'});
     my $usec=$classlist->{$ENV{'form.student'}}[5];
+
+    #need to make sure we have the correct data for later EXT calls, 
+    #thus invalidate the cache
+    &Apache::lonnet::devalidatecourseresdata(
+                 $ENV{'course.'.$ENV{'request.course.id'}.'.num'},
+                 $ENV{'course.'.$ENV{'request.course.id'}.'.domain'});
+    &Apache::lonnet::clear_EXT_cache_status();
+
     if (!&canview($usec)) {
 	$request->print('<font color="red">Unable to view requested student.('.$ENV{'form.student'}.')</font>');
 	$request->print(&show_grading_menu_form($symb,$url));
@@ -3202,7 +3218,7 @@ sub displaySubByDates {
 	    }
 	    if (exists $$record{"$version:resource.$partid.regrader"}) {
 		$displaySub[2].=$$record{"$version:resource.$partid.regrader"}.
-		    ' (<b>Part:</b> '.$partid.')';
+		    ' (<b>'.&mt('Part').':</b> '.$partid.')';
 	    }
 	}
 	# needed because old essay regrader has not parts info
@@ -4315,7 +4331,7 @@ GRADINGMENUJS
 
     $result.='<table width="100%" border=0>';
     $result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n".
-	'&nbsp;Select Section: <select name="section">'."\n";
+	'&nbsp;'.&mt('Select Section').': <select name="section">'."\n";
     if (ref($sections)) {
 	foreach (sort (@$sections)) {
 	    $result.='<option value="'.$_.'" '.
@@ -4324,7 +4340,7 @@ GRADINGMENUJS
     }
     $result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> &nbsp; ';
 
-    $result.='Student Status:</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef);
+    $result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef);
 
     if (ref($sections) && (grep /no/,@$sections)) {
 	$result.='&nbsp;(Section "no" implies the students were not assigned a section.)<br />';
@@ -4333,8 +4349,8 @@ GRADINGMENUJS
 
     $result.='<tr bgcolor="#ffffe6"valign="top"><td>'.
 	'<input type="radio" name="radioChoice" value="submission" '.
-	($saveCmd eq 'submission' ? 'checked' : '').'> '.'<b>Current Resource:</b> For one or more students '.
-	'<select name="submitonly">'.
+	($saveCmd eq 'submission' ? 'checked' : '').'> '.'<b>'.&mt('Current Resource').':</b> '.&mt('For one or more students').
+	' <select name="submitonly">'.
 	'<option value="yes" '.
 	($saveSub eq 'yes' ? 'selected="on"' : '').'>with submissions</option>'.
 	'<option value="graded" '.