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

raeburn raeburn@source.lon-capa.org
Tue, 25 Jan 2011 04:30:13 -0000


raeburn		Tue Jan 25 04:30:13 2011 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - Bug 5531. Reduce incidence of false positives for neutrino detection.
    - Ignore award changes other than between EXACT_ANS, APPROX_ANS and INCORRECT.
    - Ignore award changes if questiontype is randomizetry.  
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.243 loncom/homework/caparesponse/caparesponse.pm:1.244
--- loncom/homework/caparesponse/caparesponse.pm:1.243	Thu Dec 16 16:01:08 2010
+++ loncom/homework/caparesponse/caparesponse.pm	Tue Jan 25 04:30:13 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.243 2010/12/16 16:01:08 raeburn Exp $
+# $Id: caparesponse.pm,v 1.244 2011/01/25 04:30:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1286,16 +1286,27 @@
                         $ad='ANONYMOUS_CREDIT';
                     }
                 }
-                unless ($env{'request.state'} eq 'construct') {
-                    if ($previous{'used'}) {
-                        if ($ad ne $previous{'award'} && $previous{'award'} ne '') {
-                            &stringresponse_gradechange($part,$id,\%previous,
-                                                        'cs',$response,$ad,$type);
-                        }
-                    } elsif ($previous{'usedci'}) {
-                        if ($ad ne $previous{'awardci'} && $previous{'awardci'} ne '') {
-                            &stringresponse_gradechange($part,$id,\%previous,
-                                                        'ci',$response,$ad,$type);
+                unless (($env{'request.state'} eq 'construct') || 
+                        ($Apache::lonhomework::type eq 'randomizetry')) {
+                    if (($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' || $ad eq 'EXACT_ANS')) {
+                        if ($previous{'used'}) {
+                            if ($ad ne $previous{'award'}) {
+                                if (($previous{'award'} eq 'INCORRECT' || 
+                                     $previous{'award'} eq 'APPROX_ANS' ||
+                                     $previous{'award'} eq 'EXACT_ANS')) {
+                                    &stringresponse_gradechange($part,$id,\%previous,
+                                                                'cs',$response,$ad,$type);
+                                }
+                            }
+                        } elsif ($previous{'usedci'}) {
+                            if ($ad ne $previous{'awardci'}) {
+                                if (($previous{'awardci'} eq 'INCORRECT' || 
+                                     $previous{'awardci'} eq 'APPROX_ANS' ||
+                                     $previous{'awardci'} eq 'EXACT_ANS')) {
+                                    &stringresponse_gradechange($part,$id,\%previous,
+                                                                'ci',$response,$ad,$type);
+                                }
+                            }
                         }
                     }
                 }