--- loncom/homework/essayresponse.pm 2003/01/24 18:30:54 1.20
+++ loncom/homework/essayresponse.pm 2004/11/13 21:07:20 1.47
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.20 2003/01/24 18:30:54 www Exp $
+# $Id: essayresponse.pm,v 1.47 2004/11/13 21:07:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,13 +25,12 @@
#
# http://www.lon-capa.org/
#
-# 4/3 Guy
-# July, 2002, H. K. Ng
-#
+
package Apache::essayresponse;
use strict;
-use Apache::lonxml;
-use Apache::lonnet;
+use Apache::lonxml();
+use Apache::lonnet();
+use Apache::lonlocal;
BEGIN {
&Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
@@ -45,40 +44,55 @@ sub start_essayresponse {
$result=&Apache::response::meta_package_write('essayresponse');
} elsif ($target eq 'web') {
my $part= $Apache::inputtags::part;
-
my $ncol= &Apache::lonnet::EXT("resource.$part".'_'."$id.maxcollaborators");
- my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"});
+ my $coll= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.collaborators"},'<>&"');
my $uploadedfiletypes= &Apache::lonnet::EXT("resource.$part".'_'."$id.uploadedfiletypes");
- my $uploadedfile= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"});
+ $uploadedfiletypes=~s/[^\w\,]//g;
+ my $uploadedfile= &HTML::Entities::encode($Apache::lonhomework::history{"resource.$part.$id.uploadedfile"},'<>&"');
$result='
'.
+ ' '.
+ &mt('Submit entries below as answer to receive credit').' '. + ' '. + &mt('Save entries below as a draft answer (not submitting them for credit yet)'). + ' |
'.
'Collaborators: '. - '(Enter maximum '.$ncol.' collaborators using username or username@domain, e.g. '. - 'smithje or smithje@'.$ENV{'user.domain'}.'.) '; + &mt('(Enter maximum [_1] collaborators using username or username@domain, e.g. smithje or smithje@[_2].)',$ncol,$ENV{'user.domain'}).' '; $result .= &check_collaborators($ncol,$coll) if ($coll =~ /\w+/); $result .=' |
Submit a file: Allowed filetypes: '.$uploadedfiletypes.' '; - if ($uploadedfile) { - $result.='Currently submitted: '.$uploadedfile.''; + "'multipart/form-data'".';" /> '. + &mt('Allowed filetypes: [_1]',$uploadedfiletypes).' '. + 'OR: Select Portfolio Files'. + ' '. + ''. + ' '; + if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ + $result.="Portfolio files previously selected: ".$Apache::lonhomework::history{"resource.$part.$id.portfiles"}." "; + } + + if ($uploadedfile) { + my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}; + push (@Apache::lonxml::extlinks,$url); + &Apache::lonnet::allowuploaded('/adm/essayresponse',$url); + my $curfile=' '. + $uploadedfile.''; + $result.=&mt('Currently submitted: [_1]',$curfile); } else { - $result.='(Hand in a file you have prepared on your computer)'; + $result.=&mt('(Hand in a file you have prepared on your computer)'); } $result.=' |
'.
- ''.
- ' Submit text below as answer to receive credit '. - ''. - ' Save text below as a draft answer (not submitting it for credit yet) '. - ' |