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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 04 Apr 2005 23:56:45 -0000


banghart		Mon Apr  4 19:56:45 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Saving work. Copies versioned files. Doesn't save name
  	as part of answer yet.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.255 loncom/homework/grades.pm:1.256
--- loncom/homework/grades.pm:1.255	Sun Apr  3 17:41:58 2005
+++ loncom/homework/grades.pm	Mon Apr  4 19:56:44 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.255 2005/04/03 21:41:58 banghart Exp $
+# $Id: grades.pm,v 1.256 2005/04/04 23:56:44 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2211,6 +2211,12 @@
                     }
                 }
                 $version++;
+                my $home_server = &Apache::lonnet::homeserver($stuname,$domain,undef);
+                $ENV{'form.copy'} = &Apache::lonnet::getfile("/uploaded/$domain/$stuname/$directory$answer_file");
+                # $ENV{'form.copy.filename'}='';
+                my $copy_result = &Apache::lonnet::finishuserfileupload($stuname,$domain,$home_server,'copy',
+                                    '/portfolio'.$directory.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]);
+                &Apache::lonnet::logthis('copy result is '.$copy_result);
                 &Apache::lonnet::logthis('answer file is '.$answer_file.
                         ' becomes '.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[-1]);
                 &Apache::lonnet::logthis('from dir list is '.$file_names[0].' has '.@file_name_parts.' parts');