Skip to content

survey plugin: minWidth parameter doesn't work? #3564

@DominiqueMakowski

Description

@DominiqueMakowski

@becky-gilbert you kindly said to report any issues so I am 🙈

The surveyjs builder has a parameter to adjust the slider width:

Image

However, when I changed it it doesn't seem to change:

Image

Here's the MWE:

<!DOCTYPE html>
<html>
    <head>
        <!-- Title shown in tab -->
        <title>Minimal Example</title>

        <!-- Load JsPsych -->
        <script src="https://unpkg.com/jspsych"></script>
        <link href="https://unpkg.com/jspsych/css/jspsych.css" rel="stylesheet" type="text/css" />

        <!-- Survey  -->
        <script src="https://unpkg.com/@jspsych/[email protected]"></script>
        <link rel="stylesheet" href="https://unpkg.com/@jspsych/[email protected]/css/survey.css" />
    </head>

    <body></body>

    <script>
        // Initialize experiment =================================================
        var timeline = []

        var jsPsych = initJsPsych({
            on_finish: function () {
                jsPsych.data.displayData("json") // Display data in browser
            },
        })

        // Timeline -------------------------------------------------------------------
        var default_scale = {
            type: jsPsychSurvey,
            survey_json: {
                showQuestionNumbers: false,
                pages: [
                    {
                        elements: [
                            {
                                type: "slider",
                                title: "Default Slider",
                                isRequired: false,
                            },
                            {
                                type: "slider",
                                title: "Wide Slider",
                                isRequired: false,
                                minWidth: "1000px", // Set the width of the slider
                                maxWidth: "1000px", // Set the maximum width of the slider
                            },
                        ],
                    },
                ],
            },
        }
        timeline.push(default_scale)

        //  Run the timeline =====================================================
        jsPsych.run(timeline)
    </script>
</html>

How to make the questions wider?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions