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

www www@source.lon-capa.org
Tue, 27 Apr 2010 13:18:04 -0000


www		Tue Apr 27 13:18:04 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  The logic of this completely escaped me.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.632 loncom/homework/grades.pm:1.633
--- loncom/homework/grades.pm:1.632	Tue Apr 27 00:06:34 2010
+++ loncom/homework/grades.pm	Tue Apr 27 13:18:04 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.632 2010/04/27 00:06:34 www Exp $
+# $Id: grades.pm,v 1.633 2010/04/27 13:18:04 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1267,12 +1267,6 @@
 	    }
 	    
 	}
-	if (val == "Grade Student") {
-	    if (formname.Status.value == "") {
-		formname.Status.value = "Active";
-	    }
-	    formname.studentNo.value = total;
-	}
 	formname.submit();
     }
 
@@ -2214,13 +2208,8 @@
     $request->print('<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':'
 	.$udom.'" />'."\n");
     # return if view submission with no grading option
-# FIXME: the logic seems off here. Why show the grade button if you cannot grade?
     if (!&canmodify($usec)) {
-	my $toGrade.='<input type="button" value="Grade Student" '.
-	    'onclick="javascript:checksubmit(this.form,\'Grade Student\',\''
-	    .$counter.'\');" target="_self" /> &nbsp;'."\n" if (&canmodify($usec));
-	$toGrade.='</div>'."\n";
-	$request->print($toGrade);
+	$request->print('<p><span class="LC_warning">'.&mt('No grading privileges').'</span></p></div>');
 	return;
     } else {
 	$request->print('</div>'."\n");
@@ -2593,16 +2582,6 @@
 	return '';
     }
 
-# Go directly to grade student - from submission or link from chart page
-# FIXME: looks like reading off the button label!
-    if ($button eq 'Grade Student') {
-	my $processUser = $env{'form.unamedom'.$env{'form.studentNo'}};
-	($env{'form.student'},$env{'form.userdom'}) = split(/:/,$processUser);
-	$env{'form.fullname'} = $$fullname{$processUser};
-	&submission($request,0,0,$symb);
-	return '';
-    }
-
     # Get the next/previous one or group of students
     my $firststu = $env{'form.unamedom0'};
     my $laststu = $env{'form.unamedom'.($ngrade-1)};