Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Behavior change for numericalmultiple Slider (PHP version Upgrade)

  • katcher01
  • katcher01's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 6 months ago #158962 by katcher01
Hello,

Since we have upgraded our PHP version on our test server, the slider behavior for default 0 or null has changed. If a user left the default slider value empty and the scale was from 0-x it would start at 0. This behavior appears to have changed.
An existing survey used scale 0-100 but left the default empty. The observed behavior was the slider began at 5. If the user set the default to 0 (zero) it still started at 5. The test for empty changed between versions. In order for me to maintain the same behavior on exiting surveys I was proposing the following modification. Is this valid? I do think there is a bug in the slider test code.

Assumptions as per file comments


//the complicated default slider setting will be simplified header_remove
//Three cases:
// 1: posted value safed
// 2: default value set
// 3: slider starts in middle position

$sliderStart = 'null';
if($dispVal) //posted value => higest priority
{
$sliderStart = $dispVal;
}
else if($slider_default != "") //Mod Default value set including 0 (zero)
{
$sliderStart = $slider_default;
}
else if ($slider_default == "" && $slider_middlestart!=1) { // Mod default not set and not slider middle
$sliderStart = $slider_min;
}
else if($slider_middlestart==1) //
{
$sliderStart = intval(($slider_max + $slider_min)/2);
}


This Kludge is not perfect as there may be some other checks - what if default value is less than or greater than the min or max?

Please comment.

Eric
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
6 years 6 months ago #159005 by LouisGac
Thank you for reporting. Could you please open a bug report, with a small survey to reproduce the bug?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose