[LON-CAPA-cvs] cvs: loncom /homework hint.pm response.pm /homework/caparesponse caparesponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 25 Nov 2002 21:36:42 -0000


albertel		Mon Nov 25 16:36:42 2002 EDT

  Modified files:              
    /loncom/homework	response.pm hint.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - Fixes BUG#991 (parameters were bleeding between responses)
  - small formatting of answer mode change
  
  
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.66 loncom/homework/response.pm:1.67
--- loncom/homework/response.pm:1.66	Mon Oct 14 16:37:27 2002
+++ loncom/homework/response.pm	Mon Nov 25 16:36:42 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.66 2002/10/14 20:37:27 albertel Exp $
+# $Id: response.pm,v 1.67 2002/11/25 21:36:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -320,11 +320,14 @@
   return $result;
 }
 
+sub reset_params {
+    %Apache::inputtags::params=();
+}
+
 sub setup_params {
   my ($tag) = @_;
 
   if ($ENV{'request.state'} eq 'construct') { return; }
-  %Apache::inputtags::params=();
   my %paramlist=();
   foreach my $key (keys(%Apache::lonnet::packagetab)) {
     if ($key =~ /^$tag/) {
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.32 loncom/homework/hint.pm:1.33
--- loncom/homework/hint.pm:1.32	Wed Nov 13 18:37:56 2002
+++ loncom/homework/hint.pm	Mon Nov 25 16:36:42 2002
@@ -1,13 +1,13 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.32 2002/11/13 23:37:56 albertel Exp $
+# $Id: hint.pm,v 1.33 2002/11/25 21:36:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
 #
-# LON-CAPA is free software; you can redistribute it and/or modify
+# LON-CAPA me&aree software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
@@ -123,6 +123,8 @@
       $result  = &Apache::edit::rebuild_tag($token);
       $result .= &Apache::edit::handle_insert();
     }
+  } elsif ($target eq 'web') {
+      &Apache::response::reset_params();
   }
   return $result;
 }
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.72 loncom/homework/caparesponse/caparesponse.pm:1.73
--- loncom/homework/caparesponse/caparesponse.pm:1.72	Wed Nov 13 18:37:56 2002
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Nov 25 16:36:42 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.72 2002/11/13 23:37:56 albertel Exp $
+# $Id: caparesponse.pm,v 1.73 2002/11/25 21:36:42 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -113,6 +113,8 @@
     }
   } elsif ($target eq 'meta') {
     $result=&Apache::response::meta_package_write('numericalresponse');
+  } elsif ($target eq 'answer' || $target eq 'grade') {
+      &Apache::response::reset_params();
   }
   return $result;
 }
@@ -358,8 +360,8 @@
 	      }
 	  }
 	  if ($target eq 'answer') {
-	      if ($high) { $ans.=' ['.$low.','.$high.'] '; }
-	      if ($sighigh) { $ans.= "Sig <i>$siglow - $sighigh</i>"; }
+	      if ($high) { $ans.=' ['.$low.','.$high.']'; }
+	      if ($sighigh) { $ans.= " Sig <i>$siglow - $sighigh</i>"; }
 	      $result.=&Apache::response::answer_part($$tagstack[-1],$ans);
 	  } elsif ($target eq 'analyze') {
 	      push (@{ $Apache::lonhomework::analyze{"$part_id.answer"} },