version 1.185, 2005/12/01 18:46:31
|
version 1.187, 2006/02/21 22:41:29
|
Line 363 sub file_selector {
|
Line 363 sub file_selector {
|
'<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'. |
'<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'. |
'<br />'; |
'<br />'; |
if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ |
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"}))) { |
foreach my $file (split(',',&Apache::lonnet::unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) { |
my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser(); |
my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser(); |
my $url="/uploaded/$domain/$user/portfolio$file"; |
my $url="/uploaded/$domain/$user/portfolio$file"; |
my $icon=&Apache::loncommon::icon($url); |
my $icon=&Apache::loncommon::icon($url); |
push(@filelist,'<a href="'.$url.'"><img src="'.$icon. |
push(@filelist,'<a href="'.$url.'"><img src="'.$icon. |
'" border="0" />'.$file.'</a>'); |
'" border="0" />'.$file.'</a>'); |
|
if (! &Apache::lonnet::stat_file($url)) { |
|
push(@bad_file_list,'<a href="'.$url.'"><img src="'.$icon. |
|
'" border="0" />'.$file.'</a>'); |
|
} |
} |
} |
$result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist)); |
$result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist)); |
|
if (@bad_file_list) { |
|
$result.='<br />'.&mt('<font color="red">These file(s) don\'t exist:</font> <strong>[_1]</strong>',join(', ',@bad_file_list)); |
|
} |
} |
} |
} |
} |
$result.='</td></tr>'; |
$result.='</td></tr>'; |
Line 622 sub decideoutput {
|
Line 629 sub decideoutput {
|
$bgcolor=$possiblecolors{'correct'}; |
$bgcolor=$possiblecolors{'correct'}; |
$button=0; |
$button=0; |
} elsif ($award eq '') { |
} 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; |
$button=1; |
} else { |
} else { |
$message = &mt("Unknown message").": $award"; |
$message = &mt("Unknown message").": $award"; |