--- loncom/homework/essayresponse.pm 2003/01/24 19:49:48 1.22
+++ loncom/homework/essayresponse.pm 2003/04/08 02:40:56 1.26
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# essay (ungraded) style responses
#
-# $Id: essayresponse.pm,v 1.22 2003/01/24 19:49:48 www Exp $
+# $Id: essayresponse.pm,v 1.26 2003/04/08 02:40:56 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,7 +74,7 @@ sub start_essayresponse {
"'multipart/form-data'".';" />
Allowed filetypes: '.$uploadedfiletypes.'
';
if ($uploadedfile) {
$result.='Currently submitted: '.$uploadedfile.'';
+ &Apache::lonnet::tokenwrapper($Apache::lonhomework::history{"resource.$part.$id.uploadedurl"}).'"> '.$uploadedfile.'';
} else {
$result.='(Hand in a file you have prepared on your computer)';
}
@@ -98,7 +98,7 @@ sub end_essayresponse {
if ($collaborators ne $previous_list);
}
if ( defined $ENV{'form.submitted'}) {
- my $response = $ENV{'form.HWVAL'.$id};
+ my $response = $ENV{'form.HWVAL_'.$id};
my $filename= $ENV{'form.HWFILE'.$part.'_'.$id.'.filename'};
if (( $response =~ /[^\s]/) || ($filename =~ /[^\s]/)) {
my $award;
@@ -132,10 +132,16 @@ sub end_essayresponse {
$result.=&Apache::edit::end_table();
} elsif ($target eq 'tex') {
if ($Apache::lonhomework::type eq 'exam') {
- $result.='\begin{enumerate}\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Live blank on scoring form}\vskip 0 mm';
- &Apache::lonxml::increment_counter();
- $result.= '\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Leave blank on scoring form}\vskip 0 mm \end{enumerate}';
- &Apache::lonxml::increment_counter();
+ my $id = $Apache::inputtags::part;
+ my $weight = &Apache::lonnet::EXT("resource.$id.weight");
+ my $repetition = int $weight/9;
+ if ($weight % 9 != 0) {$repetition++;}
+ $result.='\begin{enumerate}';
+ for (my $i=0;$i<$repetition;$i++) {
+ $result.='\item[\textbf{'.$Apache::lonxml::counter.'}.]\textit{Leave blank on scoring form}\vskip 0 mm';
+ &Apache::lonxml::increment_counter();
+ }
+ $result.= '\end{enumerate}';
}
}