Forum Discussion
Drag & Drop: Only continue, if all have been dropped on targets
Hi - I know this thread is 4 years old but I came across the same problem and had to design a solution. Thinking laterally - rather than testing to see if the items are all intersecting targets, how about testing if any items are left where they were at their home positions?
Works really well.
So - my situation is this. I have three items in the lower half of the screen and three targets in the top half of the screen. I want to make sure the learner has dragged all three items onto a target before they can "Submit"
I set the Drag and Drop Options to "Return item to start point if dropped outside any target". So I know each item is either on a target OR it is in its start position.
I also want a sound to play when the Submit button is clicked (but this is optional).
I have a hotspot off screen. On clicking the Submit Button I set a variable "AtHome" to false and move the hotspot along a motion path that covers the bottom half of the screen. The submit button then plays Audio 1 (the button click)
I have a trigger that AtHome is set to true if the hotspot intersects with any of the three items.
When Audio 1 completes, I move the hotspot back along a motion path taking it back off screen and Submit the Drag and Drop Interaction - but ONLY if AtHome is false
So the Triggers look like this:
When the user clicks Submit
Set AtHome = value false
Move Hotspot 1 along a line Motion Path 1
Play audio Audio 1
When Audio 1 completes
Move Hotspot 1 along a line Motion Path 2
Submit Drag and Drop 1 if AtHome = value false
This works for me.... The button clicks but nothing happens if ALL items have not been dragged and dropped. If the user drags an item drops it and then drags it back - still works.
If I allow a second attempt - still works!! No extra triggers required.
Related Content
- 6 months ago
- 3 months ago
- 8 months ago