--- loncom/homework/structuretags.pm 2007/09/12 07:59:51 1.398
+++ loncom/homework/structuretags.pm 2007/09/25 23:16:13 1.400
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.398 2007/09/12 07:59:51 www Exp $
+# $Id: structuretags.pm,v 1.400 2007/09/25 23:16:13 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -92,6 +92,31 @@ sub end_tex {
return '';
}
+sub homework_js {
+ return &Apache::loncommon::resize_textarea_js().
+ <<'JS';
+
+JS
+}
+
sub page_start {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$name,
$extra_head)=@_;
@@ -108,13 +133,7 @@ sub page_start {
$parstack,$parser,$safeeval);
}
- $extra_head.= '
-
-';
+ $extra_head .= &homework_js();
my %body_args;
if (defined($found{'html'})) {
@@ -1149,29 +1168,31 @@ sub start_languageblock {
# Now loop over all languages in order of preference
foreach my $preferred_language (@preferred_languages) {
# If the languageblock has no arguments, show the contents
- $result='1';
+ $result=1;
+ my $found=0;
# Do we have an include argument?
if ($include) {
# If include is specified, by default, don't render the block
- $result='';
+ $result=0;
foreach my $included_language (split(/\,/,$include)) {
# ... but if my preferred language is included, render it
if ($included_language eq $preferred_language) {
- $result='1';
- last;
+ $result=1;
+ $found=1;
}
}
}
# Do we have an exclude argument?
if ($exclude) {
- $result='1';
+ $result=1;
foreach my $excluded_language (split(/\,/,$exclude)) {
if ($excluded_language eq $preferred_language) {
- $result='0';
- last;
+ $result=0;
+ $found=1;
}
}
}
+ if ($found) { last; }
}
if ( ! $result ) {
my $skip=&Apache::lonxml::get_all_text("/languageblock",$parser,