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

ng lon-capa-cvs@mail.lon-capa.org
Mon, 24 Mar 2003 21:03:54 -0000


This is a MIME encoded message

--ng1048539834
Content-Type: text/plain

ng		Mon Mar 24 16:03:54 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  fix bugs 1287 and 1314
  
  
  
--ng1048539834
Content-Type: text/plain
Content-Disposition: attachment; filename="ng-20030324160354.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.75 loncom/homework/grades.pm:1.76
--- loncom/homework/grades.pm:1.75	Sun Mar 23 03:10:30 2003
+++ loncom/homework/grades.pm	Mon Mar 24 16:03:54 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.75 2003/03/23 08:10:30 albertel Exp $
+# $Id: grades.pm,v 1.76 2003/03/24 21:03:54 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -113,7 +113,7 @@
 #--- Dumps the class list with usernames,list of sections,
 #--- section, ids and fullnames for each user.
 sub getclasslist {
-    my ($getsec,$hideexpired) = @_;
+    my ($getsec,$filterlist) = @_;
     my $classlist=&Apache::loncoursedata::get_classlist();
     # Bail out if we were unable to get the classlist
     return if (! defined($classlist));
@@ -124,11 +124,13 @@
         # the following undefs are for 'domain', and 'username' respectively.
 	my (undef,undef,$end,$start,$id,$section,$fullname,$status)=
             @{$classlist->{$_}};
-	# still a student?
-	if (($hideexpired) && ($status ne 'Active')) {
-            delete ($classlist->{$_});
-            next;
-        }
+	# filter students according to status selected
+	if ($filterlist && $ENV{'form.saveStatus'} ne 'Any') {
+	    if ($ENV{'form.saveStatus'} ne $status) {
+		delete ($classlist->{$_});
+		next;
+	    }
+	}
 	$section = ($section ne '' ? $section : 'no');
 	if ($getsec eq 'all' || $getsec eq $section) {
             $sections{$section}++;
@@ -209,8 +211,10 @@
     $jscript.= '<form action="/adm/grades" method="post" name="onestudent">'."\n".
 	'<input type="hidden" name="symb"    value="'.$symb.'" />'."\n".
 	'<input type="hidden" name="url"     value="'.$url.'" />'."\n".
-	'<input type="hidden" name="lastCmd" value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec" value="'.$ENV{'form.lastSec'}.'" />'."\n".
+	'<input type="hidden" name="saveCmd" value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec" value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub" value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n".
 	'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n".
 	'<input type="hidden" name="command" value="submission" />'."\n".
 	'<input type="hidden" name="student" value="" />'."\n".
@@ -300,6 +304,8 @@
     $result.='</table>';
 
     my $viewgrade = $ENV{'form.handgrade'} eq 'yes' ? 'View/Grade' : 'View';
+    $ENV{'form.probTitle'} = $ENV{'form.probTitle'} eq '' ? 
+	&Apache::lonnet::gettitle($symb) : $ENV{'form.probTitle'};
 
     $result='<h3><font color="#339933">&nbsp;'.
 	$viewgrade.
@@ -355,8 +361,10 @@
 	'<input type="hidden" name="response"    value="'.$ENV{'form.response'}.'" />'."\n".
 	'<input type="hidden" name="handgrade"   value="'.$ENV{'form.handgrade'}.'" /><br />'."\n".
 	'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" /><br />'."\n".
-	'<input type="hidden" name="lastCmd"     value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec"     value="'.$ENV{'form.lastSec'}.'" />'."\n".
+	'<input type="hidden" name="saveCmd"     value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec"     value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub"     value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus"  value="'.$ENV{'form.saveStatus'}.'" />'."\n".
 	'<input type="hidden" name="probTitle"   value="'.$ENV{'form.probTitle'}.'" />'."\n".
 	'<input type="hidden" name="url"  value="'.$url.'" />'."\n".
 	'<input type="hidden" name="symb" value="'.$symb.'" />'."\n".
@@ -368,7 +376,7 @@
 	'onClick="javascript:checkSelect(this.form.stuinfo);" '."\n".
 	'value="'.$viewgrade.'" />'."\n";
  
-    my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+    my (undef,undef,$fullname) = &getclasslist($getsec,$ENV{'form.showgrading'} eq 'yes' ? '1' : '0');
     
     $gradeTable.='<table border="0"><tr><td bgcolor="#777777">'.
 	'<table border="0"><tr bgcolor="#e6ffff">'.
@@ -631,8 +639,7 @@
 
 //===================== Show list of keywords ====================
   function keywords(keyform) {
-    var keywds = keyform.value;
-    var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keywds);
+    var nret = prompt("Keywords list, separated by a space. Add/delete to list if desired.",keyform.value);
     if (nret==null) return;
     keyform.value = nret;
 
@@ -701,91 +708,97 @@
     return;
   }
 
+//  var pWin = null;
   function savedMsgHeader(Nmsg,usrctr,fullname) {
-    var height = 50*Nmsg+250;
+    var height = 70*Nmsg+250;
     var scrollbar = "no";
     if (height > 600) {
 	height = 600;
 	scrollbar = "yes";
     }
-/*    if (window.pWin)
-	window.pWin.close(); */
+//    if (window.pWin) window.pWin.close();
     pWin = window.open('', 'MessageCenter', 'toolbar=no,location=no,scrollbars='+scrollbar+',screenx=70,screeny=75,width=600,height='+height);
-    pWin.document.write("<html><head>");
-    pWin.document.write("<title>Message Central</title>");
-
-    pWin.document.write("<script language=javascript>");
-    pWin.document.write("function checkInput() {");
-    pWin.document.write("  opener.document.SCORE.msgsub.value = document.msgcenter.msgsub.value;");
-    pWin.document.write("  var nmsg   = opener.document.SCORE.savemsgN.value;");
-    pWin.document.write("  var usrctr = document.msgcenter.usrctr.value;");
-    pWin.document.write("  var newval = eval(\\"opener.document.SCORE.newmsg\\"+usrctr);");
-    pWin.document.write("  newval.value = document.msgcenter.newmsg.value;");
-
-    pWin.document.write("  var msgchk = \\"\\";");
-    pWin.document.write("  if (document.msgcenter.subchk.checked) {");
-    pWin.document.write("     msgchk = \\"msgsub,\\";");
-    pWin.document.write("  }");
-    pWin.document.write(   "for (var i=1; i<=nmsg; i++) {");
-    pWin.document.write("      var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);");
-    pWin.document.write("      var frmmsg = eval(\\"document.msgcenter.msg\\"+i);");
-    pWin.document.write("      opnmsg.value = frmmsg.value;");
-    pWin.document.write("      var chkbox = eval(\\"document.msgcenter.msgn\\"+i);");
-    pWin.document.write("      if (chkbox.checked) {");
-    pWin.document.write("         msgchk += \\"savemsg\\"+i+\\",\\";");
-    pWin.document.write("      }");
-    pWin.document.write("  }");
-    pWin.document.write("  if (document.msgcenter.newmsgchk.checked) {");
-    pWin.document.write("     msgchk += \\"newmsg\\"+usrctr;");
-    pWin.document.write("  }");
-    pWin.document.write("  var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);");
-    pWin.document.write("  includemsg.value = msgchk;");
-
-    pWin.document.write("  self.close()");
-
-    pWin.document.write("}");
-
-    pWin.document.write("<");
-    pWin.document.write("/script>");
-
-    pWin.document.write("</head><body bgcolor=white>");
-
-    pWin.document.write("<form action=\\"inactive\\" name=\\"msgcenter\\">");
-    pWin.document.write("<input value=\\""+usrctr+"\\" name=\\"usrctr\\" type=\\"hidden\\">");
-    pWin.document.write("<font color=\\"green\\" size=+1>&nbsp;Compose Message for \"+fullname+\"</font><br><br>");
-
-    pWin.document.write("<table border=0 width=100%><tr><td bgcolor=\\"#777777\\">");
-    pWin.document.write("<table border=0 width=100%><tr bgcolor=\\"#ddffff\\">");
-    pWin.document.write("<td><b>Type</b></td><td><b>Include</b></td><td><b>Message</td></tr>");
+    pWin.focus();
+    pDoc = pWin.document;
+    pDoc.write("<html><head>");
+    pDoc.write("<title>Message Central</title>");
+
+    pDoc.write("<script language=javascript>");
+    pDoc.write("function checkInput() {");
+    pDoc.write("  opener.document.SCORE.msgsub.value = document.msgcenter.msgsub.value;");
+    pDoc.write("  var nmsg   = opener.document.SCORE.savemsgN.value;");
+    pDoc.write("  var usrctr = document.msgcenter.usrctr.value;");
+    pDoc.write("  var newval = eval(\\"opener.document.SCORE.newmsg\\"+usrctr);");
+    pDoc.write("  newval.value = document.msgcenter.newmsg.value;");
+
+    pDoc.write("  var msgchk = \\"\\";");
+    pDoc.write("  if (document.msgcenter.subchk.checked) {");
+    pDoc.write("     msgchk = \\"msgsub,\\";");
+    pDoc.write("  }");
+    pDoc.write(   "for (var i=1; i<=nmsg; i++) {");
+    pDoc.write("      var opnmsg = eval(\\"opener.document.SCORE.savemsg\\"+i);");
+    pDoc.write("      var frmmsg = eval(\\"document.msgcenter.msg\\"+i);");
+    pDoc.write("      opnmsg.value = frmmsg.value;");
+    pDoc.write("      var chkbox = eval(\\"document.msgcenter.msgn\\"+i);");
+    pDoc.write("      if (chkbox.checked) {");
+    pDoc.write("         msgchk += \\"savemsg\\"+i+\\",\\";");
+    pDoc.write("      }");
+    pDoc.write("  }");
+    pDoc.write("  if (document.msgcenter.newmsgchk.checked) {");
+    pDoc.write("     msgchk += \\"newmsg\\"+usrctr;");
+    pDoc.write("  }");
+    pDoc.write("  var includemsg = eval(\\"opener.document.SCORE.includemsg\\"+usrctr);");
+    pDoc.write("  includemsg.value = msgchk;");
+
+    pDoc.write("  self.close()");
+
+    pDoc.write("}");
+
+    pDoc.write("<");
+    pDoc.write("/script>");
+
+    pDoc.write("</head><body bgcolor=white>");
+
+    pDoc.write("<form action=\\"inactive\\" name=\\"msgcenter\\">");
+    pDoc.write("<input value=\\""+usrctr+"\\" name=\\"usrctr\\" type=\\"hidden\\">");
+    pDoc.write("<font color=\\"green\\" size=+1>&nbsp;Compose Message for \"+fullname+\"</font><br><br>");
+
+    pDoc.write("<table border=0 width=100%><tr><td bgcolor=\\"#777777\\">");
+    pDoc.write("<table border=0 width=100%><tr bgcolor=\\"#ddffff\\">");
+    pDoc.write("<td><b>Type</b></td><td><b>Include</b></td><td><b>Message</td></tr>");
 }
     function displaySubject(msg,shwsel) {
-    pWin.document.write("<tr bgcolor=\\"#ffffdd\\">");
-    pWin.document.write("<td>Subject</td>");
-    pWin.document.write("<td align=\\"center\\"><input name=\\"subchk\\" type=\\"checkbox\\"" +shwsel+"></td>");
-    pWin.document.write("<td><input name=\\"msgsub\\" type=\\"text\\" value=\\""+msg+"\\"size=\\"60\\" maxlength=\\"80\\"></td></tr>");
+    pDoc = pWin.document;
+    pDoc.write("<tr bgcolor=\\"#ffffdd\\">");
+    pDoc.write("<td>Subject</td>");
+    pDoc.write("<td align=\\"center\\"><input name=\\"subchk\\" type=\\"checkbox\\"" +shwsel+"></td>");
+    pDoc.write("<td><input name=\\"msgsub\\" type=\\"text\\" value=\\""+msg+"\\"size=\\"60\\" maxlength=\\"80\\"></td></tr>");
 }
 
   function displaySavedMsg(ctr,msg,shwsel) {
-    pWin.document.write("<tr bgcolor=\\"#ffffdd\\">");
-    pWin.document.write("<td align=\\"center\\">"+ctr+"</td>");
-    pWin.document.write("<td align=\\"center\\"><input name=\\"msgn"+ctr+"\\" type=\\"checkbox\\"" +shwsel+"></td>");
-    pWin.document.write("<td><textarea name=\\"msg"+ctr+"\\" cols=\\"60\\" rows=\\"3\\">"+msg+"</textarea></td></tr>");
+    pDoc = pWin.document;
+    pDoc.write("<tr bgcolor=\\"#ffffdd\\">");
+    pDoc.write("<td align=\\"center\\">"+ctr+"</td>");
+    pDoc.write("<td align=\\"center\\"><input name=\\"msgn"+ctr+"\\" type=\\"checkbox\\"" +shwsel+"></td>");
+    pDoc.write("<td><textarea name=\\"msg"+ctr+"\\" cols=\\"60\\" rows=\\"3\\">"+msg+"</textarea></td></tr>");
 }
 
   function newMsg(newmsg,shwsel) {
-    pWin.document.write("<tr bgcolor=\\"#ffffdd\\">");
-    pWin.document.write("<td align=\\"center\\">New</td>");
-    pWin.document.write("<td align=\\"center\\"><input name=\\"newmsgchk\\" type=\\"checkbox\\"" +shwsel+"></td>");
-    pWin.document.write("<td><textarea name=\\"newmsg\\" cols=\\"60\\" rows=\\"3\\" onchange=\\"javascript:this.form.newmsgchk.checked=true\\" >"+newmsg+"</textarea></td></tr>");
+    pDoc = pWin.document;
+    pDoc.write("<tr bgcolor=\\"#ffffdd\\">");
+    pDoc.write("<td align=\\"center\\">New</td>");
+    pDoc.write("<td align=\\"center\\"><input name=\\"newmsgchk\\" type=\\"checkbox\\"" +shwsel+"></td>");
+    pDoc.write("<td><textarea name=\\"newmsg\\" cols=\\"60\\" rows=\\"3\\" onchange=\\"javascript:this.form.newmsgchk.checked=true\\" >"+newmsg+"</textarea></td></tr>");
 }
 
   function msgTail() {
-    pWin.document.write("</table>");
-    pWin.document.write("</td></tr></table>&nbsp;");
-    pWin.document.write("<input type=\\"button\\" value=\\"Save\\" onClick=\\"javascript:checkInput()\\">&nbsp;&nbsp;");
-    pWin.document.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>");
-    pWin.document.write("</form>");
-    pWin.document.write("</body></html>");
+    pDoc = pWin.document;
+    pDoc.write("</table>");
+    pDoc.write("</td></tr></table>&nbsp;");
+    pDoc.write("<input type=\\"button\\" value=\\"Save\\" onClick=\\"javascript:checkInput()\\">&nbsp;&nbsp;");
+    pDoc.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>");
+    pDoc.write("</form>");
+    pDoc.write("</body></html>");
 }
 
 //====================== Script for keyword highlight options ==============
@@ -819,65 +832,70 @@
     return;
   }
 
-
+//  var hwdWin = null;
   function highlightCentral() {
+//    if (window.hwdWin) window.hwdWin.close();
     hwdWin = window.open('', 'KeywordHighlightCentral', 'toolbar=no,location=no,scrollbars=no,width=400,height=300,screenx=100,screeny=75');
-    hwdWin.document.write("<html><head>");
-    hwdWin.document.write("<title>Highlight Central</title>");
-
-    hwdWin.document.write("<script language=javascript>");
-    hwdWin.document.write("function updateChoice(flag) {");
-    hwdWin.document.write("  opener.document.SCORE.kwclr.value = radioSelection(document.hlCenter.kwdclr);");
-    hwdWin.document.write("  opener.document.SCORE.kwsize.value = radioSelection(document.hlCenter.kwdsize);");
-    hwdWin.document.write("  opener.document.SCORE.kwstyle.value = radioSelection(document.hlCenter.kwdstyle);");
-    hwdWin.document.write("  opener.document.SCORE.refresh.value = \\"on\\";");
-    hwdWin.document.write("  if (opener.document.SCORE.keywords.value!=\\"\\"){");
-    hwdWin.document.write("     opener.document.SCORE.submit();");
-    hwdWin.document.write("  }");
-    hwdWin.document.write("  self.close()");
-    hwdWin.document.write("}");
-
-    hwdWin.document.write("function radioSelection(radioButton) {");
-    hwdWin.document.write("    var selection=null;");
-    hwdWin.document.write("    for (var i=0; i<radioButton.length; i++) {");
-    hwdWin.document.write("        if (radioButton[i].checked) {");
-    hwdWin.document.write("            selection=radioButton[i].value;");
-    hwdWin.document.write("            return selection;");
-    hwdWin.document.write("        }");
-    hwdWin.document.write("    }");
-    hwdWin.document.write("}");
-
-    hwdWin.document.write("<");
-    hwdWin.document.write("/script>");
-
-    hwdWin.document.write("</head><body bgcolor=white>");
-
-    hwdWin.document.write("<form action=\\"inactive\\" name=\\"hlCenter\\">");
-    hwdWin.document.write("<font color=\\"green\\" size=+1>&nbsp;Keyword Highlight Options</font><br><br>");
-
-    hwdWin.document.write("<table border=0 width=100%><tr><td bgcolor=\\"#777777\\">");
-    hwdWin.document.write("<table border=0 width=100%><tr bgcolor=\\"#ddffff\\">");
-    hwdWin.document.write("<td><b>Text Color</b></td><td><b>Font Size</b></td><td><b>Font Style</td></tr>");
+    hwdWin.focus();
+    var hDoc = hwdWin.document;
+    hDoc.write("<html><head>");
+    hDoc.write("<title>Highlight Central</title>");
+
+    hDoc.write("<script language=javascript>");
+    hDoc.write("function updateChoice(flag) {");
+    hDoc.write("  opener.document.SCORE.kwclr.value = radioSelection(document.hlCenter.kwdclr);");
+    hDoc.write("  opener.document.SCORE.kwsize.value = radioSelection(document.hlCenter.kwdsize);");
+    hDoc.write("  opener.document.SCORE.kwstyle.value = radioSelection(document.hlCenter.kwdstyle);");
+    hDoc.write("  opener.document.SCORE.refresh.value = \\"on\\";");
+    hDoc.write("  if (opener.document.SCORE.keywords.value!=\\"\\"){");
+    hDoc.write("     opener.document.SCORE.submit();");
+    hDoc.write("  }");
+    hDoc.write("  self.close()");
+    hDoc.write("}");
+
+    hDoc.write("function radioSelection(radioButton) {");
+    hDoc.write("    var selection=null;");
+    hDoc.write("    for (var i=0; i<radioButton.length; i++) {");
+    hDoc.write("        if (radioButton[i].checked) {");
+    hDoc.write("            selection=radioButton[i].value;");
+    hDoc.write("            return selection;");
+    hDoc.write("        }");
+    hDoc.write("    }");
+    hDoc.write("}");
+
+    hDoc.write("<");
+    hDoc.write("/script>");
+
+    hDoc.write("</head><body bgcolor=white>");
+
+    hDoc.write("<form action=\\"inactive\\" name=\\"hlCenter\\">");
+    hDoc.write("<font color=\\"green\\" size=+1>&nbsp;Keyword Highlight Options</font><br><br>");
+
+    hDoc.write("<table border=0 width=100%><tr><td bgcolor=\\"#777777\\">");
+    hDoc.write("<table border=0 width=100%><tr bgcolor=\\"#ddffff\\">");
+    hDoc.write("<td><b>Text Color</b></td><td><b>Font Size</b></td><td><b>Font Style</td></tr>");
   }
 
   function highlightbody(clrval,clrtxt,clrsel,szval,sztxt,szsel,syval,sytxt,sysel) { 
-    hwdWin.document.write("<tr bgcolor=\\"#ffffdd\\">");
-    hwdWin.document.write("<td align=\\"left\\">");
-    hwdWin.document.write("<input name=\\"kwdclr\\" type=\\"radio\\" value=\\""+clrval+"\\" "+clrsel+">&nbsp;"+clrtxt+"</td>");
-    hwdWin.document.write("<td align=\\"left\\">");
-    hwdWin.document.write("<input name=\\"kwdsize\\" type=\\"radio\\" value=\\""+szval+"\\" "+szsel+">&nbsp;"+sztxt+"</td>");
-    hwdWin.document.write("<td align=\\"left\\">");
-    hwdWin.document.write("<input name=\\"kwdstyle\\" type=\\"radio\\" value=\\""+syval+"\\" "+sysel+">&nbsp;"+sytxt+"</td>");
-    hwdWin.document.write("</tr>");
+    var hDoc = hwdWin.document;
+    hDoc.write("<tr bgcolor=\\"#ffffdd\\">");
+    hDoc.write("<td align=\\"left\\">");
+    hDoc.write("<input name=\\"kwdclr\\" type=\\"radio\\" value=\\""+clrval+"\\" "+clrsel+">&nbsp;"+clrtxt+"</td>");
+    hDoc.write("<td align=\\"left\\">");
+    hDoc.write("<input name=\\"kwdsize\\" type=\\"radio\\" value=\\""+szval+"\\" "+szsel+">&nbsp;"+sztxt+"</td>");
+    hDoc.write("<td align=\\"left\\">");
+    hDoc.write("<input name=\\"kwdstyle\\" type=\\"radio\\" value=\\""+syval+"\\" "+sysel+">&nbsp;"+sytxt+"</td>");
+    hDoc.write("</tr>");
   }
 
   function highlightend() { 
-    hwdWin.document.write("</table>");
-    hwdWin.document.write("</td></tr></table>&nbsp;");
-    hwdWin.document.write("<input type=\\"button\\" value=\\"Save\\" onClick=\\"javascript:updateChoice(1)\\">&nbsp;&nbsp;");
-    hwdWin.document.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>");
-    hwdWin.document.write("</form>");
-    hwdWin.document.write("</body></html>");
+    var hDoc = hwdWin.document;
+    hDoc.write("</table>");
+    hDoc.write("</td></tr></table>&nbsp;");
+    hDoc.write("<input type=\\"button\\" value=\\"Save\\" onClick=\\"javascript:updateChoice(1)\\">&nbsp;&nbsp;");
+    hDoc.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>");
+    hDoc.write("</form>");
+    hDoc.write("</body></html>");
   }
 
 </script>
@@ -985,6 +1003,9 @@
     if ($counter == 0) {
 	&sub_page_js($request);
 	&sub_page_kw_js($request);
+	$ENV{'form.probTitle'} = $ENV{'form.probTitle'} eq '' ? 
+	    &Apache::lonnet::gettitle($symb) : $ENV{'form.probTitle'};
+
 	$request->print('<h3>&nbsp;<font color="#339933">Submission Record</font></h3>'."\n".
 			'<font size=+1>&nbsp;<b>Problem: </b>'.$ENV{'form.probTitle'}.'</font>'."\n");
 
@@ -1015,8 +1036,10 @@
 
 	$request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n".
 			'<input type="hidden" name="command"    value="handgrade" />'."\n".
-			'<input type="hidden" name="lastCmd"    value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-			'<input type="hidden" name="lastSec"    value="'.$ENV{'form.lastSec'}.'" />'."\n".
+			'<input type="hidden" name="saveCmd"    value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+			'<input type="hidden" name="saveSec"    value="'.$ENV{'form.saveSec'}.'" />'."\n".
+			'<input type="hidden" name="saveSub"    value="'.$ENV{'form.saveSub'}.'" />'."\n".
+			'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n".
 			'<input type="hidden" name="probTitle"  value="'.$ENV{'form.probTitle'}.'" />'."\n".
 			'<input type="hidden" name="refresh"    value="off" />'."\n".
 			'<input type="hidden" name="symb"       value="'.$symb.'" />'."\n".
@@ -1081,7 +1104,7 @@
     my ($classlist,$fullname);
     if ($ENV{'form.handgrade'} eq 'yes') {
 	my @col_list;
-	($classlist,undef,$fullname) = &getclasslist('all','0');
+	($classlist,undef,$fullname) = &getclasslist('all',$ENV{'form.showgrading'} eq 'yes' ? '1' : '0');
 	for (keys (%$handgrade)) {
 	    my $ncol = &Apache::lonnet::EXT('resource.'.$_.
 					    '.maxcollaborators',
@@ -1126,7 +1149,7 @@
                 }
                 if (scalar(@collaborators > $ncol)) {
                     $result .= '<table border="0"><tr bgcolor="#ffbbbb"><td>';
-                    $result .= 'This student has sumbitted too many '.
+                    $result .= 'This student has submitted too many '.
                         'collaborators.  Maximum is '.$ncol;
                     $result .= '</td></tr></table>';
                 }
@@ -1715,8 +1738,10 @@
 	'<input type="hidden" name="url"     value="'.$url.'" />'."\n".
 	'<input type="hidden" name="command" value="editgrades" />'."\n".
 	'<input type="hidden" name="section" value="'.$ENV{'form.section'}.'" />'."\n".
-	'<input type="hidden" name="lastCmd" value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec" value="'.$ENV{'form.lastSec'}.'" />'."\n".
+	'<input type="hidden" name="saveCmd" value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec" value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub" value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n".
 	'<input type="hidden" name="probTitle" value="'.$ENV{'form.probTitle'}.'" />'."\n";
 
     $result.='<h3>Assign Common Grade To ';
@@ -1807,7 +1832,7 @@
 
     #get info for each student
     #list all the students - with points and grade status
-    my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'0');
+    my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1');
     my $ctr = 0;
     foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
 	my ($uname,$udom) = split(/:/);
@@ -2018,48 +2043,6 @@
 #
 #-------------------------- Next few routines handles grading by csv upload
 #
-#--- Menu to upload a csv scores ---
-sub upcsvScores_form {
-    my ($request) = shift;
-    my ($symb,$url)=&get_symb_and_url($request);
-    if (!$symb) {return '';}
-    my $result =<<CSVFORMJS;
-<script type="text/javascript" language="javascript">
-    function checkUpload(formname) {
-	if (formname.upfile.value == "") {
-	    alert("Please use the browse button to select a file from your local directory.");
-	    return false;
-	}
-	formname.submit();
-	if (navigator.appName !="Netscape") {self.close()}; //if netscape if appears to close before submit!!!
-	    // any suggestion how to get around this??
-    }
-    </script>
-CSVFORMJS
-    $ENV{'form.probTitle'} = &Apache::lonnet::gettitle($symb);
-    $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n";
-    $result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n";
-    $result.='&nbsp;<b>Specify a file containing the class scores for problem - '.$ENV{'form.probTitle'}.
-	'.</b></td></tr>'."\n";
-    $result.='<tr bgcolor=#ffffe6><td>'."\n";
-    my $upfile_select=&Apache::loncommon::upfile_select_html();
-    $result.=<<ENDUPFORM;
-<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload" target="LONcatInfo">
-<input type="hidden" name="symb" value="$symb" />
-<input type="hidden" name="url" value="$url" />
-<input type="hidden" name="command" value="csvuploadmap" />
-<input type="hidden" name="probTitle" value="$ENV{'form.probTitle'}" />
-$upfile_select
-<br /><input type="button" onClick="javascript:checkUpload(this.form);" value="Upload Scores" />&nbsp;
-<input type="button" value="Cancel" onClick="self.close()">
-
-</form>
-ENDUPFORM
-    $result.='</td></tr></table>'."\n";
-    $result.='</td></tr></table>'."\n";
-    return $result;
-}
-
 #--- Javascript to handle csv upload
 sub csvupload_javascript_reverse_associate {
   return(<<ENDPICK);
@@ -2175,8 +2158,10 @@
                                        value="$ENV{'form.upfile_associate'}" />
 <input type="hidden" name="symb"       value="$symb" />
 <input type="hidden" name="url"        value="$url" />
-<input type="hidden" name="lastCmd"    value="$ENV{'form.lastCmd'}" />
-<input type="hidden" name="lastSec"    value="$ENV{'form.lastSec'}" />
+<input type="hidden" name="saveCmd"    value="$ENV{'form.saveCmd'}" />
+<input type="hidden" name="saveSec"    value="$ENV{'form.saveSec'}" />
+<input type="hidden" name="saveSub"    value="$ENV{'form.saveSub'}" />
+<input type="hidden" name="saveStatus" value="$ENV{'form.saveStatus'}" />
 <input type="hidden" name="probTitle"  value="$ENV{'form.probTitle'}" />
 <input type="hidden" name="command"    value="csvuploadassign" />
 <hr />
@@ -2323,8 +2308,7 @@
 <script type="text/javascript" language="javascript">
 
 function checkPickOne(formname) {
-    var user = radioSelection(formname.student);
-    if (user == null) {
+    if (radioSelection(formname.student) == null) {
 	alert("Please select the student you wish to grade.");
 	return;
     }
@@ -2336,20 +2320,28 @@
 
 function radioSelection(radioButton) {
     var selection=null;
-    for (var i=0; i<radioButton.length; i++) {
-        if (radioButton[i].checked) {
-            return radioButton[i].value;
-        }
+    if (radioButton.length > 1) {
+	for (var i=0; i<radioButton.length; i++) {
+	    if (radioButton[i].checked) {
+		return radioButton[i].value;
+	    }
+	}
+    } else {
+	if (radioButton.checked) return radioButton.value;
     }
     return selection;
 }
-
+    
 function pullDownSelection(selectOne) {
-    var selection=null;
-    for (var i=0; i<selectOne.length; i++) {
-        if (selectOne[i].selected) {
-            return selectOne[i].value;
-        }
+    var selection="";
+    if (selectOne.length > 1) {
+	for (var i=0; i<selectOne.length; i++) {
+	    if (selectOne[i].selected) {
+		return selectOne[i].value;
+	    }
+	}
+    } else {
+	if (selectOne.selected) return selectOne.value;
     }
 }
 </script>
@@ -2398,15 +2390,17 @@
 	'<input type="hidden" name="command" value="displayPage" />'."\n".
 	'<input type="hidden" name="url"     value="'.$url.'" />'."\n".
 	'<input type="hidden" name="symb"    value="'.$symb.'" />'."<br><br>\n".
-	'<input type="hidden" name="lastCmd" value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec" value="'.$ENV{'form.lastSec'}.'" />'."\n";
+	'<input type="hidden" name="saveCmd" value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec" value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub" value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n";
 
     $result.='<br />&nbsp;<input type="button" '.
 	'onClick="javascript:checkPickOne(this.form);"value="Submit" /><br />'."\n";
 
     $request->print($result);
 
-    my $studentTable.='&nbsp;<b>Select a Student you wish to grade</b><br>'.
+    my $studentTable.='&nbsp;<b>Select a student you wish to grade</b><br>'.
 	'<table border="0"><tr><td bgcolor="#777777">'.
 	'<table border="0"><tr bgcolor="#e6ffff">'.
 	'<td><b>&nbsp;Fullname <font color="#999999">(username)</font></b></td>'.
@@ -2414,7 +2408,7 @@
 	'<td><b>&nbsp;Fullname <font color="#999999">(username)</font></b></td>'.
 	'<td><b>&nbsp;Fullname <font color="#999999">(username)</font></b></td></tr>';
  
-    my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+    my (undef,undef,$fullname) = &getclasslist($getsec,'1');
     my $ptr = 1;
     foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
 	my ($uname,$udom) = split(/:/,$student);
@@ -2505,7 +2499,7 @@
     my $cnum      = $ENV{"course.$ENV{'request.course.id'}.num"};
     my $getsec    = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'};
     my $pageTitle = $ENV{'form.page'};
-    my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+    my (undef,undef,$fullname) = &getclasslist($getsec,'1');
     my ($uname,$udom) = split(/:/,$ENV{'form.student'});
 
     my $result='<h3><font color="#339933">&nbsp;'.$ENV{'form.title'}.'</font></h3>';
@@ -2531,8 +2525,10 @@
 	'<input type="hidden" name="title"   value="'.$ENV{'form.title'}.'" />'."\n".
 	'<input type="hidden" name="url"     value="'.$url.'" />'."\n".
 	'<input type="hidden" name="symb"    value="'.$symb.'" />'."\n".
-	'<input type="hidden" name="lastCmd" value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec" value="'.$ENV{'form.lastSec'}.'" />'."\n";
+	'<input type="hidden" name="saveCmd" value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec" value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub" value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n";
 
     my $checkIcon = '<img src="'.$request->dir_config('lonIconsURL').
 	'/check.gif" height="16" border="0" />';
@@ -2594,6 +2590,8 @@
 			my @displaySub = ();
 			foreach my $partid (@{$parts}) {
 			    my @matchKey = grep /^resource\.$partid\..*?\.submission$/,@versionKeys;
+			    next if ($record{"$version:resource.$partid.award"} eq 'APPROX_ANS' && 
+				     $record{"$version:resource.$partid.solved"} eq '');
 			    $displaySub[0].=(exists $record{$version.':'.$matchKey[0]}) ? 
 				'<b>Part:</b> '.$partid.'&nbsp;<b>Submission:</b>&nbsp;'
 				.$record{$version.':'.$matchKey[0]}.'<br />' : '';
@@ -2660,7 +2658,7 @@
     my $cnum      = $ENV{"course.$ENV{'request.course.id'}.num"};
     my $getsec    = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'};
     my $pageTitle = $ENV{'form.page'};
-    my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+    my (undef,undef,$fullname) = &getclasslist($getsec,'1');
     my ($uname,$udom) = split(/:/,$ENV{'form.student'});
 
     my $result='<h3><font color="#339933">&nbsp;'.$ENV{'form.title'}.'</font></h3>';
@@ -2755,11 +2753,11 @@
     }
 
     $studentTable.='</td></tr></table></td></tr></table>';
-    $studentTable.=($changeflag == 0 ? 'No score was changed or updated.' :
-		    'The scores were changed for '.
-		    $changeflag.' problem'.($changeflag == 1 ? '.' : 's.'));
     $studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'});
-    $request->print($studentTable);
+    my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :
+		  'The scores were changed for '.
+		  $changeflag.' problem'.($changeflag == 1 ? '.' : 's.'));
+    $request->print($grademsg.$studentTable);
 
     return '';
 }
@@ -2880,38 +2878,39 @@
     my $result.='<form action="/adm/grades" method="post">'."\n".
 	'<input type="hidden" name="symb" value="'.$symb.'" />'."\n".
 	'<input type="hidden" name="url" value="'.$url.'" />'."\n".
-	'<input type="hidden" name="lastCmd" value="'.$ENV{'form.lastCmd'}.'" />'."\n".
-	'<input type="hidden" name="lastSec" value="'.$ENV{'form.lastSec'}.'" />'."\n".
+	'<input type="hidden" name="saveCmd" value="'.$ENV{'form.saveCmd'}.'" />'."\n".
+	'<input type="hidden" name="saveSec" value="'.$ENV{'form.saveSec'}.'" />'."\n".
+	'<input type="hidden" name="saveSub" value="'.$ENV{'form.saveSub'}.'" />'."\n".
+	'<input type="hidden" name="saveStatus" value="'.$ENV{'form.saveStatus'}.'" />'."\n".
 	'<input type="hidden" name="command" value="gradingmenu" />'."\n".
 	'<input type="submit" name="submit" value="Grading Menu" />'."\n".
 	'</form>'."\n";
     return $result;
 }
 
+
 #--- Displays the main menu page -------
 sub gradingmenu {
     my ($request) = @_;
     my ($symb,$url)=&get_symb_and_url($request);
     if (!$symb) {return '';}
+    my $probTitle = &Apache::lonnet::gettitle($symb);
+    my $saveCmd = ($ENV{'form.saveCmd'} eq '' ? 'pickStudentPage' : $ENV{'form.saveCmd'});
+    my $saveSec = ($ENV{'form.saveSec'} eq '' ? 'all' : $ENV{'form.saveSec'});
+    my $saveSub = ($ENV{'form.saveSub'} eq '' ? 'yes' : $ENV{'form.saveSub'});
+    my $saveStatus = ($ENV{'form.saveStatus'} eq '' ? 'Active' : $ENV{'form.saveStatus'});
 
     $request->print(<<GRADINGMENUJS);
 <script type="text/javascript" language="javascript">
     function checkChoice(formname) {
 	var cmd = formname.command;
-	formname.lastCmd.value = radioSelection(formname.command);
-	formname.lastSec.value = pullDownSelection(formname.section);
-	if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[4].checked) {
-	    formname.submit();
-	}
+	formname.saveCmd.value = radioSelection(cmd);
+	formname.saveSec.value = pullDownSelection(formname.section);
+	formname.saveSub.value = radioSelection(formname.submitonly);
+	formname.saveStatus.value = pullDownSelection(formname.status);
+	if (cmd[0].checked || cmd[1].checked || cmd[2].checked || cmd[4].checked) formname.submit();
 
-	if (cmd[3].checked) {
-	    var url = "/adm/grades?command=csvform&symb="+formname.symb.value+"&url="+formname.url.value;
-	    var options = "width=620,height=340,screenx=70,screeny=75,";
-	    options += "resizable=no,scrollbars=no,status=no,";
-	    options += "menubar=no,toolbar=no,location=no,directories=no";
-	    var newWin = window.open(url, "CSVFile", options);
-	    newWin.focus();
-	}
+	if (cmd[3].checked) browseAndUpload();
 
 	if (cmd[5].checked) {
 	    if (!checkReceiptNo(formname,'notOK')) { return false;}
@@ -2930,35 +2929,94 @@
 	    formname.receipt.focus();
 	    return false;
 	}
-	formname.command[4].checked = true;
+	formname.command[5].checked = true;
 	return true;
     }
 
     function radioSelection(radioButton) {
 	var selection=null;
-	for (var i=0; i<radioButton.length; i++) {
-	    if (radioButton[i].checked) {
-		return radioButton[i].value;
+	if (radioButton.length > 1) {
+	    for (var i=0; i<radioButton.length; i++) {
+		if (radioButton[i].checked) {
+		    return radioButton[i].value;
+		}
 	    }
+	} else {
+	    if (radioButton.checked) return radioButton.value;
 	}
 	return selection;
     }
 
     function pullDownSelection(selectOne) {
 	var selection="";
-	for (var i=0; i<selectOne.length; i++) {
-	    if (selectOne[i].selected) {
-		return selectOne[i].value;
+	if (selectOne.length > 1) {
+	    for (var i=0; i<selectOne.length; i++) {
+		if (selectOne[i].selected) {
+		    return selectOne[i].value;
+		}
 	    }
+	} else {
+	    if (selectOne.selected) return selectOne.value;
 	}
     }
+
+    function browseAndUpload() {
+	bNLoad = window.open('', 'BrowseAndUpload', 'toolbar=no,location=no,scrollbars=no,width=550,height=200,screenx=100,screeny=75');
+	bNLoad.focus();
+	var lDoc = bNLoad.document;
+	lDoc.write("<html><head>");
+	lDoc.write("<title>Browse And Upload</title>");
+	
+	lDoc.write("<script language=javascript>");
+	lDoc.write("function checkUpload(formname) {");
+	
+	lDoc.write("  if (formname.upfile.value == \\"\\") {");
+	lDoc.write("     alert(\\"Please use the browse button to select a file from your local directory.\\");");
+	lDoc.write("     return false;");
+	lDoc.write("   }");
+	lDoc.write("   document.gradesupload.submit();");
+	lDoc.write("   setTimeout('self.close()',750)"); 
+	lDoc.write("}");
+
+	lDoc.write("<");
+	lDoc.write("/script>");
+
+	lDoc.write("</head><body bgcolor=white>");
+	lDoc.write("<form method=\\"post\\" enctype=\\"multipart/form-data\\" action=\\"/adm/grades\\" name=\\"gradesupload\\" target=\\"LONcatInfo\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"symb\\"       value=\\"$symb\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"url\\"        value=\\"$url\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"probTitle\\"  value=\\"$probTitle\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"saveCmd\\"    value=\\"csvupload\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"saveSec\\"    value=\\"$saveSec\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"saveSub\\"    value=\\"$saveSub\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"saveStatus\\" value=\\"$saveStatus\\">");
+	lDoc.write("<input type=\\"hidden\\" name=\\"command\\"    value=\\"csvuploadmap\\">");
+
+	lDoc.write("<font color=\\"green\\" size=+1><b>Specify a file containing the class scores for problem - $probTitle</b></font><br><br>");
+
+	lDoc.write("<table border=0 width=100%><tr><td bgcolor=\\"#777777\\">");
+	lDoc.write("<table border=0 width=100%><tr bgcolor=\\"#ddffff\\">");
+	lDoc.write("<td>");
+	lDoc.write("<input type=\\"file\\" name=\\"upfile\\" size=\\"50\\" />");
+	lDoc.write("<br />Type: <select name=\\"upfiletype\\">");
+        lDoc.write("<option value=\\"csv\\">CSV (comma separated values, spreadsheet)</option>");
+        lDoc.write("<option value=\\"space\\">Space separated</option>");
+        lDoc.write("<option value=\\"tab\\">Tabulator separated</option>");
+        lDoc.write("<option value=\\"xml\\">HTML/XML</option>");
+        lDoc.write("</select>");
+        lDoc.write("</td></tr></table>");
+        lDoc.write("</td></tr></table>&nbsp;");
+        lDoc.write("<input type=\\"button\\" value=\\"Upload Scores\\" onClick=\\"javascript:checkUpload(this.form)\\">&nbsp;&nbsp;");
+        lDoc.write("<input type=\\"button\\" value=\\"Cancel\\" onClick=\\"self.close()\\"><br><br>");
+        lDoc.write("</form>");
+        lDoc.write("</body></html>");
+  }
 </script>
 GRADINGMENUJS
 
-    my $probTitle = &Apache::lonnet::gettitle($ENV{'form.url'});
     my $result='<h3>&nbsp;<font color="#339933">Manual Grading/View Submission</font></h3>'.
 	'<table border="0">'.
-	'<tr><td colspan=3><font size=+1><b>Problem: </b>'.$probTitle.'</font></td></tr>';
+	'<tr><td colspan=3><font size=+1><b>Problem: </b>'.$probTitle.'</font></td></tr>'."\n";
     my ($partlist,$handgrade) = &response_type($url);
     my ($resptype,$hdgrade)=('','no');
     for (sort keys(%$handgrade)) {
@@ -2969,11 +3027,9 @@
 	    '<td><b>Type: </b>'.$responsetype.'</td>'.
 	    '<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>';
     }
-    $result.='</table>';
+    $result.='</table>'."\n";
 
-    my ($classlist,$sections) = &getclasslist('all','0');
-    my $lastCmd = ($ENV{'form.lastCmd'} eq '' ? 'pickStudentPage' : $ENV{'form.lastCmd'});
-    my $lastSec = ($ENV{'form.lastSec'} eq '' ? 'all' : $ENV{'form.lastSec'});
+    my (undef,$sections) = &getclasslist('all','0');
 
     $result.='<form action="/adm/grades" method="post" name="gradingMenu">'."\n".
 	'<input type="hidden" name="symb"        value="'.$symb.'" />'."\n".
@@ -2981,8 +3037,10 @@
 	'<input type="hidden" name="response"    value="'.$resptype.'" />'."\n".
 	'<input type="hidden" name="handgrade"   value="'.$hdgrade.'" />'."\n".
 	'<input type="hidden" name="probTitle"   value="'.$probTitle.'" />'."\n".
-	'<input type="hidden" name="lastCmd"     value="" />'."\n".
-	'<input type="hidden" name="lastSec"     value="" />'."\n".
+	'<input type="hidden" name="saveCmd"     value="" />'."\n".
+	'<input type="hidden" name="saveSec"     value="" />'."\n".
+	'<input type="hidden" name="saveSub"     value="" />'."\n".
+	'<input type="hidden" name="saveStatus"  value="" />'."\n".
 	'<input type="hidden" name="showgrading" value="yes" />'."\n";
 
     $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n".
@@ -2993,25 +3051,27 @@
     $result.='<table width=100% border=0>'.
 	'<tr bgcolor="#ffffe6" valign="top"><td colspan="2">'.
 	'<input type="radio" name="command" value="pickStudentPage" '.
-	($lastCmd eq 'pickStudentPage' ? 'checked' : '').'> '.
+	($saveCmd eq 'pickStudentPage' ? 'checked' : '').'> '.
 	'Handgrade/View Submission for a student by page/sequence</td></tr>'."\n".
 
 	'<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'.
 	'<input type="radio" name="command" value="viewgrades" '.
-	($lastCmd eq 'viewgrades' ? 'checked' : '').'> '.
+	($saveCmd eq 'viewgrades' ? 'checked' : '').'> '.
 	'Grade by section or class</td></tr>'."\n".
 
 	'<tr bgcolor="#ffffe6"valign="top"><td><input type="radio" name="command" value="submission" '.
-	($lastCmd eq 'submission' ? 'checked' : '').'> '.
+	($saveCmd eq 'submission' ? 'checked' : '').'> '.
 	($hdgrade eq 'yes' ? 'View/Grade essay response of' : 'View').
 	' an individual student </td>'."\n".
 	'<td>-->&nbsp;For students who has: '.
-	'<input type="radio" name="submitonly" value="yes" checked> submitted'.
-	'<input type="radio" name="submitonly" value="all"> everybody</td></tr>'."\n".
+	'<input type="radio" name="submitonly" value="yes" '.
+	($saveSub eq 'yes' ? 'checked' : '').' /> submitted'.
+	'<input type="radio" name="submitonly" value="all" '.
+	($saveSub eq 'all' ? 'checked' : '').' /> everybody</td></tr>'."\n".
 
 	'<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'.
 	'<input type="radio" name="command" value="csvupload" '.
-	($lastCmd eq 'csvupload' ? 'checked' : '').'> '.
+	($saveCmd eq 'csvupload' ? 'checked' : '').'> '.
 	'Upload scores from file</td></tr>'."\n";
 
     $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'.
@@ -3020,8 +3080,8 @@
 
     if ((&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) && ($symb)) {
 	$result.='<tr bgcolor="#ffffe6"valign="top"><td>'.
-	    '<input type="radio" name="command" value="verify" onSelect="javascript:this.form.receipt.focus()" '.
-	    ($lastCmd eq 'verify' ? 'checked' : '').'> '.
+	    '<input type="radio" name="command" value="verify" onChecked="javascript:this.form.receipt.focus()" '.
+	    ($saveCmd eq 'verify' ? 'checked' : '').'> '.
 	    'Verify a submission receipt issued by this server</td>'.
 	    '<td>-->&nbsp;Receipt no: '.unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'}).
 	    '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')">'.
@@ -3029,13 +3089,21 @@
     } 
 
     $result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2"><br />'."\n".
-	'&nbsp;Select section:</b> <select name="section">'."\n";
+	'&nbsp;Select section: <select name="section">'."\n";
     if (ref($sections)) {
 	foreach (sort (@$sections)) {$result.='<option value="'.$_.'" '.
-					 ($lastSec eq $_ ? 'selected="on"' : '').'>'.$_.'</option>'."\n";}
+					 ($saveSec eq $_ ? 'selected="on"' : '').'>'.$_.'</option>'."\n";}
     }
-    $result.= '<option value="all" '.($lastSec eq 'all' ? 'selected="on"' : ''). '>all</select> &nbsp; '.
-	'<font color="red">(Applies to the first three options only.)</font>'."\n";
+    $result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> &nbsp; ';
+
+    $result.='Student Status:</b><select name="status">'.
+	'<option value="Active" '.($saveStatus eq 'Active' ? 'selected' : '').'>Active</option>'.
+	'<option value="Expired" '.($saveStatus eq 'Expired' ? 'selected' : '').'>Expired</option>'.
+	'<option value="Any" '.($saveStatus eq 'Any' ? 'selected' : '').'>Any</option>'.
+	'</select>';
+
+    $result.=' &nbsp; <font color="red">(Applies to the first three options only.)</font>'."\n";
+
     if (ref($sections)) {
 	$result.='&nbsp;(Section "no" implies the students were not assigned a section.)<br />' 
 	    if (grep /no/,@$sections);

--ng1048539834--