[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 18 Oct 2004 20:37:31 -0000


banghart		Mon Oct 18 16:37:31 2004 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	handle properly named field from essay response
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.48 loncom/interface/portfolio.pm:1.49
--- loncom/interface/portfolio.pm:1.48	Mon Oct 11 20:44:05 2004
+++ loncom/interface/portfolio.pm	Mon Oct 18 16:37:30 2004
@@ -318,8 +318,17 @@
     my $java_script =(<<ENDSMP);
         <script language='javascript'>
         function finishSelect() {
-            opener.document.forms.lonhomework.selectedfiles.value='files were selected';
-            
+            fileList = "";
+            for (i=0;i<document.forms.checkselect.length;i++) { 
+                if (document.forms.checkselect[i].checked){
+                    fileList = fileList + document.forms.checkselect[i].value + "," ;
+                }
+            }
+            opener.document.forms.lonhomework.
+ENDSMP
+    $java_script .= $ENV{'form.fieldname'};
+    $java_script .= (<<ENDSMP);
+        .value=fileList;
             self.close();
         }
         </script>
@@ -339,7 +348,7 @@
 				    $ENV{'user.name'},$portfolio_root);
     if ($dir_list[0] eq 'no_such_dir'){
 	# two main reasons for this:
-        #    1) never been here, so directory structure not created
+        #    1) never been here, so directory structure not created,
 	#    2) back-button navigation after deleting a directory
         if ($current_path eq '/'){
 	        &Apache::lonnet::mkdiruserfile($ENV{'user.name'},
@@ -456,7 +465,7 @@
     $r->rflush();
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['selectfile','currentpath',
-					     'currentfile','action']);
+					     'currentfile','action','fieldname']);
 	if (($ENV{'form.storeupl'} eq 'Upload') & (!$ENV{'form.uploaddoc.filename'})){
    	    $r->print('<font color="red"> No file was selected to upload.'.
    	            'To upload a file, click <strong>Browse...</strong>'.