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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 22 Jul 2003 19:55:26 -0000


albertel		Tue Jul 22 15:55:26 2003 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - BUG#1936, New Randomization should also reset submissions.
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.137 loncom/homework/lonhomework.pm:1.138
--- loncom/homework/lonhomework.pm:1.137	Mon Jun 30 16:10:01 2003
+++ loncom/homework/lonhomework.pm	Tue Jul 22 15:55:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.137 2003/06/30 20:10:01 albertel Exp $
+# $Id: lonhomework.pm,v 1.138 2003/07/22 19:55:26 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -72,7 +72,8 @@
     }
  
     if ( defined($ENV{'form.submitted'}) &&
-	 ( !defined($ENV{'form.resetdata'}))) {
+	 ( !defined($ENV{'form.resetdata'})) &&
+	 ( !defined($ENV{'form.newrandomization'}))) {
       return ('grade', 'web');
     } else {
       return ('web');
@@ -91,7 +92,8 @@
       if ( $ENV{'form.problemmode'} eq 'View' ||
 	   $ENV{'form.problemmode'} eq 'Discard Edits and View') {
 	if ( defined($ENV{'form.submitted'}) &&
-	     (!defined($ENV{'form.resetdata'})) ) {
+	     (!defined($ENV{'form.resetdata'})) &&
+	     (!defined($ENV{'form.newrandomization'}))) {
 	  return ('grade', 'web','answer');
 	} else {
 	  return ('web','answer');
@@ -663,9 +665,11 @@
   &Apache::lonxml::debug('symb is '.$symb);
   if ($ENV{'request.state'} eq "construct" || $symb eq '') {
       if ($ENV{'form.resetdata'} eq 'Reset Submissions' ||
-	  $ENV{'form.resetdata'} eq 'New Problem Variation' ) {
+	  $ENV{'form.resetdata'} eq 'New Problem Variation' ||
+          $ENV{'form.newrandomization'} eq 'New Randomization') {
 	  my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
 	  &Apache::lonnet::tmpreset($symb,'',$domain,$name);
+&Apache::lonxml::debug("Attempt reset");
       }
   }
   if ($ENV{'request.state'} eq "construct") {