Drag & Drop: Only continue, if all have been dropped on targets
Apr 07, 2017
Hello, we have the goal:
- The user has 8 drag items.
- He must drop all 8 onto the 5 targets, no matter if they're dropped correctly.
- Only then he is allowed to continue and "submit" his answer
- If not, pressing the submit button will display a reminder message (eg "Please drop all items before submitting")
Problem is:
We can't figure out how to do this yet.
We tried to use the states of the drag-items for this, doesn't work as the user might drag some back out of the targets and then they already have a dropped correct/incorrect state.
We tried to use the state "normal" of the drag items (items not dropped already) to display the reminder message and not submit, before all items aren't "normal" anymore. This seems not to work either. We hoped it would.
Next, we're trying around with SL360's intersection trigger...
Can anyone point us in the right direction and had a similar problem?
Thanks! We're close to a deadline and this has just come up.
See mockup in attachment for the setup.
8 Replies
Hello Beren!
I've seen a few similar questions in the forums before like this one and this one, so hopefully those will get you started in the right direction. I also invite folks in the community to share their ideas, as well!
I believe this sample will be especially helpful with how to handle objects being dragged off the target.
Walt, thank you. The solution you proposed almost worked. We built it up as proposed in your file, but sadly it is with some fast dragging and dropping possible to:
Any ideas?
Alyssa, thank you, we will try the other solutions now, but we need to figure out something reliable. "Inactive Submit button till all drop items are dropped" has the same issue, "Trigger for when all items have been dropped?" doesn't include the fact that users can drag the items out of their targets and re-set them (as far as I can tell).
Additional:
If that area/shape is removed, drop and drag works just fine.
Can someone please confirm?
Is there a way around that -- something to 100% recognize if items aren't on their drop targets, or dragged out again?
Thanks.
Update:
I got it to work by
(yes both intersect checks are needed for a reliable result, otherwise fast-dragging will cause problems)
Disadvantages:
I'd wish for an easier more reliable solution in the future. Like using (new) states of the drag-drop items ("dropped" e.g. and "not dropped").
Wow, Beren you were busy this weekend! I'm glad you were able to find a solution that worked for you, albeit not the easiest solution! I know it's something that there have been a few workarounds shared for before, but it's always a good idea to let us know if that makes more sense as a built in feature as well. We use the feedback to help drive our product roadmap, and you can always send along feature requests here.
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.
John,
Elegant solution. Well done.