From 5b8a1df90ef6762947b71f5f1de6406df09414d0 Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Mon, 20 Oct 2008 03:49:17 +0000 Subject: [PATCH] Fixed end of survey bug. Now previous answer fill in workds [[gotparam]], branching, and all question types but uploaded files all work. Need to finish reports, upgrade script from V1.0, copy and paste, add point values to answers and questions in the edit templates, and figure out what all methods a proper core wobject should allow. --- lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm index c3a58275f..606875c60 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm @@ -180,7 +180,7 @@ $self->log("There are questions to be submitted in this section"); $terminal = 1; $terminalUrl = $answer->{terminalUrl}; } - elsif($answer->{goto} =~ /\S/){ + elsif($answer->{goto} =~ /\w/){ $goto = $answer->{goto}; } } @@ -191,7 +191,7 @@ $self->log("There are questions to be submitted in this section"); #if all responses completed, move the lastResponse index to the last question shown if($qAnswered){ $self->lastResponse($self->lastResponse + @$questions); - $self->goto($goto); + $self->goto($goto) if(defined $goto); }else{ $terminal = 0; } @@ -200,7 +200,7 @@ $self->log("There are questions to be submitted in this section"); sub goto{ my $self = shift; my $goto = shift; -$self->log("In goto for $goto"); +$self->log("In goto for '$goto'"); for(my $i = 0; $i <= $#{$self->surveyOrder()}; $i++){ my $section = $self->survey->section($self->surveyOrder()->[$i]); my $question = $self->survey->question($self->surveyOrder()->[$i]); @@ -285,6 +285,7 @@ $self->log("Next Questions returning with "); sub surveyEnd{ my $self = shift; $self->log("LR is ".$self->lastResponse." and order is ".$#{$self->surveyOrder}); +$self->log("ENDING THE SURVEY\n\n\n") if($self->lastResponse > $#{$self->surveyOrder}); return 1 if($self->lastResponse >= $#{$self->surveyOrder}); return 0; }