Forum Discussion

NetwireGlobal-b's avatar
NetwireGlobal-b
Community Member
9 days ago
Solved

Prevent user from selecting more than one shape in a column

I'm creating an interaction that is a grid which will show the student a specific result depending on the number of cells they select in a row.

If they select more shapes in the first row than in the second or third, they will see Result 1. If they select more shapes in the second row than in the first or third, they will see Result 2, and if they select more in the third row than in the second or first, they will see Result 3. I managed to complete this part using multiple counting variables and states.

What I would like to do now is to prevent the user from selecting more than one cell in the same COLUMN.

ResultsColumn AColumn BColumn CColumn DColumn E
1YesNoNoNoNo
2NoYesNoNoNo
3NoNoYesYesYes

What I want to show with the table above is that there can only be one Yes (selected shape) in each column. If the user tries to select more than one shape in the column, an alert should show on the screen.

The screenshot attached shows 5 columns highlighted in green with only one option selected (orange) and one column highlighted in red with two options selected. This is what I want to prevent.

Does anyone know how I can achieve this? Thanks!