--- loncom/homework/inputtags.pm 2006/04/18 22:36:23 1.191 +++ loncom/homework/inputtags.pm 2006/05/30 18:08:35 1.193 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.191 2006/04/18 22:36:23 albertel Exp $ +# $Id: inputtags.pm,v 1.193 2006/05/30 18:08:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,6 +31,9 @@ use strict; use Apache::loncommon; use Apache::lonlocal; use Apache::lonnet; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + BEGIN { &Apache::lonxml::register('Apache::inputtags',('hiddenline','textfield','textline')); @@ -280,7 +283,8 @@ sub start_textline { $Apache::lonxml::evaluate--; my $partid=$Apache::inputtags::part; my $id=$Apache::inputtags::response[-1]; - if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER' + || $Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') { my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval); my $maxlength; if ($size eq '') { $size=20; } else { @@ -295,12 +299,17 @@ sub start_textline { } my $readonly=&Apache::lonxml::get_param('readonly',$parstack, $safeeval); - if (lc($readonly) eq 'yes') { + if (lc($readonly) eq 'yes' + || $Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') { $readonly=' readonly="readonly" '; } else { $readonly=''; } - $result.= ''; } if ($Apache::lonhomework::type eq 'exam' @@ -431,7 +440,7 @@ sub file_selector { '
'; if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ my (@filelist,@bad_file_list); - foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) { + foreach my $file (split(',',&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) { my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser(); my $url="/uploaded/$domain/$user/portfolio$file"; my $icon=&Apache::loncommon::icon($url);