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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 01 Feb 2008 23:00:57 -0000


raeburn		Fri Feb  1 18:00:57 2008 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  When target is 'analysze', before calling lonhomework::set_bubble_lines() need to update the value of $increment if the tag is formularesponse, and this is exam mode.  Otherwise the number of bubble lines will be wrong for scantron grading a formularesponse item with a weight > 10.
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.220 loncom/homework/caparesponse/caparesponse.pm:1.221
--- loncom/homework/caparesponse/caparesponse.pm:1.220	Fri Nov 16 03:44:37 2007
+++ loncom/homework/caparesponse/caparesponse.pm	Fri Feb  1 18:00:56 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.220 2007/11/16 08:44:37 albertel Exp $
+# $Id: caparesponse.pm,v 1.221 2008/02/01 23:00:56 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -787,6 +787,12 @@
     }
     if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
 	$target eq 'tex' || $target eq 'analyze') {
+        if (($tag eq 'formularesponse') && ($target eq 'analyze')) {
+            my $type = &Apache::lonnet::EXT('resource.'.$partid.'_'.$id.'.type');
+            if ($type eq 'exam') {
+                $increment = &Apache::response::repetition();
+            }
+        }
 	&Apache::lonxml::increment_counter($increment,"$partid.$id");
 	if ($target eq 'analyze') {
 	    &Apache::lonhomework::set_bubble_lines();