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

www lon-capa-cvs-allow@mail.lon-capa.org
Sat, 16 Jun 2007 14:09:53 -0000


www		Sat Jun 16 10:09:53 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Actually do something if data is incomplete or fishy
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.411 loncom/homework/grades.pm:1.412
--- loncom/homework/grades.pm:1.411	Fri Jun 15 22:35:22 2007
+++ loncom/homework/grades.pm	Sat Jun 16 10:09:52 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.411 2007/06/16 02:35:22 www Exp $
+# $Id: grades.pm,v 1.412 2007/06/16 14:09:52 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6363,8 +6363,21 @@
           $unknown_count++;
        }
     }
-    $result.='<hr /><p>&nbsp;</p><input type="submit" name="finalize" value="'.&mt('Finalize Grading').'" /></form>';
-    $result.='</td></tr></table>'."\n".
+    $result.='<hr />'.
+             &mt('Found [_1] registered and [_2] unregistered clickers.',$student_count,$unknown_count);
+    if ($env{'form.gradingmechanism'} ne 'attendance') {
+       if ($correct_count==0) {
+          $errormsg.="Found no correct answers answers for grading!";
+       } elsif ($correct_count>1) {
+          $result.='<br /><span class="LC_warning">'.&mt("Found [_1] entries for grading!").'</span>';
+       }
+    }
+    if ($errormsg) {
+       $result.='<br /><span class="LC_error">'.&mt($errormsg).'</span>';
+    } else {
+       $result.='<br /><input type="submit" name="finalize" value="'.&mt('Finalize Grading').'" />';
+    }
+    $result.='</form></td></tr></table>'."\n".
              '</td></tr></table><br /><br />'."\n";
     return $result.&show_grading_menu_form($symb);
 }