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

foxr lon-capa-cvs@mail.lon-capa.org
Wed, 17 Jan 2007 10:46:13 -0000


foxr		Wed Jan 17 05:46:13 2007 EDT

  Modified files:              
    /loncom/homework	optionresponse.pm 
  Log:
  Don't pass through <displayoptionlist> tags to output if the target
  is 'answer'.
  
  
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.135 loncom/homework/optionresponse.pm:1.136
--- loncom/homework/optionresponse.pm:1.135	Wed Mar 15 12:10:49 2006
+++ loncom/homework/optionresponse.pm	Wed Jan 17 05:46:13 2007
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.135 2006/03/15 17:10:49 albertel Exp $
+# $Id: optionresponse.pm,v 1.136 2007/01/17 10:46:13 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -185,6 +185,7 @@
       $result.=&displayfoils($target,$max,$randomize,$TeXlayout,@opt);
     } elsif ( $target eq 'answer') {
       $result.=&displayanswers($max,$randomize,@opt);
+      
     } elsif ( $target eq 'analyze') {
 	my @shown = &whichfoils($max,$randomize);
 	&Apache::response::analyze_store_foilgroup(\@shown,
@@ -448,7 +449,7 @@
 	      $texoptionlist = &optionlist_correction($TeXlayout,@opt);
 	  }
 	  if ($text=~/<drawoptionlist\s*\/>/) {
-	      $text=~s|<drawoptionlist\s*/>| \\makebox\[0\.3in\]\[b\]\{\\hrulefill\} |;
+	      $text=~s|<drawoptionlist\s*\/>| \\makebox\[0\.3in\]\[b\]\{\\hrulefill\} |g;
 	  }
 
 	  if ($text=~m/\\item /) {
@@ -688,14 +689,14 @@
 
 sub start_drawoptionlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target ne 'meta') {
+    if (($target ne 'meta')  && ($target ne 'answer')) {
 	return $token->[4];
     }
 }
 
 sub end_drawoptionlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if ($target ne 'meta') {
+    if (($target ne 'meta') && ($target ne 'answer')) {
 	return $token->[2];
     }
 }