--- loncom/homework/response.pm	2002/01/11 16:32:29	1.56
+++ loncom/homework/response.pm	2002/07/29 20:40:34	1.63
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.56 2002/01/11 16:32:29 matthew Exp $
+# $Id: response.pm,v 1.63 2002/07/29 20:40:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -32,8 +32,8 @@
 package Apache::response;
 use strict;
 
-sub BEGIN {
-  &Apache::lonxml::register('Apache::response',('responseparam','parameter','caparesponse','numericalresponse','formularesponse','stringresponse','radiobuttonresponse','optionresponse','imageresponse','essayresponse','dataresponse'));
+BEGIN {
+  &Apache::lonxml::register('Apache::response',('responseparam','parameter'));
 }
 
 sub start_response {
@@ -62,11 +62,13 @@ sub start_hintresponse {
   my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval);
   if ($id eq '') { $id = $Apache::lonxml::curdepth; }
   push (@Apache::inputtags::response,$id);
+  push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]);
   return $id;
 }
 
 sub end_hintresponse {
   pop @Apache::inputtags::response;
+  %Apache::inputtags::params=@{pop(@Apache::inputtags::paramstack)};
   return '';
 }
 
@@ -78,7 +80,8 @@ sub setrandomnumber {
     $rndseed=$ENV{'form.rndseed'};
     if (!$rndseed) { $rndseed=time; }
   } else {
-    $rndseed=&Apache::lonnet::rndseed();
+    my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
+    $rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name);
   }
   &Apache::lonxml::debug("randseed $rndseed");
 #  $rndseed=unpack("%32i",$rndseed);
@@ -204,64 +207,6 @@ sub handle_previous {
   }
 }
 
-sub start_caparesponse {
-  require Apache::caparesponse; 
-  import Apache::caparesponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-#  print "\n<br />\nsimple caparesponse\n";
-  return &Apache::caparesponse::start_caparesponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_stringresponse {
-  require Apache::caparesponse;
-  import Apache::caparesponse;
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::caparesponse::start_stringresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_formularesponse {
-  require Apache::caparesponse;
-  import Apache::caparesponse;
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::caparesponse::start_formularesponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_numericalresponse {
-  require Apache::caparesponse; 
-  import Apache::caparesponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::caparesponse::start_numericalresponse
-    ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_radiobuttonresponse {
-  require Apache::radiobuttonresponse; 
-  import Apache::radiobuttonresponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::radiobuttonresponse::start_radiobuttonresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_optionresponse {
-  require Apache::optionresponse; 
-  import Apache::optionresponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::optionresponse::start_optionresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_imageresponse {
-  require Apache::imageresponse; 
-  import Apache::imageresponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::imageresponse::start_imageresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
-sub start_essayresponse {
-  require Apache::essayresponse; 
-  import Apache::essayresponse; 
-  my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-  return &Apache::essayresponse::start_essayresponse($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
-}
-
 sub view_or_modify {
   my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser();
   my $myself=0;
@@ -348,11 +293,12 @@ sub start_responseparam {
       $result = &Apache::edit::rebuild_tag($token);
       $result.=&Apache::edit::handle_insert();
     }
-  } elsif ($target eq 'grade') {
+  } elsif ($target eq 'grade' || $target eq 'answer' ||
+	   $target eq 'web'   || $target eq 'tex') {
     if ($ENV{'request.state'} eq 'construct') {
       my $name    = &Apache::lonxml::get_param('name',$parstack,$safeeval);
       my $default = &Apache::lonxml::get_param('default',$parstack,$safeeval);
-      $Apache::inputtags::params{$name}=$default;
+      if ($name) {$Apache::inputtags::params{$name}=$default;}
     }
   }
   return $result;
@@ -378,7 +324,7 @@ sub setup_params {
   my ($tag) = @_;
 
   if ($ENV{'request.state'} eq 'construct') { return; }
-  @Apache::inputtags::params=();
+  %Apache::inputtags::params=();
   my %paramlist=();
   foreach my $key (keys(%Apache::lonnet::packagetab)) {
     if ($key =~ /^$tag/) {
@@ -440,6 +386,14 @@ sub answer_footer {
   return $result;
 }
 
+sub showallfoils {
+  my $return=0;
+  if (defined($ENV{'form.showallfoils'}) &&
+      $ENV{'request.state'} eq 'construct') {
+    $return=1;
+  }
+  return $return;
+}
 1;
 __END__