Forum Discussion
Drag and Drop With Feedback Layers BUT NOT Correct or Incorrect
- 22 days ago
Although ThierryEMMANUEL has figured out a solution, I would still like to try a simpler version without using a tons of triggers.
I use the built‑in drag‑and‑drop function so that objects can return to the start area when a target is occupied. I also prefer using "state" for counting the TotalPlaced value and rely on two triggers to change the state.
What the built‑in model cannot change is that when another item is dropped on the same target, the original item still remains in the "placed" state even after returning to its initial position. Since this is the only issue in my solution, I thought—why not use the new AI assistant to solve the problem? Below is the prompt I gave the AI assistant, and it worked as expected. A single JavaScript snippet solved it.
Change the state of crit# to normal when they moves onto hotspot1 area. For example, change crit9 to normal when it moves onto hotspot1.
Here is my version3. As Nedim said, I also value discussions like this and gracful learn something from each other. Thank you!
Thank you very much for continuing to update your work JoanneChen (unfortunately, I feel like I'm the only one who noticed...). I checked your demo and, not quite, there's still a small problem 🙂. If I move a proposition (for example, number 2 in the screenshot) and then move it back to the starting area because I changed my mind (which is more “normal” behavior than what I did in my previous response), the “Total Placed” counter remains at 1 even though the drop zone is empty. I can do this four times in a row with four different proposals and set the “Total Placed” to 4 and get the Next button...
Hi ThierryEMMANUEL,
Thanks for checking! I realized I hadn’t uploaded my second version of the file. In this version, users can change their mind and move the item back to the start zone without affecting the counter.
I also took a look at your file—well done! You used a different approach and really nailed it.
- Nedim23 days agoCommunity Member
Hi JoanneChen
If the user moves an item back to the start zone in a certain way and then places it back into a drop zone, it can mess up the actual number of items in the drop zones, but the calculated number may still display correctly for validating the interaction. It’s obvious that a previously dropped object does not revert to its Normal state when it is removed from the drop zone, either because it was bumped by another dragged object or moved back by the user.- JoanneChen21 days agoSuper Hero
Hi Nedim,
Thank you for checking my file and pointing out the issue. I didn’t notice that it would remain in the "placed" state or switch to "drop-incorrect" when a user drops items outside the targets. Rather than trying to find a workaround using built‑in feature triggers, I decided to use the new AI assistant to solve the problem. And it beatifully solve the issue with a simple JS code! Love it!- Nedim21 days agoCommunity Member
Hi JoanneChen
Your solution is a clear winner. I don’t have the AI Assistant included in my subscription, but I never would have expected an AI assistant to come up with such a solid solution. It certainly saves a lot of time and eliminates the need to create a large number of triggers to achieve the same result.Inspired by your approach, I experimented with running this interaction almost entirely with JavaScript. I only used triggers when showing layers though I’m pretty sure even that could be handled with JS if you really wanted but, sometimes you have to know when to stop 🙂.
That said, I’m not suggesting this as a ready-made solution. Especially for someone just starting with Articulate. It’s important to first learn the basics of Storyline, including triggers and the logic we develop using our own reasoning, before applying JavaScript shortcuts.
Related Content
- 4 months ago