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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 19 Dec 2006 00:49:56 -0000


albertel		Mon Dec 18 19:49:56 2006 EDT

  Modified files:              
    /loncom/homework	hint.pm 
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - <answergroup>/<answer>/<value>/<vector> all work insed of numerical/formula responses
  
  
Index: loncom/homework/hint.pm
diff -u loncom/homework/hint.pm:1.65 loncom/homework/hint.pm:1.66
--- loncom/homework/hint.pm:1.65	Mon Dec 18 19:40:38 2006
+++ loncom/homework/hint.pm	Mon Dec 18 19:49:53 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # implements the tags that control the hints
 #
-# $Id: hint.pm,v 1.65 2006/12/19 00:40:38 albertel Exp $
+# $Id: hint.pm,v 1.66 2006/12/19 00:49:53 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -110,6 +110,7 @@
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     #do everything in end, so intervening <responseparams> work
     &Apache::response::start_hintresponse($parstack,$safeeval);
+    &Apache::caparesponse::push_answer();
     my $result;
     if ($target eq 'edit') {
 	$result.=&Apache::edit::tag_start($target,$token);
@@ -215,6 +216,7 @@
     } elsif ($target eq 'edit') {
 	$result.=&Apache::edit::end_row().&Apache::edit::end_table();
     }
+    &Apache::caparesponse::pop_answer();
     &Apache::response::end_hintresponse();
     return $result;
 }
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.203 loncom/homework/caparesponse/caparesponse.pm:1.204
--- loncom/homework/caparesponse/caparesponse.pm:1.203	Mon Dec 18 19:40:39 2006
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Dec 18 19:49:53 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.203 2006/12/19 00:40:39 albertel Exp $
+# $Id: caparesponse.pm,v 1.204 2006/12/19 00:49:53 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,7 +41,10 @@
 }
 
 my %answer;
+my @answers;
 sub get_answer { return %answer; };
+sub push_answer{ push(@answers,dclone(\%answer)); undef(%answer) }
+sub pop_answer { %answer = %{pop(@answers)}; };
 
 my $cur_name;
 my $tag_internal_answer_name = 'INTERNAL';