[LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm /publisher packages.tab

www lon-capa-cvs@mail.lon-capa.org
Wed, 22 Jan 2003 17:29:21 -0000


www		Wed Jan 22 12:29:21 2003 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
    /loncom/publisher	packages.tab 
  Log:
  Bug #89
  Additional parameter to control which files can be uploaded in essay response
  Start upload functionality in essay response
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.16 loncom/homework/essayresponse.pm:1.17
--- loncom/homework/essayresponse.pm:1.16	Mon Jan 13 16:24:02 2003
+++ loncom/homework/essayresponse.pm	Wed Jan 22 12:29:21 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.16 2003/01/13 21:24:02 sakharuk Exp $
+# $Id: essayresponse.pm,v 1.17 2003/01/22 17:29:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -47,6 +47,8 @@
 
 	my $ncol= &Apache::lonnet::EXT("resource.$part".'_'."$id.maxcollaborators");
 	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"});
 	$result='<br /><table border="1">';
 	if ($ncol > 0) {
 	    $result .='<tr><td>'.
@@ -57,6 +59,12 @@
 	    $result .= &check_collaborators($ncol,$coll) if ($coll =~ /\w+/);
 	    $result .='</td></tr>';
 	}
+        if ($uploadedfiletypes) {
+           $result.=
+'<tr><td>Submit a file: <input type="file" size="50" name="HWFILE'.
+		$part.'_'.$id.'" value="'.$uploadedfile.'" onChange="this.form.enctype='.
+"'multipart/form-data'".';" /><br />Allowed filetypes: <b>'.$uploadedfiletypes.'</b><br />(Hand in a file you have prepared on your computer)</td></tr>'; 
+        }
 	$result.='<tr><td>'.
 	    '<input type="radio" name="HWDRAFT'.$part.'_'.$id.'" value="yes" checked>'.
 	    ' Submit text below as answer to receive credit <br />'.
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.13 loncom/publisher/packages.tab:1.14
--- loncom/publisher/packages.tab:1.13	Mon Nov 11 17:15:17 2002
+++ loncom/publisher/packages.tab	Wed Jan 22 12:29:21 2003
@@ -35,3 +35,5 @@
 essayresponse&maxcollaborators&type:int_zeropos
 essayresponse&maxcollaborators&default:0
 essayresponse&maxcollaborators&display:Maximum Number of Collaborators
+essayresponse&uploadedfiletypes&type:string
+essayresponse&uploadedfiletypes&display:Allowed File Extensions for Uploaded Files