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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 31 Jan 2005 22:46:23 -0000


albertel		Mon Jan 31 17:46:23 2005 EDT

  Modified files:              
    /loncom/homework	imageresponse.pm 
  Log:
  - BUG#3876, imageresponse didn't do previous detection
  
  
Index: loncom/homework/imageresponse.pm
diff -u loncom/homework/imageresponse.pm:1.59 loncom/homework/imageresponse.pm:1.60
--- loncom/homework/imageresponse.pm:1.59	Mon Jan 10 14:21:57 2005
+++ loncom/homework/imageresponse.pm	Mon Jan 31 17:46:22 2005
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # image click response style
 #
-# $Id: imageresponse.pm,v 1.59 2005/01/10 19:21:57 albertel Exp $
+# $Id: imageresponse.pm,v 1.60 2005/01/31 22:46:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -270,10 +270,15 @@
 	    $temp++;
 	}
     }
+    my $responsestr="$x:$y";
+    my $part=$Apache::inputtags::part;
+    my $id = $Apache::inputtags::response['-1'];
+    my %previous=&Apache::response::check_for_previous($responsestr,$part,$id);
     if ($result 
 	&& $Apache::lonhomework::type eq 'survey') { $result='SUBMITTED'; }
-    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}="$x:$y";
-    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}=$result;
+    &Apache::response::handle_previous(\%previous,$result);
+    $Apache::lonhomework::results{"resource.$part.$id.submission"}=$responsestr;
+    $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$result;
     return '';
 }