--- loncom/homework/inputtags.pm 2001/12/04 15:17:56 1.47 +++ loncom/homework/inputtags.pm 2002/04/01 21:26:57 1.56 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.47 2001/12/04 15:17:56 albertel Exp $ +# $Id: inputtags.pm,v 1.56 2002/04/01 21:26:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -28,10 +28,11 @@ # 2/19 Guy package Apache::inputtags; +use HTML::Entities(); use strict; -sub BEGIN { - &Apache::lonxml::register('Apache::inputtags',('textarea','textline','datasubmission')); +BEGIN { + &Apache::lonxml::register('Apache::inputtags',('textfield','textline','datasubmission')); } @@ -71,31 +72,40 @@ sub end_input { return ''; } -sub start_textarea { +sub start_textfield { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result = ""; my $id = &start_input($parstack,$safeeval); + my $resid=$Apache::inputtags::response[-1]; if ($target eq 'web') { - my $oldresponse = $Apache::lonhomework::history{"resource.$Apache::inputtags::part.$Apache::inputtags::response['-1'].submission"}; + my $partid=$Apache::inputtags::part; + my $oldresponse = &HTML::Entities::encode($Apache::lonhomework::history{"resource.$partid.$resid.submission"}); my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval); if ( $cols eq '') { $cols = 80; } my $rows = &Apache::lonxml::get_param('rows',$parstack,$safeeval); if ( $rows eq '') { $rows = 10; } if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { - $result= '