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

banghart lon-capa-cvs@mail.lon-capa.org
Sun, 03 Apr 2005 21:41:58 -0000


banghart		Sun Apr  3 17:41:58 2005 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Style corrections.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.254 loncom/homework/grades.pm:1.255
--- loncom/homework/grades.pm:1.254	Sat Apr  2 13:44:39 2005
+++ loncom/homework/grades.pm	Sun Apr  3 17:41:58 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.254 2005/04/02 18:44:39 banghart Exp $
+# $Id: grades.pm,v 1.255 2005/04/03 21:41:58 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2183,23 +2183,23 @@
 # ----------- Handles creating versions for portfolio files as answers
 sub version_portfiles {
     my ($record, $parts_graded, $courseid, $symb, $domain, $stuname) = @_;
-    my $parts = join '|', @$parts_graded;
+    my $parts = join('|', @$parts_graded);
     my $portfolio_root = &Apache::loncommon::propath($domain,
 						 $stuname).
 						'/userfiles/portfolio';
-    foreach my $key (keys %$record) {
+    foreach my $key(keys %$record) {
         if ($key =~ /^resource\.($parts)\./ && $key =~ /\.portfiles$/) {
-            my @portfiles = split /,/,$$record{$key};
+            my @portfiles = split(/,/,$$record{$key});
             foreach my $file (@portfiles) {
-                my ($directory,$answer_file) =( $file =~ /^(.*?)([^\/]*$)/);
+                my ($directory,$answer_file) =($file =~ /^(.*?)([^\/]*$)/);
                 my $version = 0;
-                my @answer_file_parts = split /\./, $answer_file;
+                my @answer_file_parts = split(/\./, $answer_file);
                 my @dir_list = &Apache::lonnet::dirlist($directory,$domain,$stuname,$portfolio_root);
                 my @file_names;
                 my @file_name_parts;
                 foreach my $row (@dir_list) {
-                    @file_names = split (/\&/,$row,2);
-                    @file_name_parts = split (/\./, $file_names[0]);
+                    @file_names = split(/\&/,$row,2);
+                    @file_name_parts = split(/\./, $file_names[0]);
                     # ($file_name_parts[scalar @file_name_parts] eq $answer_file_parts[scalar @answer_file_parts])
                     if (($file_name_parts[0] eq $answer_file_parts[0]) && 
                         ($file_name_parts[-1] eq $answer_file_parts[-1])) {
@@ -2210,9 +2210,9 @@
                         }
                     }
                 }
-                $version += 1;
+                $version++;
                 &Apache::lonnet::logthis('answer file is '.$answer_file.
-                        ' becomes '.$answer_file_parts[0].'.'.$version.'.'.$answer_file_parts[(scalar @answer_file_parts)-1]);
+                        ' 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');
             }
             &Apache::lonnet::logthis('found key portfiles '.$key);