From a0d41dc5aecbda1be11daadf29132414179b5b3c Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Thu, 23 Apr 2009 19:33:10 +0000 Subject: [PATCH] Survey slider answer updates, now update all the answers for max,min,step settings since only the first answers values are used anyways. --- docs/changelog/7.x.x.txt | 2 +- lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 56befb4d0..6f60b859c 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -37,7 +37,7 @@ - Added Survey back button - fixed #10158: Matrix 2.0 - Screenshots rendering poorly - administer.js now has a much improved handling of the slider algorithm, plus some refactored code. Users will not notice anything. - + - Survey slider answer updates, now update all the answers for max,min,step settings since only the first answers values are used anyways. 7.7.3 - fixed #10094: double explanation in thread help - rfe #9612: Carousel Wobject (was Widget Wobject) (SDH Consulting Group) diff --git a/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm b/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm index ca74c70d7..6be417749 100644 --- a/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm +++ b/lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm @@ -667,16 +667,32 @@ sub update { } } + $self->_handleSpecialAnswerUpdates($address,$properties); + # Update $object with all of the data in $properties while (my ($key, $value) = each %{$properties}) { if (defined $value) { $object->{$key} = $value; } } - + return; } +sub _handleSpecialAnswerUpdates{ + my $self = shift; + my $address = shift; + my $properties = shift; + my $question = $self->question($address); + if($question->{questionType} =~ /^Slider|Multi Slider - Allocate|Dual Slider - Range$/){ + for my $answer(@{$self->answers($address)}){ + $answer->{max} = $properties->{max}; + $answer->{min} = $properties->{min}; + $answer->{step} = $properties->{step}; + } + } +} + =head2 insertObject ( $object, $address ) Rearrange existing objects in the current data structure.