[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /homework inputtags.pm

raeburn raeburn at source.lon-capa.org
Tue Apr 21 18:52:44 EDT 2015


raeburn		Tue Apr 21 22:52:44 2015 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/homework	inputtags.pm 
  Log:
  - For 2.11
    Backport 1.334, 1.335.
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.333.2.1 loncom/homework/inputtags.pm:1.333.2.2
--- loncom/homework/inputtags.pm:1.333.2.1	Thu Mar 19 08:40:38 2015
+++ loncom/homework/inputtags.pm	Tue Apr 21 22:52:44 2015
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.333.2.1 2015/03/19 08:40:38 raeburn Exp $
+# $Id: inputtags.pm,v 1.333.2.2 2015/04/21 22:52:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -897,7 +897,7 @@
 
 {
     my @awards = ('EXTRA_ANSWER', 'MISSING_ANSWER', 'ERROR', 'NO_RESPONSE',
-		  'WRONG_NUMCHECKEDBOXES','TOO_LONG',
+		  'WRONG_NUMBOXESCHECKED','TOO_LONG',
 		  'UNIT_INVALID_INSTRUCTOR', 'UNIT_INVALID_STUDENT',
 		  'UNIT_IRRECONCIBLE', 'UNIT_FAIL', 'NO_UNIT',
 		  'UNIT_NOTNEEDED', 'WANTED_NUMERIC', 'BAD_FORMULA',  'NOT_FUNCTION', 
@@ -987,6 +987,23 @@
 	$j++;
     }
 
+    # if at least one response item is set to include lenient grading
+    # and that item is partially correct then overall award reflects
+    # that, unless an award for one of the other response items does
+    # not fall within the basic awards for correct or incorrect.
+    if ($Apache::inputtags::leniency) {
+        if (($$awardref[$which] eq 'INCORRECT')
+            && (grep { $_ eq 'EXACT_ANS' ||
+                       $_ eq 'APPROX_ANS' ||
+                       $_ eq 'ASSIGNED_SCORE' } (@$awardref))
+            && !((grep { $_ ne 'INCORRECT' &&
+                         $_ ne 'EXACT_ANS' &&
+                         $_ ne 'APPROX_ANS' &&
+                         $_ ne 'ASSIGNED_SCORE' } (@$awardref)))) {
+            return ('ASSIGNED_SCORE');
+        }
+    }
+
     if (defined($which)) {
 	if (ref($nameref)) {
 	    return ($$awardref[$which],$$msgref[$which],$$nameref[$which]);




More information about the LON-CAPA-cvs mailing list