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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 18 Apr 2003 17:10:08 -0000


sakharuk		Fri Apr 18 13:10:08 2003 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm 
  Log:
  Bug 908 is fixed (this is not a bug - rather enhancement). I've introduced a 
  TeXtype attribute in <radioresponse> tag which allows you to customise the labelling. 
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.69 loncom/homework/radiobuttonresponse.pm:1.70
--- loncom/homework/radiobuttonresponse.pm:1.69	Fri Apr 18 02:26:43 2003
+++ loncom/homework/radiobuttonresponse.pm	Fri Apr 18 13:10:08 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.69 2003/04/18 06:26:43 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.70 2003/04/18 17:10:08 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,6 +62,16 @@
 						 $safeeval,'max','randomize');
     if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
   } elsif ($target eq 'tex') {
+      my $type=&Apache::lonxml::get_param('TeXtype',$parstack,$safeeval,undef,0);
+      if ($type eq '1') {
+	  $result .= ' \renewcommand{\labelenumi}{\arabic{enumi}.}';
+      } elsif ($type eq 'A') {
+	  $result .= ' \renewcommand{\labelenumi}{\Alph{enumi}.}';
+      } elsif ($type eq 'a') {
+	  $result .= ' \renewcommand{\labelenumi}{\alph{enumi}.}';
+      } elsif ($type eq 'i') {
+	  $result .= ' \renewcommand{\labelenumi}{\roman{enumi}.}';
+      }
       $result .= '\begin{enumerate}';
   }
   return $result;