Skip to content

Slider Block

The slider block provides the ability to present the participant with a slider response. A slider block has to be specified within a response block. The structure of this block is summarised below.

Parameters

steps
Optional, defaults to 5.
Integer that specifies the number of steps the slider uses. This value must be 2 or higher. It can also be set to the Keyword INFINITY to indicate a continuous slider.
initial_value
Optional, defaults to the middle point.
Integer that specifies the starting point of the slider. This value must be between 1 and the amount of steps used, or, if the slider is continuous, a percentage between 0% and 100%.
labels
Optional.
List of exactly two Strings that specify the text presented on the left and right side of the slider.
show_value
Optional, defaults to false.
Boolean that controls whether the current slider value is shown beneath the slider as a value between 0 (left) and 100 (right).

Example usage

The code below illustrates how the slider block might be used.

experiment {
    trial {
        stimulus {
            text = "Strawberry cake is tasty!"
        }
        response {
            slider {
                steps = 6
                initial_value = 1
                labels = ["Completely disagree", "Completely agree"]
                show_value = true
            }
            button
        }
    }
}
Back to top