Add POD stubs, fully document goto.

Prevent recordResponses from autovivifying mcHash keys.  From page to page of
questions it does not matter, but if two questions in the same page have an
unrecognized, type, the second will be processed differently from the first.
This commit is contained in:
Colin Kuskie 2008-12-12 23:33:33 +00:00
parent a8011070bf
commit 3c7162fb8f

View file

@ -297,6 +297,10 @@ sub currentSection {
#-------------------------------------------------------------------
=head2 recordResponses
=cut
sub recordResponses {
my $self = shift;
my $session = shift;
@ -350,7 +354,7 @@ sub recordResponses {
{
$aAnswered = 1;
if ( $mcTypes{ $question->{questionType} } ) {
if ( exists $mcTypes{ $question->{questionType} } ) {
$self->responses->{ $answer->{id} }->{value} = $answer->{recordedAnswer};
}
else {
@ -390,6 +394,18 @@ sub recordResponses {
#-------------------------------------------------------------------
=head2 goto ( $variable )
Looks through all sections and questions for their variable key, in order. If the requested
$variable matches a variable, then the lastResponse is set so that that section or question
is the next displayed. If more than one section or question matches, then the first is used.
=head3 $variable
The variable to look for in all sections and questions.
=cut
sub goto {
my $self = shift;
my $goto = shift;
@ -409,6 +425,10 @@ sub goto {
#-------------------------------------------------------------------
=head2 getPreviousAnswer
=cut
sub getPreviousAnswer {
my $self = shift;
my $questionParam = shift;
@ -502,6 +522,10 @@ sub surveyEnd {
#-------------------------------------------------------------------
=head2 returnResponsesForReporting
=cut
sub returnResponseForReporting {
my $self = shift;
my @responses = ();