--- loncom/homework/essayresponse.pm 2003/01/22 17:29:21 1.17
+++ loncom/homework/essayresponse.pm 2004/12/14 20:12:30 1.54
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.17 2003/01/22 17:29:21 www Exp $
+# $Id: essayresponse.pm,v 1.54 2004/12/14 20:12:30 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,12 +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::lonxml();
+use Apache::lonnet();
+use Apache::lonlocal;
BEGIN {
&Apache::lonxml::register('Apache::essayresponse',('essayresponse'));
@@ -44,33 +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.' (Hand in a file you have prepared on your computer) |
'.&mt('Submit a file: (only one file can be uploaded)').
+ ' '. + $part.'_'.$id.'" '. + &mt('Allowed filetypes: [_1]',$uploadedfiletypes).' '. + 'OR: Select Portfolio Files'. + ' '. + ''. + ' '; + if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){ + $result.="Portfolio files previously selected: ".&Apache::lonnet::unescape($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.=&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) '. - ' |