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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 14 Mar 2002 20:30:36 -0000


albertel		Thu Mar 14 15:30:36 2002 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
    /loncom/homework	response.pm 
  Log:
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.156 loncom/xml/lonxml.pm:1.157
--- loncom/xml/lonxml.pm:1.156	Fri Mar  8 13:32:55 2002
+++ loncom/xml/lonxml.pm	Thu Mar 14 15:30:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.156 2002/03/08 18:32:55 matthew Exp $
+# $Id: lonxml.pm,v 1.157 2002/03/14 20:30:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -64,6 +64,7 @@
 use strict;
 use HTML::TokeParser;
 use HTML::TreeBuilder;
+use HTML::Entities;
 use Safe;
 use Safe::Hole;
 use Math::Cephes qw(:trigs :hypers :bessels erf erfc);
@@ -1087,7 +1088,7 @@
 
 sub inserteditinfo {
       my ($result,$filecontents)=@_;
-      $filecontents =~ s:</textarea>:&lt;/textarea&gt;:ig;
+      $filecontents = &HTML::Entities::encode($filecontents);
 #      my $editheader='<a href="#editsection">Edit below</a><hr />';
       my $editfooter=(<<ENDFOOTER);
 <hr />
@@ -1250,6 +1251,7 @@
   if ( ! $context ) { $context = -1; }
   my $args ='';
   if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; }
+  if ( ! $args ) { return undef; }
   if ( $args =~ /my \$$param=\"/ ) {
     return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #'
   } else {
Index: loncom/homework/response.pm
diff -u loncom/homework/response.pm:1.60 loncom/homework/response.pm:1.61
--- loncom/homework/response.pm:1.60	Fri Feb 15 17:16:04 2002
+++ loncom/homework/response.pm	Thu Mar 14 15:30:36 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # various response type definitons response definition
 #
-# $Id: response.pm,v 1.60 2002/02/15 22:16:04 albertel Exp $
+# $Id: response.pm,v 1.61 2002/03/14 20:30:36 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -363,7 +363,7 @@
     if ($ENV{'request.state'} eq 'construct') {
       my $name    = &Apache::lonxml::get_param('name',$parstack,$safeeval);
       my $default = &Apache::lonxml::get_param('default',$parstack,$safeeval);
-      $Apache::inputtags::params{$name}=$default;
+      if ($name) {$Apache::inputtags::params{$name}=$default;}
     }
   }
   return $result;