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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 07 May 2004 16:12:33 -0000


albertel		Fri May  7 12:12:33 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - reset status now resets all data to ''
  
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.196 loncom/homework/grades.pm:1.197
--- loncom/homework/grades.pm:1.196	Fri May  7 11:09:13 2004
+++ loncom/homework/grades.pm	Fri May  7 12:12:32 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.196 2004/05/07 15:09:13 albertel Exp $
+# $Id: grades.pm,v 1.197 2004/05/07 16:12:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2049,11 +2049,11 @@
 	    }
 	} elsif ($dropMenu eq 'reset status'
 		 && exists($record{'resource.'.$_.'.solved'})) { #don't bother if no old records -> no attempts
-	    $newrecord{'resource.'.$_.'.tries'} = 0;
-	    $newrecord{'resource.'.$_.'.solved'} = '';
-	    $newrecord{'resource.'.$_.'.award'} = '';
-	    $newrecord{'resource.'.$_.'.awarded'} = 0;
-	    $newrecord{'resource.'.$_.'.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+	    foreach my $key (keys (%record)) {
+		if ($key=~/^resource\.\Q$_\E\./) { $newrecord{$key} = ''; }
+	    }
+	    $newrecord{'resource.'.$_.'.regrader'}=
+		"$ENV{'user.name'}:$ENV{'user.domain'}";
 	} elsif ($dropMenu eq '') {
 	    $pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? 
 		    $ENV{'form.GD_BOX'.$newflg.'_'.$_} :