--- loncom/homework/essayresponse.pm 2003/01/24 19:49:48 1.22
+++ loncom/homework/essayresponse.pm 2003/02/27 21:20:48 1.25
@@ -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.25 2003/02/27 21:20:48 sakharuk 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)';
}
@@ -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}';
}
}