Custom drag and drop - return item to start not working
Apr 15, 2015
I've created a freeform drag and drop which I'm having trouble getting the "spring back" function to work. I want incorrect drag itemsto return to their original position if they are dropped onto the wrong drop target. I have 17 drag items and two drop targets. Each drag item is assigned to only one of the two targets. Here are some of my settings:
- return item to start point if dropped outside a correct drop target (all other boxes in the options popup are unchecked (SL2)).
- feedback by question
- no shuffle
- no results slide
- score by question
- unlimited attempts
I do have triggers assigned to each drag item: "show layer foo, when user drops a shape on foobar" (there are 17 different feedback layers) and "change state of foo to hidden when user drops a shape on foobar" (wanting the drag item to disappear from view once the user drops it onto the correct drop target). One of the drop targets is off the canvas so half of the drag items are assigned to it as correct. That means that half of the drag items should not stick to the incorrect drop target. But they do.
I did a pretty thorough search for a solution to this and couldn't find one. I did find this (https://community.articulate.com/discussions/articulate-storyline/freeform-drag-drop-drag-items-do-not-snap-back) which made me think that part of my problem might be that I added a trigger to a drag item. If that is the problem then how can I work around this?
15 Replies
I created a simplified version of what I'm working on. I tested it before I added any triggers and things were springing back as they should. After adding the triggers for hiding the correct drag items it still worked. After adding the show layer triggers spring was killed.
If triggers and variables cascade then shouldn't the hidden ones (like those found in the DND options menu) fire before any that are added by us?
Hi Michael,
Thanks for sharing your sample file here, and linking to that thread. Changing a state of a drag and drop item or adjusting a variable should still be working with the normal drag and drop options, but if you've set up other custom triggers in terms of showing layers, etc. those will override the drag/drop options and that's why your items are not returning to the original state.
So, Ashley, is there some kind of workaround? I'm certainly not the only person who has tried to do this. It seems a fundamental way to do drag-n-drops. Isn't there any way to have the default triggers fire (snap drag item back) and then fire the custom ones (open layer)? I've racked my brain on this one and have come up short.
Can we create a trigger that fires when an object springs back? Is there some secret variable that I can attach it to?
Hi Michael,
Unfortunately I don't know of any secret variables/triggers that would allow this to happen. Essentially adding in the more customized triggers overrides the built in drag and drop set up. Have you tried setting the layers to be shown based on the state change of the drag items? That may give you a bit more in terms of options, as you could change the state prior to the interaction being submitted (when it's dropped) or delay the state change until it's submitted and then show the layers based on that?
I've spent way too much time on this challenge than I care to admit. But I have been successful at creating a drag and drop that does what I want. I'm going to upload a sample file so that others may benefit from the effort. I included some additional information in the file that should help to explain it further.
Some additional notes:
1. This is a convert to freeform drag-n-drop.
2. In addition to the notes in the file I discovered that you cannot use images for the drag items and have the spring back work as I wanted it to (I create most of my imagery in Photoshop and import). You can, however, start with shapes (like in the example file) and use states to cover them up with your chosen images. To make this clear: you have to start your drag-n-drop interaction with shapes, then add your logic, then change the states with the images you want to use.
If you have any questions feel free to post here.
Hi Michael,
I'm having the exact same problem, but I have more than 2 drop targets and each drop target has a unique layer I want to show when the action was incorrect. Do you know if this would be possible?
Thanks!
Hi Aleksandar! This thread is a bit dated and I'm not sure if Michael is still subscribed. You are welcome to click on his user profile and utilize the 'Contact Me' option to reach out to him directly.
Thanks! I may try that.
Another option
Disclaimer: I am not using the freeform D&D, mine is totally custom, but I was having the same problem with the drag item not snapping back.
That should cause your drag item to snap back to the original position.
Thanks for chiming in to share what works for you Larry.
That could certainly help someone that runs across this thread in the future.
#2 worked for me, but it shouldn't be like that. This is an issue with Storyline. One shouldn't have to create draggable objects using shapes first and then add the images. It should work with images from the start.
Please Articulate, fix this. Thanks!
Hi Oscar!
Happy to help. Can I get a few more details from you?
Why has this issue not been resolved yet? It's been 5 years and it's still not functioning correctly.
Hi Jesse!
This is more of a custom interaction that you can build in Storyline. I did come across this example that will be helpful if you're creating a drag and drop interaction, and want the objects to be reset if the user answers incorrectly.
This discussion is closed. You can start a new discussion or contact Articulate Support.