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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Wed, 13 Aug 2008 16:56:18 -0000


bisitz		Wed Aug 13 12:56:18 2008 EDT

  Modified files:              
    /loncom/homework	structuretags.pm 
  Log:
  (Credits: Peter Riegler)
  Allow authors to specify more than one language in each "which" attribute
  of the "lang" tag of <translated>. The main reason for this extension was
  the wish to define only _one_ translation block for problems which should
  display English text for both - language English _and_ for default:
  <lang which="default,en">
  
  
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.426 loncom/homework/structuretags.pm:1.427
--- loncom/homework/structuretags.pm:1.426	Mon Aug  4 18:42:11 2008
+++ loncom/homework/structuretags.pm	Wed Aug 13 12:56:15 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: structuretags.pm,v 1.426 2008/08/04 22:42:11 felicia Exp $
+# $Id: structuretags.pm,v 1.427 2008/08/13 16:56:15 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1382,7 +1382,11 @@
 	    my $result = &Apache::lonxml::endredirection();
 	    my $which = &Apache::lonxml::get_param('which',$parstack,
 						   $safeeval);
-	    $available_texts{$which} = $result;
+            foreach my $language (split(/\s*\,\s*/,$which)) {
+               unless ($language=~/\w/) { next; }
+               $available_texts{$language} = $result;
+            }
+
 	}
 	return '';
     }