--- loncom/homework/inputtags.pm 2006/06/09 16:31:00 1.186.2.1 +++ loncom/homework/inputtags.pm 2006/02/21 22:41:29 1.187 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.186.2.1 2006/06/09 16:31:00 albertel Exp $ +# $Id: inputtags.pm,v 1.187 2006/02/21 22:41:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -229,9 +229,7 @@ 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' - || ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER' && - $Apache::lonhomework::history{"resource.$partid.solved"} !~ /^correct/ )) { + if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval); my $maxlength; if ($size eq '') { $size=20; } else { @@ -246,17 +244,12 @@ sub start_textline { } my $readonly=&Apache::lonxml::get_param('readonly',$parstack, $safeeval); - if (lc($readonly) eq 'yes' - || $Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') { + if (lc($readonly) eq 'yes') { $readonly=' readonly="readonly" '; } else { $readonly=''; } - my $name = 'HWVAL_'.$id; - if ($Apache::inputtags::status[-1] eq 'CANNOT_ANSWER') { - $name = "none"; - } - $result.= ''; } } else { @@ -370,15 +363,22 @@ sub file_selector { ''. '
'; if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ - my @filelist; + my (@filelist,@bad_file_list); foreach my $file (split(',',&Apache::lonnet::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); push(@filelist,''.$file.''); + if (! &Apache::lonnet::stat_file($url)) { + push(@bad_file_list,''.$file.''); + } } $result.=&mt("Portfolio files previously selected: [_1]",join(', ',@filelist)); + if (@bad_file_list) { + $result.='
'.&mt('These file(s) don\'t exist: [_1]',join(', ',@bad_file_list)); + } } } $result.='';