--- loncom/homework/inputtags.pm 2005/12/01 18:46:31 1.185 +++ 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.185 2005/12/01 18:46:31 albertel Exp $ +# $Id: inputtags.pm,v 1.187 2006/02/21 22:41:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -363,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.=''; @@ -622,7 +629,12 @@ sub decideoutput { $bgcolor=$possiblecolors{'correct'}; $button=0; } elsif ($award eq '') { - $bgcolor=$possiblecolors{'not_charged_try'}; + if ($handgrade && $Apache::inputtags::status[-1] eq 'SHOW_ANSWER') { + $message = &mt("Nothing submitted."); + $bgcolor=$possiblecolors{'charged_try'}; + } else { + $bgcolor=$possiblecolors{'not_charged_try'}; + } $button=1; } else { $message = &mt("Unknown message").": $award";