Demo: Basic Dropdown-Selection for Online and Offline Experiments

Hi again,
just sharing another little sub-project, I am currently using in my experiments.
I was trying to make a simple dropdown selection menu in the past. Yesterday, I had time to write up a small minimal example that has only a single code component and a mouse-Component (non-routine-ending) to make it work. Especially, all code is written with Auto-JS-Conversion allowing us to use it Offline and Online.
If someone likes to add documentation/more parameters for the Dropdown-Generation, please make a PR in Gitlab. File an issue if there is any code related error.
For now just change the following part in the Code-Component and use the text-value of the baseItem after the routine as you like (currently it is just added to the data-output).

 itemsDD = ["Hello", "World", "Top", "Test", "New"];

If you have more or longer items you have to change the Generation-functions to e.g. fit your values.
For now it’s a basic solution for choosing between a few items.

Maybe some features should be added like “Pagination” or Scroll-Logic but maybe this code-snippet gives a good starting point for more complex Dropdown-Components.

Demo: dropdownOfflineOnline [PsychoPy] (PsychoPy-Builder v2022.1.1)
Gitlab: Luke Boelling / dropdownOnlineOffline · GitLab (PsychoPy-Builder v2022.1.1)

1 Like