Arrange buttons in a grid with each button in an individual cell #2816
jaimielee97
started this conversation in
General
Replies: 1 comment 1 reply
-
I think you are seeing all 144 buttons within each square because you have three for-loops in the button-response-grid plugin:
As these are nested in each other, it makes sense that you are drawing all 144 buttons within each table cell. I think you have to remove the for-loop with and calculate the value of i based on the row and column index:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm trying to create a 12x12 interactive grid, where every square is a clickable image/choice. I have tried combining the html-button-response plugin with the vsl-grid-scene plugin to create this, however, the way I have done this places all 144 button images in each square [e.g., 144 buttons in (0,0), 144 buttons in (0,1) and so on]. Instead, I want just one button per grid cell, and for each button to have a unique number identifying it so I can correctly register which button participants have clicked on when recording their data.response.
I've copied in the code from my modified jspsych-html-button-response plugin (v 6.3).
I'm pretty new to jsPysch so any advice would be greatly appreciated, thank you!
And here is the code from the index file where I reference the custom plugin (also in v 6.3). The images are just white squares that turn grey on click.
`
Beta Was this translation helpful? Give feedback.
All reactions