From 54063ae9f64f2bab77326cfc81a1dc61b4c245fe Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Thu, 30 Apr 2009 20:43:23 +0000 Subject: [PATCH] Survey sections now have logical section type, which is never shown to the user, only used for silently checking gotos. --- docs/changelog/7.x.x.txt | 1 + ...t_import_survey_default-section-edit.wgpkg | Bin 2103 -> 2158 bytes .../Asset/Wobject/Survey/ResponseJSON.pm | 10 ++++++++-- lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm | 4 ++++ lib/WebGUI/i18n/English/Asset_Survey.pm | 8 ++++++++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f6bb7baee..c20af44c9 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -16,6 +16,7 @@ - added #10145: Global Head Tags in Settings - added packing to templates, snippets, and head tags. - added #9289: Extending the "Request Approval For Version Tag" activity by reversing the test (Bernd Kalbfuß-Zimmermann) + - added: Survey sections now have logical section type, which is never shown to the user, only used for silently checking gotos. 7.7.4 - rfe: Extend DateTime for Week-Nrs (#9151) diff --git a/docs/upgrades/packages-7.7.5/root_import_survey_default-section-edit.wgpkg b/docs/upgrades/packages-7.7.5/root_import_survey_default-section-edit.wgpkg index 050d449191fc533dbd696d19f389119b237744f8..78e7b4bc7cf654daa7cd35bddcb92fa20b1729bd 100644 GIT binary patch literal 2158 zcmV-!2$A<6iwFP!00000|Lt0BbK5o&_UHZzjK1)0rjAHiw$7@on>0->zH4o_cG}LJ zdLEjDBqS8c13=5_P5*m$@j_4}?O2KAX=kjNL>58p>$8gmurKy@|M7i)aCo@42jBjY z@4iX-@%Mrt7##KeLEr~_BnbSTzeixo?mvZ)AqUaIJdEb_etsVtN9BB9D~I2Il8=%) zaR2x9--8$LMV4+!2cUk`?>oOEH^hNAX9Wo^U`Q=OXDCb#Dxnxw}Q}r6Y8F3m)8h^dQr=5e2dKm|jP{`MJdB$P% zrJ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/Asset/Wobject/Survey/ResponseJSON.pm b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm index e49864ed2..5c7318bab 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm @@ -439,6 +439,7 @@ sub recordResponses { # We want to record responses against the "next" response section and questions, since these are # the items that have just been displayed to the user. my $section = $self->nextResponseSection(); + my @questions = $self->nextQuestions(); #GOTO jumps in the Survey. Order of precedence is Answer, Question, then Section. @@ -461,7 +462,7 @@ sub recordResponses { } # Handle empty Section.. - if ( !@questions ) { + if ( !@questions and !$section->{logical}) { # No questions to process, so increment lastResponse and return $self->lastResponse( $self->nextResponse ); return [ $sTerminal, $terminalUrl ]; @@ -556,13 +557,18 @@ sub recordResponses { # If all required responses were given, proceed onwards! if ($allRequiredQsAnswered) { - # Move the lastResponse index to the last question answered $self->lastResponse( $self->lastResponse + @questions ); # Do any requested branching.. $self->processGoto($goto) if ( defined $goto ); ## no critic $self->processGotoExpression($gotoExpression) if ( defined $gotoExpression ); ## no critic + + # Handle next logic Section.. + my $section = $self->nextResponseSection(); + if($section and $section->{logical}){ + return $self->recordResponses({}); + } } else { # Required responses were missing, so we don't let the Survey terminate diff --git a/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm b/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm index 6be417749..e9e999df3 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm @@ -882,6 +882,7 @@ sub newSection { questionsPerPage => 5, questionsOnSectionPage => 1, randomizeQuestions => 0, + logical => 0, everyPageTitle => 1, everyPageText => 1, terminal => 0, @@ -1222,6 +1223,9 @@ sub validateSurvey{ push @messages, "Section $sNum variable name $var is re-used in $count other place(s)."; } } + if($section->{logical} and @{$self->questions([$s])} > 0){ + push @messages, "Section $sNum is a logical section with questions. Those questions will never be shown."; + } #step through each question validating it. my $questions = $self->questions([$s]); diff --git a/lib/WebGUI/i18n/English/Asset_Survey.pm b/lib/WebGUI/i18n/English/Asset_Survey.pm index 43ee95126..73b945579 100644 --- a/lib/WebGUI/i18n/English/Asset_Survey.pm +++ b/lib/WebGUI/i18n/English/Asset_Survey.pm @@ -39,6 +39,14 @@ our $I18N = { message => q|Continue|, lastUpdated => 1224686319 }, + 'logical section' => { + message => q|Logical Section|, + lastUpdated => 1224686319 + }, + 'logical section help' => { + message => q|A logical section, or its questions, are never shown. They are used to silently execute jump commands.|, + lastUpdated => 1224686319 + }, 'add section' => { message => q|Add Section|, lastUpdated => 1224686319