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

raeburn raeburn at source.lon-capa.org
Wed Aug 28 14:26:58 EDT 2013


raeburn		Wed Aug 28 18:26:58 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	grades.pm 
  Log:
  - For 2.11
    - Backport 1.702 (part -- excluding white space changes).
    - Fix typo -- missing closing paren in 1.596.2.12.2.20.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.596.2.12.2.20 loncom/homework/grades.pm:1.596.2.12.2.21
--- loncom/homework/grades.pm:1.596.2.12.2.20	Wed Aug 28 04:26:45 2013
+++ loncom/homework/grades.pm	Wed Aug 28 18:26:57 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.596.2.12.2.20 2013/08/28 04:26:45 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12.2.21 2013/08/28 18:26:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2230,7 +2230,7 @@
     #                  (for multi-response type part)
     #             (3) Last submission plus the parts info
     #             (4) The whole record for this student
-    if ($env{'form.lastSub'} =~ /^(lastonly|hdgrade)$/) {
+
 	my ($string,$timestamp)= &get_last_submission(\%record);
 	
 	my $lastsubonly;
@@ -2285,7 +2285,7 @@
                         $trial = $record{"resource.$partid.tries"};
                         $rndseed = $record{"resource.$partid.rndseed"};
                     }
-		    if($env{'form.checkPlag'}){
+		    if ($env{'form.checkPlag'}) {
 			my ($oname,$odom,$ocrsid,$oessay,$osim)=
 			    &most_similar($uname,$udom,$symb,$subval);
 			if ($osim) {
@@ -2313,9 +2313,8 @@
 		    }
 		    my $order=&get_order($partid,$respid,$symb,$uname,$udom,
                                          undef,$type,$trial,$rndseed);
-		    if ($env{'form.lastSub'} eq 'lastonly' || 
-			($env{'form.lastSub'} eq 'hdgrade' && 
-			 $$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
+                    if ($env{'form.lastSub'} eq 'lastonly' || $env{'form.lastSub'} eq 'datesub' || $env{'form.lastSub'} =~ /^(last|all)$/ || ($env{'form.lastSub'} eq 'hdgrade' &&
+                         $$handgrade{$$part[0].'_'.$$part[1]} eq 'yes')) {
 			my $display_part=&get_display_part($partid,$symb);
                         $lastsubonly.='<div class="LC_grade_submission_part">'.
                             '<b>'.&mt('Part: [_1]',$display_part).'</b>'.
@@ -2358,10 +2357,11 @@
 	    $lastsubonly.='</div>'."\n"; # End: LC_grade_submissions_body
 	}
 	$request->print($lastsubonly);
-   } elsif ($env{'form.lastSub'} eq 'datesub') {
+   if ($env{'form.lastSub'} eq 'datesub') {
 	my (undef,$responseType,undef,$parts) = &showResourceInfo($symb);
 	$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom));
-    } elsif ($env{'form.lastSub'} =~ /^(last|all)$/) {
+    }
+    if ($env{'form.lastSub'} =~ /^(last|all)$/) {
 	$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
 								 $env{'request.course.id'},
 								 $last,'.submission',
@@ -6593,7 +6593,7 @@
             '<p class="LC_error">'
            .&mt('Unable to accept last correction, an error occurred: [_1]',
                 $errmsg)
-           .'</p>';
+           .'</p>');
     } else {
 	&scantron_put_line($scanlines,$scan_data,$which,$line,$skip);
 	&scantron_putfile($scanlines,$scan_data);




More information about the LON-CAPA-cvs mailing list