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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 16 Nov 2004 20:14:09 -0000


banghart		Tue Nov 16 15:14:09 2004 EDT

  Modified files:              
    /loncom/homework	essayresponse.pm 
  Log:
  	Call lonnet mark_as_readonly and unmark_as_readonly to
  	manage file locking. Appears to work.
  
  
Index: loncom/homework/essayresponse.pm
diff -u loncom/homework/essayresponse.pm:1.47 loncom/homework/essayresponse.pm:1.48
--- loncom/homework/essayresponse.pm:1.47	Sat Nov 13 16:07:20 2004
+++ loncom/homework/essayresponse.pm	Tue Nov 16 15:14:09 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # essay (ungraded) style responses
 #
-# $Id: essayresponse.pm,v 1.47 2004/11/13 21:07:20 albertel Exp $
+# $Id: essayresponse.pm,v 1.48 2004/11/16 20:14:09 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -143,13 +143,9 @@
                     $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::lonnet::put('file_permissions',
-					 { $dsymb.$crsid => $file },$domain,$name);
-                    }
+		    my ($dsymb,$crsid,$domain,$name)=&Apache::lonxml::whichuser();
+		    &Apache::lonnet::unmark_as_readonly($domain,$name,$dsymb.$crsid);
+                    &Apache::lonnet::mark_as_readonly($domain,$name,\@submitted_files,$dsymb.$crsid);
                     $uploadedflag=1;
     	        }
 		$Apache::lonhomework::results{"resource.$part.$id.submission"}=$response;