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

www www@source.lon-capa.org
Sun, 18 Apr 2010 18:45:42 -0000


www		Sun Apr 18 18:45:42 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  $res_error needs to be defined
  Response ID, not Part ID
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.622 loncom/homework/grades.pm:1.623
--- loncom/homework/grades.pm:1.622	Sat Apr 17 22:48:52 2010
+++ loncom/homework/grades.pm	Sun Apr 18 18:45:41 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.622 2010/04/17 22:48:52 www Exp $
+# $Id: grades.pm,v 1.623 2010/04/18 18:45:41 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -138,6 +138,7 @@
 
 #--- Get the partlist and the response type for a given problem. ---
 #--- Indicate if a response type is coded handgraded or not. ---
+#--- Sets response_error pointer to "1" if navmaps object broken ---
 sub response_type {
     my ($symb,$response_error) = @_;
 
@@ -822,10 +823,8 @@
     my $result='<h3><span class="LC_info">&nbsp;'
 	.&mt("View/Grade/Regrade Submissions for a Student or a Group of Students")
 	.'</span></h3>';
-
-    my ($partlist,$handgrade,$responseType) = &response_type($symb
-#,$res_error
-    );
+    my $res_error;
+    my ($partlist,$handgrade,$responseType) = &response_type($symb,\$res_error);
 
     my %lt = &Apache::lonlocal::texthash (
 		'multiple' => 'Please select a student or group of students before clicking on the Next button.',
@@ -1741,8 +1740,8 @@
 }
 
 sub handback_box {
-    my ($symb,$uname,$udom,$counter,$partid,$record,$res_error) = @_;
-    my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error);
+    my ($symb,$uname,$udom,$counter,$partid,$record,$res_error_pointer) = @_;
+    my ($partlist,$handgrade,$responseType) = &response_type($symb,$res_error_pointer);
     my (@respids);
      my @part_response_id = &flatten_responseType($responseType);
     foreach my $part_response_id (@part_response_id) {
@@ -2130,7 +2129,7 @@
                     $lastsubonly.="\n".'<div class="LC_grade_submission_part">'.
                         '<b>'.&mt('Part: [_1]',$display_part).'</b>'.
                         ' <span class="LC_internal_info">'.
-                        '('.&mt('Part ID: [_1]',$respid).')'.
+                        '('.&mt('Response ID: [_1]',$respid).')'.
                         '</span>&nbsp; &nbsp;'.
 			'<span class="LC_warning">'.&mt('Nothing submitted - no attempts.').'</span><br /><br /></div>';
 		    next;
@@ -2175,7 +2174,7 @@
                         $lastsubonly.='<div class="LC_grade_submission_part">'.
                             '<b>'.&mt('Part: [_1]',$display_part).'</b>'.
                             ' <span class="LC_internal_info">'.
-                            '('.&mt('Part ID: [_1]',$respid).')'.
+                            '('.&mt('Response ID: [_1]',$respid).')'.
                             '</span>&nbsp; &nbsp;';
 			my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
 			if (@$files) {
@@ -2206,7 +2205,7 @@
 	}
 	$request->print($lastsubonly);
    } elsif ($env{'form.lastSub'} eq 'datesub') {
-        my ($parts,$handgrade,$responseType) = &response_type($symb);
+        my ($parts,$handgrade,$responseType) = &response_type($symb,\$res_error);
 	$request->print(&displaySubByDates($symb,\%record,$parts,$responseType,$checkIcon,$uname,$udom));
     } elsif ($env{'form.lastSub'} =~ /^(last|all)$/) {
 	$request->print(&Apache::loncommon::get_previous_attempt($symb,$uname,$udom,
@@ -2214,7 +2213,6 @@
 								 $last,'.submission',
 								 'Apache::grades::keywords_highlight'));
     }
-
     $request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':'
 	.$udom.'" />'."\n");
     # return if view submission with no grading option
@@ -9172,7 +9170,7 @@
 
 sub select_problem {
     my ($r)=@_;
-    $r->print('<h2>'.&mt('Select the problem you want to grade').'</h2><form action="/adm/grades">');
+    $r->print('<h2>'.&mt('Select the problem or one of the problems you want to grade').'</h2><form action="/adm/grades">');
     $r->print(&Apache::lonstathelpers::problem_selector('.',undef,1));
     $r->print('<input type="hidden" name="command" value="gradingmenu" />');
     $r->print('<input type="submit" value="'.&mt('Next').' &rarr;" /></form>');