From f3ed30d939b7db420c6bc749790a91efd3696c5f Mon Sep 17 00:00:00 2001 From: Patrick Donelan Date: Wed, 6 May 2009 05:53:10 +0000 Subject: [PATCH] Refactored Survey ExpressionEngine tag() util into tag() setter and tagged() accessor. Updated i18n to reflect the fact that min/max/step are used for all numeric types, not just slider. Also updated textCols/Rows i18n. --- ...ot_import_survey_default-answer-edit.wgpkg | Bin 0 -> 2357 bytes ...root_import_survey_default-questions.wgpkg | Bin 0 -> 4036 bytes .../Asset/Wobject/Survey/ExpressionEngine.pm | 58 ++++++++----- lib/WebGUI/i18n/English/Asset_Survey.pm | 82 ++++++++++-------- t/Asset/Wobject/Survey/ExpressionEngine.t | 21 +++-- t/Asset/Wobject/Survey/ResponseJSON.t | 2 +- 6 files changed, 98 insertions(+), 65 deletions(-) create mode 100644 docs/upgrades/packages-7.7.6/root_import_survey_default-answer-edit.wgpkg create mode 100644 docs/upgrades/packages-7.7.6/root_import_survey_default-questions.wgpkg diff --git a/docs/upgrades/packages-7.7.6/root_import_survey_default-answer-edit.wgpkg b/docs/upgrades/packages-7.7.6/root_import_survey_default-answer-edit.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..2201e358d8d606b5e1bb8a0613264a8fb5716e67 GIT binary patch literal 2357 zcmV-53Ci{#iwFP!000001MOOEbK5o&_UHZzj=u12rj95@vT9X!Czmvhr-|choXcHL zJr5;95)!_Z04=LG{qMI65Cq>%+EV5|m>+BrBo@2R?gH2ce0FsB%d)J=czkqZS%b;g z(*KS0vW^CWp=Aw+!|`x(WDEvlYj9*hm&0E%<8}n9g*IoQ?bQx=-*Ye$E;LU5uNCzF z^+0Gl(0@nr_vy3GEb#ZFDo8&WjkMoY97y+r%dJtt|D(y|FFu9^*k|uSw6C8vp+7ThSCoK}aG_3By+L8os%Vh|P)fw;i_jp7+Gd_`tOp|M4yi zB6#{j^zmcYO&>#+aUs7K#tWCS4RLf|pKL!--wC!tsHGpUogajZmc@}f9@%e*?OfYy zc4aTWfH+VnH)OE&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v9 z-p%+GU;XQsx65Cz#(e$m^6y(Mgt8Ai*i(2#8bS~tidX4n2n=A7#5bE&T$1?IGtZg~ zPb};7Wc-~T5y&3cQ6%b(7yjiRoLo+}&oBL-PrcWpf6|xPk0ljdlIVvYn*RCCpZoZZ b^-0DP0#67$A@GDiHw69%+XtLM05kvq{*#d* literal 0 HcmV?d00001 diff --git a/docs/upgrades/packages-7.7.6/root_import_survey_default-questions.wgpkg b/docs/upgrades/packages-7.7.6/root_import_survey_default-questions.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..7b7edd2e24b2486e1e9517c7d247c321f6bbc873 GIT binary patch literal 4036 zcmV;#4?FN5iwFP!000001MOVtbKAxh*XR5dC_fa*Ok|R>Xw@>s8Tm-#)^?m&ZaOL3 z3`9aAVh~^eP)FMQ?|sMK*yUkU9%sh%j74I1-@a?#zTNjD@9o|FtJmut4F-FAyfktp|-p912+HR;IMz>*niOL-QSBqn|J@ZEBoKO zd)9X`!+*a3D|G6ntdh&L6CFqY`uErLXi=4mv}&@n#;4Q`drqn}Y0~NATYTEN-=WUf zkSBHX>}F9`(0WQ^ie;XwW>{qn(eEsl=XqAo(y1O>q}M-Y#k9O8qCMSE-xlSf&f4VC zo2E*>O_S+aa#_DlChve8Fl0?xUKeTgwoa?()Mhek4Q~xh>N;)2peHvk7telv`#M?v zbb5dBmtUsUcc+i9HHXV8C#I{iY`WPTMFhMPScBInK%2tF4MZn%A(ezvijR> zI!y~2+BcuSuF9rtZWpX8Llu`*xm-M-KAUC@k2=u9nsmO%rGAIg>?+EpC*uzDu|ESf zrPa7I8W+6cqDc1PrY39hbTn*$$j?_v6&1-mJ&EaQJQ{X^UU(>IvON+W>VcBLxZoMG zi|9J3e*m2%=qo^4ax?B!{Pbm7*WixC@^Aq?{`0(O(yB;MjY5CGhLR&_|L<#vb%&ql6(>PpS!8XzE zL?&Z%G98BsQOb%1EEEiPC&W}N^y?^M+{vckN3qWZvMD^Tv)_QipchA7XBy!WJ_#TY zaijwQ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/Asset/Wobject/Survey/ExpressionEngine.pm index 30e358be6..4d3032411 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/ExpressionEngine.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/ExpressionEngine.pm @@ -171,50 +171,67 @@ sub answeredX { =head2 tag ($name, [$value]) -Mutator utility sub that gives expressions access to tag response values (and optionally set them). +Utility sub that allows expressions to tag data =head3 $name -Name of tag whose value is returned. +Name of tag to set =head3 $value (optional) -If provided, the tag is set to this value. +Value of tag to set. Defaults to 1 (boolean true flag). =cut sub tag { my ($name, $value) = @_; - if (defined $value) { - $session->log->debug("Setting tag [$name] to [$value]"); - $tags->{$name} = $value; - } else { - $value = $tags->{$name}; - $session->log->debug("tag($name) resolves to [$value]"); - } - return $value; + $value = 1 if !defined $value; + $session->log->debug("Setting tag [$name] to [$value]"); + $tags->{$name} = $value; } -=head2 tagX +=head2 tagged ($name) -Same as L, except that first argument is an asset spec (assetId or url), which must resolve -to a valid survey instance. The sub is applied to the most recent completed response for the user -on the survey instance given by asset_spec. +Utility sub that gives expressions access to tagged data -Note that it doesn't really make sense to try to set a tag on an external asset, so this sub -is only an accessor. +=head3 $name + +Name of tag whose value is returned. =cut -sub tagX { +sub tagged { + my ($name) = @_; + if (@_ == 2) { + my $args = join ',', @_; + $session->log->warn("Two arguments passed to tagged($args). Did you mean tag($args)?"); + } + my $value = $tags->{$name}; + $session->log->debug("tagged($name) resolves to [$value]"); + return $value; +} + +=head2 taggedX + +Same as L, except that first argument is an asset spec (assetId or url), which must resolve +to a valid survey instance. The sub is applied to the most recent completed response for the user +on the survey instance given by asset_spec. + +=cut + +sub taggedX { my ( $asset_spec, $name ) = @_; + if (@_ == 3) { + my $args = join ',', @_; + $session->log->warn("Three arguments passed to taggedX($args). Did you mean tag($args)?"); + } # See if $otherInstances already contains the external survey if (my $other_instance = $otherInstances->{$asset_spec}) { my $tags = $other_instance->{tags}; my $value = $tags->{$name}; - $session->log->debug("tagX($asset_spec, $name) returns [$value]"); + $session->log->debug("taggedX($asset_spec, $name) returns [$value]"); return $value; } else { # Throw an exception, triggering run() to resolve the external reference and re-run @@ -362,7 +379,8 @@ sub run { $compartment->share('&answered'); $compartment->share('&answeredX'); $compartment->share('&tag'); - $compartment->share('&tagX'); + $compartment->share('&tagged'); + $compartment->share('&taggedX'); $compartment->share('&jump'); $compartment->share('&avg'); diff --git a/lib/WebGUI/i18n/English/Asset_Survey.pm b/lib/WebGUI/i18n/English/Asset_Survey.pm index 73b945579..ff390c2e5 100644 --- a/lib/WebGUI/i18n/English/Asset_Survey.pm +++ b/lib/WebGUI/i18n/English/Asset_Survey.pm @@ -281,23 +281,23 @@ our $I18N = { lastUpdated => 1224686319 }, 'cols description' => { - message => q|The number of columns used for the comment TextArea input field.|, + message => q|The number of columns used for the input field (for TextArea question types).|, context => q|Description of the 'cols' field, used as hoverhelp in the edit question dialog.|, - lastUpdated => 0 + lastUpdated => 1241588599 }, 'comment rows' => { message => q|Comment Rows:|, lastUpdated => 1224686319 }, 'rows description' => { - message => q|The number of rows shown for the comment TextArea input field.|, + message => q|The number of rows used for the input field (for TextArea question types).|, context => q|Description of the 'rows' field, used as hoverhelp in the edit question dialog.|, - lastUpdated => 0 + lastUpdated => 1241588599 + }, + 'maximum number of answers' => { + message => q|Maximum number of answers:|, + lastUpdated => 1224686319 }, - 'maximum number of answers' => { - message => q|Maximum number of answers:|, - lastUpdated => 1224686319 - }, 'maximum number of answers description' => { message => q|Enter the maximum number of answers.|, context => q|Description of the 'maximum number of answers' field, used as hoverhelp in the edit question dialog.|, @@ -393,41 +393,41 @@ our $I18N = { lastUpdated => 1224686319 }, 'min label' => { - message => q|Slider Min|, - lastUpdated => 1224686319 + message => q|Min|, + lastUpdated => 1241588065 }, - 'min description' => { - message => q|The minimum value of this answer for slider type questions.|, - context => q|Description of the 'min' field, used as hoverhelp in the edit answer dialog.|, - lastUpdated => 0 - }, + 'min description' => { + message => q|The minimum numeric value allowed for this answer (for numeric question types such as Number and Slider). Keep this field empty if you do not want to enforce a minimum value. |, + context => q|Description of the 'min' field, used as hoverhelp in the edit answer dialog.|, + lastUpdated => 1241588065 + }, 'max label' => { - message => q|Slider Max|, - lastUpdated => 1224686319 + message => q|Max|, + lastUpdated => 1241588065 }, - 'max description' => { - message => q|The maximum value of this answer for slider type questions.|, - context => q|Description of the 'max' field, used as hoverhelp in the edit answer dialog.|, - lastUpdated => 0 - }, + 'max description' => { + message => q|The maximum numeric value allowed for this answer (for Number and Slider type questions). Keep this field empty if you do not want to enforce a maximum value. |, + context => q|Description of the 'max' field, used as hoverhelp in the edit answer dialog.|, + lastUpdated => 1241588065 + }, 'step label' => { - message => q|Slider Step|, - lastUpdated => 1224686319 + message => q|Step|, + lastUpdated => 1241588065 }, - 'step description' => { - message => q|The step value of this answer for slider type questions.|, - context => q|Description of the 'step' field, used as hoverhelp in the edit answer dialog.|, - lastUpdated => 0 - }, + 'step description' => { + message => q|The step value, that is, the numeric interval to allow between values (for Number and Slider type questions). Keep this field empty if you do not want to enforce a step value. |, + context => q|Description of the 'step' field, used as hoverhelp in the edit answer dialog.|, + lastUpdated => 0 + }, 'verbatim label' => { message => q|Verbatim|, lastUpdated => 1224686319 }, - 'verbatim description' => { - message => q|Set to yes to add an extra text input to the answer, where the user can enter a single line of text. Typically used to permit a free-text 'other' response.|, - context => q|Description of the 'verbatim' field, used as hoverhelp in the edit answer dialog.|, - lastUpdated => 0 - }, + 'verbatim description' => { + message => q|Set to yes to add an extra text input to the answer, where the user can enter a single line of text. Typically used to permit a free-text 'other' response.|, + context => q|Description of the 'verbatim' field, used as hoverhelp in the edit answer dialog.|, + lastUpdated => 0 + }, 'answer score' => { message => q|Answer score:|, lastUpdated => 1239251986 @@ -1358,13 +1358,23 @@ section/answer.|, 'textCols' => { message => q|The number of columns for TextArea questions.|, context => q|Description of a template variable for a template Help page.|, - lastUpdated => 0, + lastUpdated => 1241588599, + }, + + 'textCols label' => { + message => q|TextArea Columns|, + lastUpdated => 1241588599 }, 'textRows' => { message => q|The number of rows for TextArea questions.|, context => q|Description of a template variable for a template Help page.|, - lastUpdated => 0, + lastUpdated => 1241588599, + }, + + 'textRows label' => { + message => q|TextArea Rows|, + lastUpdated => 1241588599 }, 'answers' => { diff --git a/t/Asset/Wobject/Survey/ExpressionEngine.t b/t/Asset/Wobject/Survey/ExpressionEngine.t index d1f41ac1d..0c22c665e 100644 --- a/t/Asset/Wobject/Survey/ExpressionEngine.t +++ b/t/Asset/Wobject/Survey/ExpressionEngine.t @@ -22,7 +22,7 @@ my $session = WebGUI::Test->session; #---------------------------------------------------------------------------- # Tests -my $tests = 49; +my $tests = 50; plan tests => $tests + 1; #---------------------------------------------------------------------------- @@ -141,19 +141,24 @@ SKIP: { '..but can be changed' ); cmp_deeply( - $e->run( $session, q{ tag(b,1) }, { values => \%values, tags => { a => 1 } } ), + $e->run( $session, q{ tag(b) }, { values => \%values, tags => { a => 1 } } ), { jump => undef, tags => { a => 1, b => 1 } }, - '..and new values can be set' + '..and new values can be set (defaults to 1)' ); cmp_deeply( - $e->run( $session, q{ jump{ tag(a) == 'abc' } target }, { values => \%values, tags => { a => 'abc' } } ), + $e->run( $session, q{ jump{ tagged(a) } target }, { values => \%values, tags => { a => 1 } } ), + { jump => 'target', tags => { a => 1 } }, + '..flag can be checked with tagged()' + ); + cmp_deeply( + $e->run( $session, q{ jump{ tagged(a) eq 'abc' } target }, { values => \%values, tags => { a => 'abc' } } ), { jump => 'target', tags => { a => 'abc' } }, - '..tag value resolved by tag() with single arg' + '..and any sort of tagged data returned' ); cmp_deeply( - $e->run( $session, q{ tag(a,xyz); jump{ tag(a) == 'xyz' } target }, { values => {a => 'def'}, tags => { a => 'abc' } } ), + $e->run( $session, q{ tag(a,xyz); jump{ tagged(a) eq 'xyz' } target }, { values => {a => 'def'}, tags => { a => 'abc' } } ), { jump => 'target', tags => { a => 'xyz' } }, - '..overwritten tag value can be used too everything else' + '..overwritten tag data can be used too' ); # Create a test user @@ -207,7 +212,7 @@ SKIP: { { jump => 'target', tags => {} }, 'external score resolves ok too' ); cmp_deeply( $e->run( $session, qq{jump {scoreX('$url', ext_s0) == 200} target}, {userId => $user->userId} ), { jump => 'target', tags => {} }, 'external score section totals work too' ); - cmp_deeply( $e->run( $session, qq{jump {tagX('$url', ext_tag) == 199} target}, {userId => $user->userId} ), + cmp_deeply( $e->run( $session, qq{jump {taggedX('$url', ext_tag, 1) == 199} target}, {userId => $user->userId} ), { jump => 'target', tags => {} }, 'external tag lookups work too' ); } diff --git a/t/Asset/Wobject/Survey/ResponseJSON.t b/t/Asset/Wobject/Survey/ResponseJSON.t index f4020a932..5d3e5aef8 100644 --- a/t/Asset/Wobject/Survey/ResponseJSON.t +++ b/t/Asset/Wobject/Survey/ResponseJSON.t @@ -440,7 +440,7 @@ $rJSON->nextResponse(2); # pretend we just finished s0q2 cmp_deeply($rJSON->tags, {}, 'No tag data'); $rJSON->processExpression('tag(a,100)'); cmp_deeply($rJSON->tags, { a => 100 }, 'Tag data set'); -$rJSON->processExpression('tag(b,50); jump {tag(a) + tag(b) == 150} s1'); +$rJSON->processExpression('tag(b,50); jump {tagged(a) + tagged(b) == 150} s1'); cmp_deeply($rJSON->tags, { a => 100, b => 50 }, 'Tag data cumulative'); is($rJSON->nextResponse, 3, '..and is useful for jump expressions');