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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 26 Jun 2007 20:51:53 -0000


albertel		Tue Jun 26 16:51:53 2007 EDT

  Modified files:              
    /loncom/homework	insertlist.xml optionresponse.pm 
  Log:
  - <drawoptionlist ?. insertable, and works correctly when outside
    of a text block (BUG#5302) 
  
  
Index: loncom/homework/insertlist.xml
diff -u loncom/homework/insertlist.xml:1.6 loncom/homework/insertlist.xml:1.7
--- loncom/homework/insertlist.xml:1.6	Mon May 21 21:03:35 2007
+++ loncom/homework/insertlist.xml	Tue Jun 26 16:51:53 2007
@@ -206,17 +206,23 @@
 		<color>#1144dd</color>
 		<insert_sub>default</insert_sub>
 	</tag>
+
 	<tag name="optionresponse::conceptgroup">
 		<description>Collection of similar foils</description>
 		<color>#EEEE00</color>
 		<insert_sub>Apache::optionresponse::insert_conceptgroup</insert_sub>
 		<allow>optionresponse::foil</allow>
 	</tag>
+	<tag name="optionresponse::drawoptionlist">
+		<description>Draw Option List</description>
+		<color>#88ee00</color>
+		<insert_sub>Apache::optionresponse::insert_drawoptionlist</insert_sub>
+	</tag>
 	<tag name="optionresponse::foil">
 		<description>Option response foil</description>
 		<color>#dd55ff</color>
 		<insert_sub>Apache::optionresponse::insert_foil</insert_sub>
-		<allow>block,display,gnuplot,img,import,organicstructure,parserlib,problemtype,randomlabel,randomlist,script,scriptlib,startouttext,tex,web,while,window</allow>
+		<allow>block,display,gnuplot,img,import,organicstructure,parserlib,problemtype,randomlabel,randomlist,script,scriptlib,startouttext,tex,web,while,window,optionresponse::drawoptionlist</allow>
 	</tag>
 	<tag name="optionresponse::foilgroup">
 		<description>Collection of Foils</description>
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.143 loncom/homework/optionresponse.pm:1.144
--- loncom/homework/optionresponse.pm:1.143	Tue Apr 17 19:25:09 2007
+++ loncom/homework/optionresponse.pm	Tue Jun 26 16:51:53 2007
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.143 2007/04/17 23:25:09 albertel Exp $
+# $Id: optionresponse.pm,v 1.144 2007/06/26 20:51:53 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -705,25 +705,29 @@
 
 sub start_drawoptionlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if (($target ne 'meta')  && ($target ne 'answer')) {
+    if ($target !~ /^(?:meta|answer|modified|edit)$/) {
 	return $token->[4];
     }
 }
 
 sub end_drawoptionlist {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
-    if (($target ne 'meta') && ($target ne 'answer')) {
+    if ($target !~ /^(?:meta|answer|modified|edit)$/) {
 	return $token->[2];
     }
 }
 
 sub insert_foil {
-  return '
+    return '
 <foil name="" value="unused">
 <startouttext />
 <endouttext />
 </foil>';
 }
+
+sub insert_drawoptionlist {
+    return '<drawoptionlist />';
+}
 1;
 __END__