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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 21 Oct 2004 03:34:06 -0000


albertel		Wed Oct 20 23:34:06 2004 EDT

  Modified files:              
    /loncom/homework	radiobuttonresponse.pm 
  Log:
  - propely do previous cheiking or rbr survey responses
  
  
Index: loncom/homework/radiobuttonresponse.pm
diff -u loncom/homework/radiobuttonresponse.pm:1.95 loncom/homework/radiobuttonresponse.pm:1.96
--- loncom/homework/radiobuttonresponse.pm:1.95	Thu Oct  7 16:28:30 2004
+++ loncom/homework/radiobuttonresponse.pm	Wed Oct 20 23:34:06 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # mutliple choice style responses
 #
-# $Id: radiobuttonresponse.pm,v 1.95 2004/10/07 20:28:30 albertel Exp $
+# $Id: radiobuttonresponse.pm,v 1.96 2004/10/21 03:34:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -118,12 +118,17 @@
     my $response = $ENV{'form.HWVAL_'.$Apache::inputtags::response['-1']};
     &Apache::lonxml::debug("Here I am!:$response:");
     if ( $response !~ /[0-9]+/) { return ''; }
+    my $part = $Apache::inputtags::part;
     my $id = $Apache::inputtags::response['-1'];
     my @whichfoils=@{ $Apache::response::foilgroup{'names'} };
     my %responsehash;
     $responsehash{$whichfoils[$response]}=$response;
-    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.submission"}=&Apache::lonnet::hash2str(%responsehash);
-    $Apache::lonhomework::results{"resource.$Apache::inputtags::part.$id.awarddetail"}='SUBMITTED';
+    my $responsestr=&Apache::lonnet::hash2str(%responsehash);
+    $Apache::lonhomework::results{"resource.$part.$id.submission"}=
+	$responsestr;
+    my %previous=&Apache::response::check_for_previous($responsestr,$part,$id);
+    my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED';
+    &Apache::response::handle_previous(\%previous,$ad);
     &Apache::lonxml::debug("submitted a $response<br />\n");
     return '';
 }