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

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 11 Mar 2006 00:02:20 -0000


albertel		Fri Mar 10 19:02:20 2006 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  BUG#4653, grading of 'hidden' resources by scantron is now optional. (By default they are graded.)
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.330 loncom/homework/grades.pm:1.331
--- loncom/homework/grades.pm:1.330	Fri Mar 10 18:49:29 2006
+++ loncom/homework/grades.pm	Fri Mar 10 19:02:18 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.330 2006/03/10 23:49:29 albertel Exp $
+# $Id: grades.pm,v 1.331 2006/03/11 00:02:18 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4204,7 +4204,8 @@
 	    <td> Options: </td>
             <td>
 	       <label><input type="checkbox" name="scantron_options_redo" value="redo_skipped"/> Do only previously skipped records</label> <br />
-               <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all exisiting corrections</label>
+               <label><input type="checkbox" name="scantron_options_ignore" value="ignore_corrections"/> Remove all exisiting corrections</label> <br />
+               <label><input type="checkbox" name="scantron_options_hidden" value="ignore_hidden"/> Skip hidden resources when grading</label>
 	    </td>
           </tr>
           <tr bgcolor="#ffffe6">
@@ -4533,8 +4534,15 @@
 
 sub scantron_filter {
     my ($curres)=@_;
-                        # randomout is dysfunctional at best for this purpose
-    if (ref($curres) && $curres->is_problem()) { #&& !$curres->randomout) {
+
+    if (ref($curres) && $curres->is_problem()) {
+	# if the user has asked to not have either hidden
+	# or 'randomout' controlled resources to be graded
+	# don't include them
+	if ($env{'form.scantron_options_hidden'} eq 'ignore_hidden'
+	    && $curres->randomout) {
+	    return 0;
+	}
 	return 1;
     }
     return 0;
@@ -4717,6 +4725,7 @@
   <input type="hidden" name="scantron_CODEunique" value="$env{'form.scantron_CODEunique'}" />
   <input type="hidden" name="scantron_options_redo" value="$env{'form.scantron_options_redo'}" />
   <input type="hidden" name="scantron_options_ignore" value="$env{'form.scantron_options_ignore'}" />
+  <input type="hidden" name="scantron_options_hidden" value="$env{'form.scantron_options_hidden'}" />
 SCANTRONFORM
     return $result;
 }