I want to create a forced choice without having two experiments as discussed in the forum and demonstrated in the tutorial. I want simply that, for those who choose option 3 (opt-out), there would follow-up in the same page a single choice question requesting a choice.
How can I write up the question display condition?
Without using fancy javascript - you need to put the followup question on the following page. This is because data is only stored on the backend after each ‘next’. To use this data in a condition you need to retrieve the saved data.
Nevertheless this is technically possible in Javascript - likely Claude or ChatGPT can help with the actual code.
Here’s what I would do.
Put in the forced question - call it ‘forced’
Then add a text element and convert it to html code with the </> button.
You would then place some javascript in
With some assumptions (1 DCE per page, 3 alternatives, 3rd alt is opt out, forced question is called ‘forced’)
Here is the pseudo code.
Add a default hidden form value that will save a non-empty value unless they choose opt out - here we code this 999.
Hide the ‘forced’ question element - which in this example has a generated id =“se_item_forced”
If they click the third alternative (class = “se_choice_element”, alt=“opt3”)
then display the question above but remove the detault hidden
This is tested and works - but you should just use this an example and adapt.