--- loncom/homework/grades.pm	2006/01/25 22:58:26	1.302.2.1
+++ loncom/homework/grades.pm	2006/05/29 18:51:35	1.302.2.6
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.302.2.1 2006/01/25 22:58:26 albertel Exp $
+# $Id: grades.pm,v 1.302.2.6 2006/05/29 18:51:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2248,7 +2248,7 @@ sub saveHandGrade {
 
             my $solvedstatus = $record{'resource.'.$new_part.'.solved'};
             if ($aggtries > 0) {
-                &decrement($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus);
+                &decrement_aggs($symb,$new_part,\%aggregate,$aggtries,$totaltries,$solvedstatus);
                 $aggregateflag = 1;
             }
 	} elsif ($dropMenu eq '') {
@@ -3291,8 +3291,13 @@ sub csvuploadmap {
 	    unshift(@fields,['none','']);
 	    $i=&Apache::loncommon::csv_samples_select_table($request,\@records,
 							    \@fields);
-	    my %sone=&Apache::loncommon::record_sep($records[0]);
-	    $keyfields=join(',',sort(keys(%sone)));
+	    foreach my $rec (@records) {
+		my %temp = &Apache::loncommon::record_sep($rec);
+		if (%temp) {
+		    $keyfields=join(',',sort(keys(%temp)));
+		    last;
+		}
+	    }
 	}
     }
     &csvuploadmap_footer($request,$i,$keyfields);
@@ -3454,7 +3459,7 @@ sub csvuploadassign {
     }
     $request->print("<br />Stored $countdone students\n");
     if (@skipped) {
-	$request->print('<p<font size="+1"><b>Skipped Students</b></font></p>');
+	$request->print('<p><font size="+1"><b>Skipped Students</b></font></p>');
 	foreach my $student (@skipped) { $request->print("$student<br />\n"); }
     }
     if (@notallowed) {
@@ -3674,7 +3679,7 @@ sub displayPage {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }
 
-        if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+        if (ref($curRes) && $curRes->is_problem()) {
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
@@ -3871,7 +3876,7 @@ sub updateGradeByPage {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }
 
-        if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
+        if (ref($curRes) && $curRes->is_problem()) {
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
@@ -4058,11 +4063,11 @@ sub scantron_CODElist {
 sub scantron_CODEunique {
     my $result='<nobr>
                  <label><input type="radio" name="scantron_CODEunique"
-                        value="Yes" checked="on" /> Yes </label>
+                        value="yes" checked="checked" /> Yes </label>
                 </nobr>
                 <nobr>
                  <label><input type="radio" name="scantron_CODEunique"
-                        value="No" /> No </label>
+                        value="no" /> No </label>
                 </nobr>';
     return $result;
 }