[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /xml lonxml.pm
raeburn
raeburn at source.lon-capa.org
Thu Feb 6 12:34:20 EST 2014
raeburn Thu Feb 6 17:34:20 2014 EDT
Modified files: (Branch: version_2_11_X)
/loncom/xml lonxml.pm
Log:
- For 2.11
- Backport 1.546.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.531.2.13 loncom/xml/lonxml.pm:1.531.2.14
--- loncom/xml/lonxml.pm:1.531.2.13 Sat Dec 14 01:22:15 2013
+++ loncom/xml/lonxml.pm Thu Feb 6 17:34:19 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.531.2.13 2013/12/14 01:22:15 raeburn Exp $
+# $Id: lonxml.pm,v 1.531.2.14 2014/02/06 17:34:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -400,8 +400,12 @@
&clean_safespace($safeeval);
if (@script_var_displays) {
- my $scriptoutput = join('', at script_var_displays);
- $finaloutput=~s{(</body>\s*</html>)\s*$}{$scriptoutput$1}s;
+ if ($finaloutput =~ m{</body>\s*</html>\s*$}s) {
+ my $scriptoutput = join('', at script_var_displays);
+ $finaloutput=~s{(</body>\s*</html>)\s*$}{$scriptoutput$1}s;
+ } else {
+ $finaloutput .= join('', at script_var_displays);
+ }
undef(@script_var_displays);
}
&init_state();
@@ -1453,7 +1457,9 @@
sub add_script_result {
my ($display) = @_;
- push(@script_var_displays, $display);
+ if ($display ne '') {
+ push(@script_var_displays, $display);
+ }
}
#
More information about the LON-CAPA-cvs
mailing list