Forum Discussion
Drag and Drop Issue - How to disable drop targets
I’ve been struggling with this drag and drop issue for a while. I’ve been scouring the E-Learning Heroes and other parts of the interwebs for solutions. In this thread and others are snippets of suggestions and advise but I’ve yet to be able to find a comprehensive example build. So I made one. Hopefully this helps someone. Below is an (hopefully clear) explanation of the steps I took to create a drag and drop exercise that won’t allow you to drop multiple drops on the same target and won’t allow drops to be moved once they are dropped. The story file is attached so you can download and see all the triggers.
I created a Variable for each Drop Box Target, “Box1Variable”, “Box2Variable”, etc
Add 1 to each Box Variable when any Shape is dropped in. This means you have to create a trigger for all 3 shapes to adjust the variable in all 3 boxes. (9 total triggers to accomplish this)
Created a “Deleted” State for each Box by creating a new state, named it “Deleted”, then actually deleted the box from the slide in that state. When the Box Variable for a given box is ≥ 1, it triggers the Deleted state. This leaves the shape that was dropped there, where it is, but won’t allow another shape to be dropped on top of it.
Created Slide Layers “Cover 1”, “Cover 2”, “Cover 3”. Each layer has a square Shape on it with a background color of grey at 80% opaque that covers the corresponding box on each slide. So the cover shape on “Cover 1” Layer covers the Box 1 Drop Target. They are each triggered to show when the corresponding Box Variable is ≥ 1. This prevents the user from clicking and dragging the Shape that was placed in the Box, around on the screen.
Submit Button default is set to “Disabled” state. When all 3 Box Variables are ≥ 1, the Submit Button changes to “Normal” state and can be clicked on.
Created “CorrectVariable” variable, which has 1 added every time the correct Shape is dropped on the correct Box. No points are added when an incorrect shape is dropped on a box. i.e. +1 when Shape 1 dropped on Box 1, but +0 when Shape 1 dropped on Box 2.
When user clicks Submit and CorrectVariable = 3, “Correct” feedback Layer is shown. When user clicks Submit and CorrectVariable < 3 then “Incorrect” feedback Layer is shown.
For reference, I’ve also included a Variable Reference box next to each Box that corresponds to the Variable for that Box, and a Variable Reference box next to the Submit button that corresponds to the CorrectVariable, so you can see how placing correct vs incorrect shapes on boxes causes the variables to change or not change. The reference variable text boxes are not necessary to the project in any way.
Each Feedback Layer has a “Back” button that will take you back and reset the slide to the initial state so you can play with the Correct and Incorrect features and watch the Variables change with different attempts.