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:
parent
a8011070bf
commit
3c7162fb8f
1 changed files with 25 additions and 1 deletions
|
|
@ -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 = ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue