version 1.71, 2006/03/09 01:11:12
|
version 1.74, 2006/09/21 21:23:19
|
Line 31 use strict;
|
Line 31 use strict;
|
use Apache::lonxml(); |
use Apache::lonxml(); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::essayresponse',('essayresponse')); |
&Apache::lonxml::register('Apache::essayresponse',('essayresponse')); |
Line 72 sub start_essayresponse {
|
Line 75 sub start_essayresponse {
|
$result.=&Apache::inputtags::file_selector($part,$id, |
$result.=&Apache::inputtags::file_selector($part,$id, |
$uploadedfiletypes,'both'); |
$uploadedfiletypes,'both'); |
$result.='</table>'; |
$result.='</table>'; |
|
} elsif ($target eq 'web' && |
|
$Apache::inputtags::status[-1] ne 'CAN_ANSWER') { |
|
my $part= $Apache::inputtags::part; |
|
my @msgs; |
|
if ($Apache::lonhomework::history{"resource.$part.$id.collaborators"} =~ /\S/) { |
|
my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"'); |
|
$result .= '<td>'.&mt('Collaborated with [_1]',$coll).'</td>'; |
|
} |
|
|
|
my $file_submission = |
|
&Apache::inputtags::show_past_file_submission($part,$id); |
|
if ($file_submission) { |
|
$result .= '<td>'.$file_submission.'</td>'; |
|
} |
|
|
|
my $port_submission = |
|
&Apache::inputtags::show_past_portfile_submission($part,$id); |
|
if ($port_submission) { |
|
$result .= '<td>'.$port_submission.'</td>'; |
|
} |
|
|
|
if ($result ne '') { |
|
$result = |
|
'<table class="LC_pastsubmission"><tr>'.$result. |
|
'</tr></table>'; |
|
} |
} |
} |
return $result; |
return $result; |
} |
} |
Line 119 sub end_essayresponse {
|
Line 148 sub end_essayresponse {
|
&Apache::lonnet::declutter($ENV{'REQUEST_URI'}); |
&Apache::lonnet::declutter($ENV{'REQUEST_URI'}); |
my ($adom,$aname,$apath)= |
my ($adom,$aname,$apath)= |
($essayurl=~/^(\w+)\/(\w+)\/(.*)$/); |
($essayurl=~/^(\w+)\/(\w+)\/(.*)$/); |
$apath=&Apache::lonnet::escape($apath); |
$apath=&escape($apath); |
$apath=~s/\W/\_/gs; |
$apath=~s/\W/\_/gs; |
&Apache::lonnet::put('nohist_essay_'.$apath, |
&Apache::lonnet::put('nohist_essay_'.$apath, |
{ $akey => $response },$adom,$aname); |
{ $akey => $response },$adom,$aname); |
Line 165 sub file_submission {
|
Line 194 sub file_submission {
|
|
|
my @submitted_files = ($files); |
my @submitted_files = ($files); |
if ( $which eq 'portfiles' ) { |
if ( $which eq 'portfiles' ) { |
@submitted_files = split(/,/,$files); |
@submitted_files = split(/\s*,\s*/,$files); |
} |
} |
|
|
my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); |
my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes"); |