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

raeburn raeburn@source.lon-capa.org
Sun, 28 Feb 2010 23:37:44 -0000


raeburn		Sun Feb 28 23:37:44 2010 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  - New awards for surveys:
   ANONYMOUS ANONYMOUS_CREDIT SUBMITTED_CREDIT
    - given for question types: anonsurvey, anonsurvey_cred, survey_cred.
      - anonsurvey -- course personnel can not view both identity of submitter
                      and submission details.
      - anonsurveycred -- same anonymity, but submitter receives 'awarded' for
                          submission
      - surveycred - submitter receives 'awarded' for submission to survey.
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.98 loncom/homework/imageresponse.pm:1.99
--- loncom/homework/imageresponse.pm:1.98	Mon Aug  3 10:40:00 2009
+++ loncom/homework/imageresponse.pm	Sun Feb 28 23:37:44 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.98 2009/08/03 10:40:00 foxr Exp $
+# $Id: imageresponse.pm,v 1.99 2010/02/28 23:37:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -466,8 +466,18 @@
     my %previous=
 	&Apache::response::check_for_previous(&stringify_submission(\%response),
 					      $part,$id);
-    if ($result 
-	&& $Apache::lonhomework::type eq 'survey') { $result='SUBMITTED'; }
+    if ($result) { 
+	if ($Apache::lonhomework::type eq 'survey') { 
+            $result='SUBMITTED';
+        } elsif ($Apache::lonhomework::type eq 'surveycred') { 
+            $result='SUBMITTED_CREDIT'; 
+        } elsif ($Apache::lonhomework::type eq 'anonsurvey') { 
+            $result='ANONYMOUS'; 
+        } elsif ($Apache::lonhomework::type eq 'anonsurveycred') { 
+            $result='ANONYMOUS_CREDIT'; 
+        }
+    }
+
     &Apache::response::handle_previous(\%previous,$result);
     $Apache::lonhomework::results{"resource.$part.$id.submission"}=
 	&stringify_submission(\%response);