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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 21 Feb 2005 20:29:00 -0000


albertel		Mon Feb 21 15:29:00 2005 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - when in survey mode, still need to check for sigfigs/units/etc as if these are incorrect it in a invalid answer
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.162 loncom/homework/caparesponse/caparesponse.pm:1.163
--- loncom/homework/caparesponse/caparesponse.pm:1.162	Mon Jan 31 17:00:40 2005
+++ loncom/homework/caparesponse/caparesponse.pm	Mon Feb 21 15:29:00 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.162 2005/01/31 22:00:40 albertel Exp $
+# $Id: caparesponse.pm,v 1.163 2005/02/21 20:29:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -136,15 +136,6 @@
 	if ($Apache::lonhomework::type eq 'exam' && 
 	    $tag eq 'formularesponse') {
 	    $increment=&Apache::response::scored_response($partid,$id);
-	} elsif ($Apache::lonhomework::type eq 'survey') {
-	    my $response = &Apache::response::getresponse();
-	    if ( $response =~ /[^\s]/) {
-		my %previous=&Apache::response::check_for_previous($response,
-								 $partid,$id);
-		$Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
-		my $ad=$Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}='SUBMITTED';
-		&Apache::response::handle_previous(\%previous,$ad);
-	    }
 	} else {
 	    my $response = &Apache::response::getresponse();
 	    if ( $response =~ /[^\s]/) {
@@ -213,6 +204,11 @@
 					   $Apache::inputtags::params{'sig'});
 		}
 		&Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
+		if ($Apache::lonhomework::type eq 'survey' &&
+		    ($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||
+		     $ad eq 'EXACT_ANS')) {
+		    $ad='SUBMITTED';
+		}
 		&Apache::response::handle_previous(\%previous,$ad);
 		$Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
 		$Apache::lonhomework::results{"resource.$partid.$id.awardmsg"}=$msg;
@@ -617,7 +613,7 @@
 	if ($Apache::lonhomework::type eq 'exam' ||
 	    &Apache::response::submitted('scantron')) {
 	    $increment=&Apache::response::scored_response($part,$id);
-	} elsif ($Apache::lonhomework::type eq 'survey') {
+	} elsif (0 && $Apache::lonhomework::type eq 'survey') {
 	    my $response = &Apache::response::getresponse();
 	    if ( $response =~ /[^\s]/) {
 		my %previous=&Apache::response::check_for_previous($response,
@@ -669,6 +665,11 @@
 		    ($ad,$msg) = &Apache::inputtags::finalizeawards(\@awards,\@msgs);
 		    &Apache::lonxml::debug("\n<br>result:$result:$Apache::lonxml::curdepth<br>\n");
 		}
+		if ($Apache::lonhomework::type eq 'survey' &&
+		    ($ad eq 'INCORRECT' || $ad eq 'APPROX_ANS' ||
+		     $ad eq 'EXACT_ANS')) {
+		    $ad='SUBMITTED';
+		}
 		&Apache::response::handle_previous(\%previous,$ad);
 		$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
 		$Apache::lonhomework::results{"resource.$part.$id.awardmsg"}=$msg;