[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

raeburn raeburn at source.lon-capa.org
Thu Feb 6 12:14:33 EST 2014


raeburn		Thu Feb  6 17:14:33 2014 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Modify changes in rev. 1.527.
    Re-enable display of Script Vars link in "Correct answer" box
    when viewing/grading student's submissions with "View Answer"
    set to other than "no".
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.545 loncom/xml/lonxml.pm:1.546
--- loncom/xml/lonxml.pm:1.545	Tue Dec  3 16:39:47 2013
+++ loncom/xml/lonxml.pm	Thu Feb  6 17:14:33 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.545 2013/12/03 16:39:47 bisitz Exp $
+# $Id: lonxml.pm,v 1.546 2014/02/06 17:14:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -306,8 +306,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();
@@ -1359,7 +1363,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