Forum Discussion
Storyline Drag-Drop "Allow only one item..." won't be recognized by intersecting-check
I see this discussion is a couple of years old - is there a feature solution to this? I also want to disable the Submit button on a drag and drop until ALL draggable items have been place on a target (correct or incorrect).
AND I'm only allowing one item per target.
I saw several related discussions about this kind of issue and thought I would try a slightly different approach. Instead of checking if the draggable items intersected with the targets I thought I would check if any were left where they started (I set return to original position if dragged outside a target).
So when the Submit button is clicked I move a hotspot over the area where the draggable items started and set a variable to true if the hotspot intersects with any of the items. If true the Submit button doesn't operate, I then reset the variable to false and move the hotspot back. That works pretty well. You have to have all the items on targets to be able to submit...
It even works for me on "Try Again" with no extra code. But I'm always looking for a more elegant solution.
Hi John,
This is an elegant enough solution, and very sneaky.
I've got the hotspot test working, but how do I delay the implementation of the submit/next slide until after the test is completed? The slide moves on before the variable is updated to prevent it.
- IanBuxton-46cc53 months agoCommunity Member
As an side line on this, John's solution of moving the hotspot off screen and then reintroducing it to test for intersections is good. However I found that when an object is off screen it can still intersect with an object that is being moved around by the user if part of that object moves off screen as well and touches the hotspot.
My solution was to move the hotspot far enough away so no intersection is possible while the user plays. I also considered deactivating the hotspot when off screen but this doesn't appear to affect it as an intersection object, so moving it far was the way I chose.
Related Content
- 10 months ago