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 000000000..6e04c1516 Binary files /dev/null and b/docs/upgrades/packages-7.7.3/root_import_survey_default-question-edit.wgpkg differ diff --git a/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm b/lib/WebGUI/Asset/Wobject/Survey/ResponseJSON.pm index 6b3fd0212..16723a63e 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/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 },