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

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


albertel		Wed Oct 20 23:24:23 2004 EDT

  Modified files:              
    /loncom/homework/caparesponse	caparesponse.pm 
  Log:
  - between this commit and the previous one, survey mode support has been added to <stringresponse> <numericalresponse> and <formularesponse>
  
  
Index: loncom/homework/caparesponse/caparesponse.pm
diff -u loncom/homework/caparesponse/caparesponse.pm:1.156 loncom/homework/caparesponse/caparesponse.pm:1.157
--- loncom/homework/caparesponse/caparesponse.pm:1.156	Wed Oct 20 22:43:34 2004
+++ loncom/homework/caparesponse/caparesponse.pm	Wed Oct 20 23:24:23 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # caparesponse definition
 #
-# $Id: caparesponse.pm,v 1.156 2004/10/21 02:43:34 albertel Exp $
+# $Id: caparesponse.pm,v 1.157 2004/10/21 03:24:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -609,6 +609,17 @@
 	if ($Apache::lonhomework::type eq 'exam' ||
 	    $ENV{'form.submitted'} eq 'scantron') {
 	    $increment=&Apache::response::scored_response($part,$id);
+	} elsif ($Apache::lonhomework::type eq 'survey') {
+	    if ( !defined($ENV{'form.submitted'})) { return ''; }
+	    my $response = &Apache::response::getresponse();
+	    if ( $response =~ /[^\s]/) {
+		my %previous=&Apache::response::check_for_previous($response,
+								   $part,$id);
+		$Apache::lonhomework::results{"resource.$part.$id.submission"}=
+		    $response;
+		my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED';
+		&Apache::response::handle_previous(\%previous,$ad);
+	    }
 	} else {
 	    my $response = &Apache::response::getresponse();
 	    if ( $response =~ /[^\s]/) {