Custom drag and drop - return item to start not working

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
Michael Shannon

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?

Ashley Terwilliger

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. 

Michael Shannon

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. 

Ashley Terwilliger

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? 

Michael Shannon

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. 

Larry Pickle

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.

  • Add a motion path of  Size: W = 0  Height = 0 to the drag item
  • Move drag item on that motion path when it is dropped on the incorrect target

That should cause your drag item to snap back to the original position.