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

raeburn raeburn at source.lon-capa.org
Fri Sep 15 09:42:30 EDT 2017


raeburn		Fri Sep 15 13:42:30 2017 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	grades.pm 
  Log:
  - For 2.11
    - Backport 1.741.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.596.2.12.2.40 loncom/homework/grades.pm:1.596.2.12.2.41
--- loncom/homework/grades.pm:1.596.2.12.2.40	Fri May 19 20:08:33 2017
+++ loncom/homework/grades.pm	Fri Sep 15 13:42:29 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.596.2.12.2.40 2017/05/19 20:08:33 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12.2.41 2017/09/15 13:42:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -354,7 +354,7 @@
     }
 
     sub scantron_partids_tograde {
-        my ($resource,$cid,$uname,$udom,$check_for_randomlist,$bubbles_per_row) = @_;
+        my ($resource,$cid,$uname,$udom,$check_for_randomlist,$bubbles_per_row,$scancode) = @_;
         my (%analysis, at parts);
         if (ref($resource)) {
             my $symb = $resource->symb();
@@ -362,6 +362,13 @@
             if ($check_for_randomlist) {
                 $add_to_form = { 'check_parts_withrandomlist' => 1,};
             }
+            if ($scancode) {
+                if (ref($add_to_form) eq 'HASH') {
+                    $add_to_form->{'code_for_randomlist'} = $scancode;
+                } else {
+                    $add_to_form = { 'code_for_randomlist' => $scancode,};
+                }
+            }
             my $analyze =
                 &get_analyze($symb,$uname,$udom,undef,$add_to_form,
                              undef,undef,undef,$bubbles_per_row);
@@ -8783,9 +8790,14 @@
             }
             if ((exists($grader_randomlists_by_symb{$ressymb})) ||
                 (ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
+                my $currcode;
+                if (exists($grader_randomlists_by_symb{$ressymb})) {
+                    $currcode = $scancode;
+                }
                 my ($analysis,$parts) =
                     &scantron_partids_tograde($resource,$env{'request.course.id'},
-                                              $uname,$udom,undef,$bubbles_per_row);
+                                              $uname,$udom,undef,$bubbles_per_row,
+                                              $currcode);
                 $partids_by_symb{$ressymb} = $parts;
             } else {
                 $partids_by_symb{$ressymb} = $grader_partids_by_symb{$ressymb};
@@ -9455,10 +9467,14 @@
             my $ressymb = $resource->symb();
             if ((exists($grader_randomlists_by_symb{$ressymb})) ||
                 (ref($grader_partids_by_symb{$ressymb}) ne 'ARRAY')) {
+                my $currcode;
+                if (exists($grader_randomlists_by_symb{$ressymb})) {
+                    $currcode = $scancode;
+                }
                 (my $analysis,$parts) =
                     &scantron_partids_tograde($resource,$env{'request.course.id'},
                                               $username,$domain,undef,
-                                              $bubbles_per_row);
+                                              $bubbles_per_row,$currcode);
             } else {
                 $parts = $grader_partids_by_symb{$ressymb};
             }




More information about the LON-CAPA-cvs mailing list