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

banghart lon-capa-cvs@mail.lon-capa.org
Sat, 30 Oct 2004 23:59:00 -0000


banghart		Sat Oct 30 19:59:00 2004 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
  	Save filenames as keys in homework results hash.
  	Seemed like a way to be able to tell if a file had
  	been submitted in response to essay.
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.44 loncom/homework/essayresponse.pm:1.45
--- loncom/homework/essayresponse.pm:1.44	Wed Oct 27 14:30:48 2004
+++ loncom/homework/essayresponse.pm	Sat Oct 30 19:59:00 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.44 2004/10/27 18:30:48 banghart Exp $
+# $Id: essayresponse.pm,v 1.45 2004/10/30 23:59:00 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -142,6 +142,13 @@
                 if ($portfiles =~ /[^\s]/) {
                     $Apache::lonhomework::results{"resource.$part.$id.portfiles"}=$portfiles;
                     $Apache::lonhomework::results{"resource.$part.$id.uploadedurl"}=$portfiles;
+                    my @submitted_files = split /,/,$portfiles;
+		    my ($dsymb,$crsid,$domain,$name)=
+			&Apache::lonxml::whichuser();
+                    foreach (@submitted_files) {
+                        my $file = $_;
+                        $Apache::lonhomework::results{"resource.$domain.$crsid.$name.$file"}='true';
+                    }
                     $uploadedflag=1;
     	        }
 		$Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;