From aa7a20b4f29db0848e3456625765645bddcc6819 Mon Sep 17 00:00:00 2001 From: Patrick Donelan Date: Thu, 9 Apr 2009 05:38:49 +0000 Subject: [PATCH] Made Survey use question default score if answer score undefined, updated hoverHelp --- ...oot_import_survey_default-question-edit.wgpkg | Bin 0 -> 2166 bytes lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm | 5 ++++- lib/WebGUI/i18n/English/Asset_Survey.pm | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 docs/upgrades/packages-7.7.3/root_import_survey_default-question-edit.wgpkg diff --git a/docs/upgrades/packages-7.7.3/root_import_survey_default-question-edit.wgpkg b/docs/upgrades/packages-7.7.3/root_import_survey_default-question-edit.wgpkg new file mode 100644 index 0000000000000000000000000000000000000000..6e04c1516dcfbc56fa609aca0ff95dcd2253320a GIT binary patch literal 2166 zcmV-+2#NO}iwFP!000001MON{bKABO_H%y)MlbA{sUu3(rB-E~Npor3HjdjkNiXX0 zKqMp~;jI8DS?=_|cL5M2L{gTNNN4&GWhNFuVlUr*y9BU$baMQU>$?4J_vFNNTm7zE z{6+c4J!!RCz5bco>2=ReP^;B#^-d5>IsPZ*0y8iz!Gb3^+^BHdeQ**!(mDNiqo9A+ z4P|Ys_`jpSfBon^kD~*b3etO>P7!y*10DXh+v#>n@$b5=&ItlEkN-JV{2v|P^h0R) z>kEiNgNvBq8EK#a`u&fu)KJ3WgfKw~m!s-2`J~4P7R3K{B}W@)4fU|R5nwK!-6b)D zyN}hJC=G)AHe{Jl@*7Dy2`HZvznB}5L?A+P?br)i3WBvqF2y0wtWqv1rmz`qtzr zTaZ=LCsUjT;`Gmya6#kfl=xH>Gbw*TeV;^XddnWaX0eFHD$!V2uFhDTCYSy*DMv!v zY8TT436sF!H}vTOQUAg*x}DKDQiC4EfL}Os-x>YyG7^MESlWhzFP$VHm=i?gC^8cf zjixaR)kDr#&SMG9?Q7+r^Pg{qO;A)4Jps|X!PlGs4@`@`T zt$9)b6sxqT);t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ey/ResponseJSON.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm @@ -781,8 +781,11 @@ sub responseScoresByVariableName { # Grab the corresponding answer my $answer = $self->survey->answer([@address]); + # Use question score if answer score undefined + my $score = (exists $answer->{value} && length $answer->{value} > 0) ? $answer->{value} : $question->{value}; + # Add variable => score to our hash - $lookup{$question->{variable}} = $answer->{value}; + $lookup{$question->{variable}} = $score; } # Add section score totals diff --git a/lib/WebGUI/i18n/English/Asset_Survey.pm b/lib/WebGUI/i18n/English/Asset_Survey.pm index 0a10477f5..302a2a986 100644 --- a/lib/WebGUI/i18n/English/Asset_Survey.pm +++ b/lib/WebGUI/i18n/English/Asset_Survey.pm @@ -300,14 +300,14 @@ our $I18N = { context => q|Description of the 'required' field, used as hoverhelp in the edit question dialog.|, lastUpdated => 0 }, - 'question value' => { - message => q|Question value:|, + 'question score' => { + message => q|Question score:|, lastUpdated => 1224686319 }, - 'question value description' => { - message => q|Enter a value for this question.|, + 'question score description' => { + message => q|Default score to use for answers in this question that don't have an answer score value set.|, context => q|Description of the 'question value' field, used as hoverhelp in the edit question dialog.|, - lastUpdated => 0 + lastUpdated => 1239255403 }, 'please enter answer information' => { message => q|Please enter answer information:|, @@ -421,7 +421,7 @@ our $I18N = { lastUpdated => 1239251986 }, 'answer score description' => { - message => q|Assign a numeric score to this answer. Used in question scoring and jump expressions.|, + message => q|Assign a numeric score to this answer. If blank, the question score value will used instead. Used in question scoring and jump expressions.|, context => q|Description of the 'answer score' field, used as hoverhelp in the edit answer dialog.|, lastUpdated => 1239251986 },