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

ng lon-capa-cvs@mail.lon-capa.org
Tue, 30 Jul 2002 19:59:58 -0000


This is a MIME encoded message

--ng1028059198
Content-Type: text/plain

ng		Tue Jul 30 15:59:58 2002 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  does grading by section or class
  all the students can be assigned the same score or individually
  
  
  
--ng1028059198
Content-Type: text/plain
Content-Disposition: attachment; filename="ng-20020730155958.txt"

Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.42 loncom/homework/grades.pm:1.43
--- loncom/homework/grades.pm:1.42	Fri Jul 26 16:28:42 2002
+++ loncom/homework/grades.pm	Tue Jul 30 15:59:58 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.42 2002/07/26 20:28:42 ng Exp $
+# $Id: grades.pm,v 1.43 2002/07/30 19:59:58 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -131,7 +131,7 @@
     my %seen = ();
     my (@partlist,%handgrade);
     foreach (split(/,/,&Apache::lonnet::metadata($url,'packages'))) {
-	if (/^\w+response_\d{1,2}.*/) {
+	if (/^\w+response_\d+.*/) {
 	    my ($responsetype,$part) = split(/_/,$_,2);
 	    my ($partid,$respid) = split(/_/,$part);
 	    $handgrade{$part} = $responsetype.':'.($allkeys =~ /parameter_$part\_handgrade/ ? 'yes' : 'no');
@@ -158,7 +158,7 @@
     for (sort keys(%$handgrade)) {
 	my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
 	$ENV{'form.handgrade'} = 'yes' if ($handgrade eq 'yes');
-	$result.='<tr><td><b>Part id: </b>'.$_.'</td>'.
+	$result.='<tr><td><b>Part id: </b>'.(split(/_/))[0].'</td>'.
 	    '<td><b>Type: </b>'.$responsetype.'</td>'.
 	    '<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>';
     }
@@ -196,7 +196,7 @@
 	'<td><b>&nbsp;Select&nbsp;</b></td><td><b>&nbsp;Username&nbsp;</b></td>'.
 	'<td><b>&nbsp;Fullname&nbsp;</b></td><td><b>&nbsp;Domain&nbsp;</b></td>';
     foreach (sort(@$partlist)) {
-	$result.='<td><b>&nbsp;Part ID '.$_.' Status&nbsp;</b></td>';
+	$result.='<td><b>&nbsp;Part ID '.(split(/_/))[0].' Status&nbsp;</b></td>';
     }
     $request->print($result.'</tr>'."\n");
 
@@ -206,7 +206,7 @@
 	my $statusflg = '';
 	foreach (keys(%status)) {
 	    $statusflg = 1 if ($status{$_} ne 'nothing');
-	    my ($foo,$partid,$foo) = split(/\./,$_);
+	    my ($foo,$partid,$foo1) = split(/\./,$_);
 	    if ($status{'resource.'.$partid.'.submitted_by'} ne '') {
 		$statusflg = '';
 		$request->print('<input type="hidden" name="'.
@@ -431,11 +431,12 @@
 
     # Student info
     $request->print(($counter == 0 ? '' : '<br />'));
-    my $fullname = ($ENV{'form.fullname'} ne '' ? $ENV{'form.fullname'} : &get_fullname($uname,$udom));
+#    my $fullname = ($ENV{'form.fullname'} ne '' ? $ENV{'form.fullname'} : &get_fullname($uname,$udom));
     my $result='<table border="0" width=100%><tr><td bgcolor="#777777">'.
 	'<table border="0" width=100%><tr bgcolor="#ffffff"><td>';
 
-    $result.='<table border="0"><tr bgcolor="#ffffff"><td><b>Fullname: </b>'.$fullname.
+    $result.='<table border="0"><tr bgcolor="#ffffff"><td><b>Fullname: </b>'.$ENV{'form.fullname'}.
+#    $result.='<table border="0"><tr bgcolor="#ffffff"><td><b>Fullname: </b>'.$fullname.
 	'</td><td>&nbsp; &nbsp;<b>Username: </b>'.$uname.
 	'</td><td>&nbsp; &nbsp;<b>Domain: </b>'.$udom.'</td></tr>';
     if ($ENV{'form.handgrade'} eq 'yes') {
@@ -555,8 +556,8 @@
 	$result.='<table border="0"><tr>';  # display radio buttons in a nice table 10 across
 	while ($ctr<=$wgt) {
 	    $result.= '<td><input type="radio" name="RADVAL'.$counter.'_'.$partid.'" '.
-		'onclick="javascript:writeBox(this.form.GRADE_BOX'.$counter.'_'.$partid.
-		',this.form.GRADE_SEL'.$counter.'_'.$partid.','.$ctr.
+		'onclick="javascript:writeBox(this.form.GD_BOX'.$counter.'_'.$partid.
+		',this.form.GD_SEL'.$counter.'_'.$partid.','.$ctr.
 		',this.form.stores'.$counter.'_'.$partid.')" '.
 		($score eq $ctr ? 'checked':'').' /> '.$ctr."</td>\n";
 	    $result.=(($ctr+1)%10 == 0 ? '</tr><tr>' : '');
@@ -565,18 +566,18 @@
 	$result.='</tr></table>';
 
 	$result.='</td><td>&nbsp;<b>or</b>&nbsp;</td>';
-	$result.='<td><input type="text" name="GRADE_BOX'.$counter.'_'.$partid.'"'.
+	$result.='<td><input type="text" name="GD_BOX'.$counter.'_'.$partid.'"'.
 	    ($score ne ''? ' value = "'.$score.'"':'').' size="4" '.
 	    'onChange="javascript:updateRadio(this.form.RADVAL'.$counter.'_'.$partid.
-	    ',this.form.GRADE_BOX'.$counter.'_'.$partid.
-	    ',this.form.GRADE_SEL'.$counter.'_'.$partid.
+	    ',this.form.GD_BOX'.$counter.'_'.$partid.
+	    ',this.form.GD_SEL'.$counter.'_'.$partid.
 	    ',this.form.stores'.$counter.'_'.$partid.')" /></td>'."\n";
 	$result.='<td>/'.$wgt.' '.$wgtmsg.' </td><td>';
 
-	$result.='<select name="GRADE_SEL'.$counter.'_'.$partid.'" '.
+	$result.='<select name="GD_SEL'.$counter.'_'.$partid.'" '.
 	    'onChange="javascript:clearRadBox(this.form.RADVAL'.$counter.'_'.$partid.
-	    ',this.form.GRADE_BOX'.$counter.'_'.$partid.
-	    ',this.form.GRADE_SEL'.$counter.'_'.$partid.
+	    ',this.form.GD_BOX'.$counter.'_'.$partid.
+	    ',this.form.GD_SEL'.$counter.'_'.$partid.
 	    ',this.form.stores'.$counter.'_'.$partid.')" />'."\n".
 	    '<option selected="on"> </option>'.
 	    '<option>excused</option></select>'."&nbsp&nbsp\n";
@@ -760,7 +761,7 @@
 	    my $statusflg = '';
 	    foreach (keys(%status)) {
 		$statusflg = 1 if ($status{$_} ne 'nothing');
-		my ($foo,$partid,$foo) = split(/\./,$_);
+		my ($foo,$partid,$foo1) = split(/\./,$_);
 		$statusflg = '' if ($status{'resource.'.$partid.'.submitted_by'} ne '');
 	    }
 	    next if ($statusflg eq '');
@@ -796,11 +797,11 @@
 #   my %record=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname);
     my %newrecord;
     foreach (split(/:/,$ENV{'form.partlist'.$newflg})) {
-	if ($ENV{'form.GRADE_SEL'.$newflg.'_'.$_} eq 'excused') {
+	if ($ENV{'form.GD_SEL'.$newflg.'_'.$_} eq 'excused') {
 	    $newrecord{'resource.'.$_.'.solved'} = 'excused';
 	} else {
-	    my $pts    = ($ENV{'form.GRADE_BOX'.$newflg.'_'.$_} ne '' ? 
-			  $ENV{'form.GRADE_BOX'.$newflg.'_'.$_} : $ENV{'form.RADVAL'.$newflg.'_'.$_});
+	    my $pts    = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? 
+			  $ENV{'form.GD_BOX'.$newflg.'_'.$_} : $ENV{'form.RADVAL'.$newflg.'_'.$_});
 	    if ($pts eq '') {
 		&userError($request,'No point was assigned for part id '.$_.' and for username '.$stuname.'.');
 		return 'error';
@@ -857,7 +858,7 @@
 	my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
 	$resptype = $responsetype;
 	$hdgrade = $handgrade if ($handgrade eq 'yes');
-	$result.='<tr><td><b>Part id: </b>'.$_.'</td>'.
+	$result.='<tr><td><b>Part ID: </b>'.(split(/_/))[0].'</td>'.
 	    '<td><b>Type: </b>'.$responsetype.'</td>'.
 	    '<td><b>Handgrade: </b>'.$handgrade.'</font></td></tr>';
     }
@@ -927,10 +928,7 @@
     foreach (sort (@$sections)) {
 	$result.= '<option>'.$_.'</option>'."\n";
     }
-    $result.= '<option selected="on">all</select>'."<br />\n";
-#    $result.='&nbsp;<b>Display students who has: </b>'.
-#	'<input type="radio" name="submitonly" value="yes" checked> submitted'.
-#	'<input type="radio" name="submitonly" value="all"> everybody <br /><br />';
+    $result.='<option selected="on">all</select>'."<br />\n";
     $result.='&nbsp;<input type="submit" name="submit" value="View/Grade" /></form>'."\n";
     $result.='</td></tr></table>'."\n";
     $result.='</td></tr></table>'."\n";
@@ -1058,15 +1056,17 @@
 	    textbox.value = point;
 	}
 	for (i=0;i<document.classgrade.total.value;i++) {
-	    var user = eval("document.classgrade.counter"+i+".value");
-	    var scorename = eval("document.classgrade.GRADE_"+user+
-				 "_"+partid+"_awarded");
-	    var saveval   = eval("document.classgrade.GRADE_"+user+
-				 "_"+partid+"_solved_save.value");
-	    var selname   = eval("document.classgrade.GRADE_"+user+"_"+partid+"_solved");
+	    var user = eval("document.classgrade.ctr"+i+".value");
+	    var scorename = eval("document.classgrade.GD_"+user+
+				 "_"+partid+"_aw");
+	    var saveval   = eval("document.classgrade.GD_"+user+
+				 "_"+partid+"_sv_s.value");
+	    var selname   = eval("document.classgrade.GD_"+user+"_"+partid+"_sv");
 	    if (saveval != "correct") {
 		scorename.value = point;
-		selname[0].selected = true;
+		if (selname[0].selected != true) {
+		    selname[0].selected = true;
+		}
 	    }
 	}
 	var selval   = eval("document.classgrade.SELVAL_"+partid);
@@ -1075,40 +1075,55 @@
 
     function writeRadText(partid,weight) {
 	var selval   = eval("document.classgrade.SELVAL_"+partid);
+	var radioButton = eval("document.classgrade.RADVAL_"+partid);
+	var textbox = eval("document.classgrade.TEXTVAL_"+partid);
 	if (selval[1].selected) {
-	    var radioButton = eval("document.classgrade.RADVAL_"+partid);
 	    for (var i=0; i<radioButton.length; i++) {
 		radioButton[i].checked=false;
 
 	    }
-	    var textbox = eval("document.classgrade.TEXTVAL_"+partid);
 	    textbox.value = "";
 
 	    for (i=0;i<document.classgrade.total.value;i++) {
-		var user = eval("document.classgrade.counter"+i+".value");
-		var scorename = eval("document.classgrade.GRADE_"+user+
-				     "_"+partid+"_awarded");
-		var saveval   = eval("document.classgrade.GRADE_"+user+
-				     "_"+partid+"_solved_save.value");
-		var selname   = eval("document.classgrade.GRADE_"+user+
-				     "_"+partid+"_solved");
+		var user = eval("document.classgrade.ctr"+i+".value");
+		var scorename = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_aw");
+		var saveval   = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_sv_s.value");
+		var selname   = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_sv");
 		if (saveval != "correct") {
 		    scorename.value = "";
 		    selname[1].selected = true;
 		}
 	    }
-	}
+	} else {
+	    for (i=0;i<document.classgrade.total.value;i++) {
+		var user = eval("document.classgrade.ctr"+i+".value");
+		var scorename = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_aw");
+		var saveval   = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_sv_s.value");
+		var selname   = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_sv");
+		if (saveval != "correct") {
+		    scorename.value = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_aw_s.value");;
+		    selname[0].selected = true;
+		}
+	    }
+	}	    
     }
 
     function changeSelect(partid,user) {
-	var selval = eval("document.classgrade.GRADE_"+user+'_'+partid+"_solved");
+	var selval = eval("document.classgrade.GD_"+user+'_'+partid+"_sv");
 	selval[0].selected = true;
     }
 
     function changeOneScore(partid,user) {
-	var selval = eval("document.classgrade.GRADE_"+user+'_'+partid+"_solved");
+	var selval = eval("document.classgrade.GD_"+user+'_'+partid+"_sv");
 	if (selval[1].selected) {
-	    var boxval = eval("document.classgrade.GRADE_"+user+'_'+partid+"_awarded");
+	    var boxval = eval("document.classgrade.GD_"+user+'_'+partid+"_aw");
 	    boxval.value = "";
 	}
     }
@@ -1127,25 +1142,28 @@
 	    selval[0].selected = true;
 
 	    for (i=0;i<document.classgrade.total.value;i++) {
-		var user = eval("document.classgrade.counter"+i+".value");
-		var resetscore = eval("document.classgrade.GRADE_"+user+
-				      "_"+partid+"_awarded");
-		resetscore.value = eval("document.classgrade.GRADE_"+user+
-					"_"+partid+"_awarded_save.value");
+		var user = eval("document.classgrade.ctr"+i+".value");
+		var resetscore = eval("document.classgrade.GD_"+user+
+				      "_"+partid+"_aw");
+		resetscore.value = eval("document.classgrade.GD_"+user+
+					"_"+partid+"_aw_s.value");
 
-		var saveselval   = eval("document.classgrade.GRADE_"+user+
-				     "_"+partid+"_solved_save.value");
+		var saveselval   = eval("document.classgrade.GD_"+user+
+				     "_"+partid+"_sv_s.value");
 
-		var selname   = eval("document.classgrade.GRADE_"+user+"_"+partid+"_solved");
+		var selname   = eval("document.classgrade.GD_"+user+"_"+partid+"_sv");
 		if (saveselval == "excused") {
-		    selname[1].selected = true;
+		    if (selname[1].selected == false) { selname[1].selected = true;}
 		} else {
-		    selname[0].selected = true;
+		    if (selname[0].selected == false) {selname[0].selected = true};
 		}
 	    }
 	}
     }
 
+    function submitForm() {
+	document.classgrade.submit();
+    }
 
 </script>
 VIEWJAVASCRIPT
@@ -1156,9 +1174,9 @@
     &viewgrades_js($request);
 
     my ($symb,$url) = ($ENV{'form.symb'},$ENV{'form.url'}); 
-    $request->print ('<h2><font color="#339933">Manual Grading</font></h2>');
+    my $result='<h2><font color="#339933">Manual Grading</font></h2>';
 
-    my $result='<font size=+1><b>Resource: </b>'.$ENV{'form.url'}.'</font>'."\n";
+    $result.='<font size=+1><b>Resource: </b>'.$ENV{'form.url'}.'</font>'."\n";
 
     #view individual student submission form - called using Javascript viewOneStudent
     $result.= '<form action="/adm/grades" method="post" name="onestudent">'."\n".
@@ -1214,7 +1232,9 @@
     }
     $result.='</table><input type="hidden" name="totalparts" value="'.$ctsparts.'" />';
     $result.='<input type="button" value="Reset" '.
-	'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self> &nbsp &nbsp;';
+	'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self> &nbsp; &nbsp;';
+#    $result.='<input type="button" value="Submit Changes" '.
+#	'onClick="document.classgrade.submit();" TARGET=_self />'."\n";
     $result.= '<input type="submit" name="submit"  value="Submit Changes" />'."\n";
 
     $result.= '<table border=0><tr><td bgcolor="#777777">'."\n".
@@ -1242,7 +1262,7 @@
     my $ctr = 0;
     foreach ( sort(@{ $$classlist{$ENV{'form.section'}} }) ) {
 	(my $username = $_) = split(/:/);
-	$result.='<input type="hidden" name="counter'.$ctr.'" value="'.$username.'" />'."\n";
+	$result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$username.'" />'."\n";
 	$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},
 				   $_,$$fullname{$_},\@parts,\%weight);
 	$ctr++;
@@ -1268,18 +1288,18 @@
 	if ($type eq 'awarded') {
 	    my $pts = $score eq '' ? '' : $score*$$weight{$part};
 	    $result.='<input type="hidden" name="'.
-		'GRADE_'.$username.'_'.$part.'_awarded_save" value="'.$pts.'" />'."\n";
+		'GD_'.$username.'_'.$part.'_aw_s" value="'.$pts.'" />'."\n";
 	    $result.='<td align="middle"><input type="text" name="'.
-		'GRADE_'.$username.'_'.$part.'_awarded"'.
+		'GD_'.$username.'_'.$part.'_aw"'.
 		'onChange="javascript:changeSelect('.$part.',\''.$username.'\')" value="'.
 		$pts.'" size="4" /></td>'."\n";
 	} elsif ($type eq 'solved') {
 	    my ($status,$foo)=split(/_/,$score,2);
 	    $status = 'nothing' if ($status eq '');
 	    $result.='<input type="hidden" name="'.
-		'GRADE_'.$username.'_'.$part.'_solved_save" value="'.$status.'" />'."\n";
+		'GD_'.$username.'_'.$part.'_sv_s" value="'.$status.'" />'."\n";
 	    $result.='<td align="middle"><select name="'.
-		'GRADE_'.$username.'_'.$part.'_solved" '.
+		'GD_'.$username.'_'.$part.'_sv" '.
 		'onChange="javascript:changeOneScore('.$part.',\''.$username.'\')" >'."\n";
 	    my $optsel = '<option selected="on"> </option><option>excused</option>'."\n";
 	    $optsel = '<option> </option><option selected="on">excused</option>'."\n"
@@ -1297,22 +1317,89 @@
     my ($request) = @_;
 
     my $symb=$ENV{'form.symb'};
-    if ($symb eq '') { $request->print("Unable to handle ambiguous references:$symb:$ENV{'form.url'}"); return ''; }
-    my $url=$ENV{'form.url'};
+    my $url =$ENV{'form.url'};
+    my $result='<h2><font color="#339933">Current Grade Status</font></h2>';
+    $result.='<font size=+1><b>Resource: </b>'.$ENV{'form.url'}.'</font><br />'."\n";
+    $result.='<font size=+1><b>Section: </b>'.$ENV{'form.section'}.'</font>'."\n";
+    $result.= &show_grading_menu_form ($symb,$url);
+    $result.= '<table border="0"><tr><td bgcolor="#777777">'."\n";
+    $result.= '<table border="0"><tr bgcolor="#deffff">'.
+	'<td rowspan=2><b>Username</b></td><td rowspan=2><b>Fullname</b></td>'."\n";
+
+    my %scoreptr = (
+		    'correct'  =>'correct_by_override',
+		    'incorrect'=>'incorrect_by_override',
+		    'excused'  =>'excused',
+		    'ungraded' =>'ungraded_attempted',
+		    'nothing'  => '',
+		    );
+    my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0');
 
-    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="command" value="viewgrades" />'."\n".
-	'<input type="submit" name="submit" value="See Grades" /> <br />'."\n";
-    
-    my (@parts) = &getpartlist($url);
-    my ($classlist) = &getclasslist($ENV{'form.section'},'0');
-    foreach my $student ( sort(@{ $$classlist{$ENV{'form.section'}} }) ) {
-	$result.=&setstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts);
+    my (@partid);
+    my %weight = ();
+    my ($i,$ctr) = (0,0);
+    while ($ctr < $ENV{'form.totalparts'}) {
+	my $partid = $ENV{'form.partid_'.$ctr};
+	push @partid,$partid;
+	my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb);
+	$weight{$partid} = $wgt eq '' ? '1' : $wgt;
+	$ctr++;
+	$result .= '<td colspan = 2 align="center"><b>Part ID '.$partid.
+	    '</b> (Weight = '.$weight{$partid}.')</td>';
     }
+    $result .= '</tr><tr bgcolor="#deffff">';
+    foreach (@partid) {
+	$result .= '<td align="center">&nbsp;<b>Old Score</b>&nbsp;</td>'.
+	    '<td align="center">&nbsp;<b>New Score</b>&nbsp;</td>';
+    }
+    $result .= '</tr>'."\n";
+
+    for ($i=0; $i<$ENV{'form.total'}; $i++) {
+	my $user = $ENV{'form.ctr'.$i};
+	my %newrecord;
+	my $updateflag = 0;
+	my @userdom = grep /^$user:/,keys %$classlist;
+	my ($foo,$udom) = split(/:/,$userdom[0]);
+
+	$result .= '<tr bgcolor="#ffffde"><td>'.$user.'&nbsp;</td><td>'.
+	    $$fullname{$userdom[0]}.'&nbsp;</td>';
+
+	foreach (@partid) {
+	    my $old_aw    = $ENV{'form.GD_'.$user.'_'.$_.'_aw_s'};
+	    my $old_part  = $old_aw eq '' ? '' : $old_aw/$weight{$_};
+	    my $old_score = $scoreptr{$ENV{'form.GD_'.$user.'_'.$_.'_sv_s'}};
+
+	    my $awarded   = $ENV{'form.GD_'.$user.'_'.$_.'_aw'};
+	    my $partial   = $awarded eq '' ? '' : $awarded/$weight{$_};
+	    my $score;
+	    if ($partial eq '') {
+		$score = $scoreptr{$ENV{'form.GD_'.$user.'_'.$_.'_sv_s'}};
+	    } elsif ($partial > 0) {
+		$score = 'correct_by_override';
+	    } elsif ($partial == 0) {
+		$score = 'incorrect_by_override';
+	    }
+	    $score = 'excused' if (($ENV{'form.GD_'.$user.'_'.$_.'_sv'} eq 'excused') &&
+				   ($score ne 'excused'));
+	    $result .= '<td align="center">'.$old_aw.'&nbsp;</td>'.
+		'<td align="center">'.$awarded.
+		($score eq 'excused' ? $score : '').'&nbsp;</td>';
+
+	    next if ($old_part eq $partial && $old_score eq $score);
+
+	    $updateflag = 1;
+	    $newrecord{'resource.'.$_.'.awarded'}  = $partial if $partial ne '';
+	    $newrecord{'resource.'.$_.'.solved'} = $score;
 
-    $result.='<input type="submit" name="submit" value="See Grades" /></table></form>';
+	}
+	$result .= '</tr>'."\n";
+	if ($updateflag) {
+	    $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+	    &Apache::lonnet::cstore(\%newrecord,$symb,$ENV{'request.course.id'},
+				    $udom,$user);
+	}
+    }
+    $result .= '</table></td></tr></table>'."\n";
     return $result;
 }
 
@@ -1329,7 +1416,7 @@
     foreach my $part (@parts) {
 	my ($temp,$part,$type)=split(/_/,$part);
 	my $oldscore=$record{"resource.$part.$type"};
-	my $newscore=$ENV{"form.GRADE.$student.$part.$type"};
+	my $newscore=$ENV{"form.GD.$student.$part.$type"};
 	if ($type eq 'solved') {
 	    my $update=0;
 	    if ($newscore eq 'nothing' ) {

--ng1028059198--