[LON-CAPA-cvs] cvs: loncom /homework matchresponse.pm optionresponse.pm rankresponse.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 15 Nov 2003 06:28:02 -0000


albertel		Sat Nov 15 01:28:02 2003 EDT

  Modified files:              
    /loncom/homework	matchresponse.pm optionresponse.pm rankresponse.pm 
  Log:
  - stop spamming attempts (Only log a response if there was a response)
  
  
Index: loncom/homework/matchresponse.pm
diff -u loncom/homework/matchresponse.pm:1.30 loncom/homework/matchresponse.pm:1.31
--- loncom/homework/matchresponse.pm:1.30	Fri Nov  7 03:52:20 2003
+++ loncom/homework/matchresponse.pm	Sat Nov 15 01:28:02 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Full matching style response
 #
-# $Id: matchresponse.pm,v 1.30 2003/11/07 08:52:20 albertel Exp $
+# $Id: matchresponse.pm,v 1.31 2003/11/15 06:28:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -317,9 +317,9 @@
 	my $response = &Apache::response::getresponse($temp);
 	push(@items,$response);
 	my $responsename = $letter_name_map{$response};
-	$responsehash{$name}=$responsename;
 	my $value=$Apache::response::foilgroup{$name.'.value'};
 	if ( $response =~ /[^\s]/) {
+	    $responsehash{$name}=$responsename;
 	    &Apache::lonxml::debug("submitted a $response for $value<br />\n");
 	    if ($value eq $responsename) {
 		$grade{$name}='1'; $right++;
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.95 loncom/homework/optionresponse.pm:1.96
--- loncom/homework/optionresponse.pm:1.95	Tue Nov  4 13:37:40 2003
+++ loncom/homework/optionresponse.pm	Sat Nov 15 01:28:02 2003
@@ -1,7 +1,7 @@
 # LearningOnline Network with CAPA
 # option list style responses
 #
-# $Id: optionresponse.pm,v 1.95 2003/11/04 18:37:40 albertel Exp $
+# $Id: optionresponse.pm,v 1.96 2003/11/15 06:28:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -184,8 +184,8 @@
 	  if ($ENV{'form.submitted'} eq 'scantron') {
 	      $response = $opt[$response];
 	  }
-	  $responsehash{$name}=$response;
 	  if ( $response =~ /[^\s]/) {
+	    $responsehash{$name}=$response;
 	    my $value=$Apache::response::foilgroup{$name.'.value'};
 	    &Apache::lonxml::debug("submitted a $response for $value<br />\n");
 	    if ($value eq $response) {
Index: loncom/homework/rankresponse.pm
diff -u loncom/homework/rankresponse.pm:1.26 loncom/homework/rankresponse.pm:1.27
--- loncom/homework/rankresponse.pm:1.26	Mon Oct 27 15:04:34 2003
+++ loncom/homework/rankresponse.pm	Sat Nov 15 01:28:02 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # rank style response
 #
-# $Id: rankresponse.pm,v 1.26 2003/10/27 20:04:34 albertel Exp $
+# $Id: rankresponse.pm,v 1.27 2003/11/15 06:28:02 albertel Exp $
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -195,9 +195,9 @@
     my @correctorder=&get_correct_order($tol,@whichfoils);
     foreach my $name (@whichfoils) {
 	my $response = &Apache::response::getresponse($temp);
-	$responsehash{$name}=$response;
 	my $value=shift(@correctorder);
 	if ( $response =~ /[^\s]/) {
+	    $responsehash{$name}=$response;
 	    &Apache::lonxml::debug("submitted a $response for $value<br />\n");
 	    if ($value eq $response) {
 		$grade{$name}='1'; $right++;