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!
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!
- ThierryEMMANUEL22 days agoCommunity Member
I love this team effort!!! 😁 Obviously, the JS code does the job very efficiently JoanneChen.
“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.” was my kryptonite. That's why I looked for a workaround (with lots of triggers). Well done!
And I'm learning from your prompt how to better talk to the AI thingy.
- ELOUPEI21 days agoCommunity Member
JoanneChen ThierryEMMANUEL Nedim Thank you for the help thus far. I've tried to follow along with this conversation as best I could. I've used JoanneChen's V3 file as the solution for my project.
However, there's more to fix that I need assistance with...
The interaction is a build-your-own rubric and the user can choose between an analytic rubric template or a single-point rubric template. That is what the slider at the top of the slide is there for. The user can toggle the slider (which activates a jump to slide trigger that moves the user between the two different rubric templates).
The problem: When I toggle the slider from Analytic to Single-Point, the slide does change correctly BUT the slider does something unexpected. Instead of the button now positioning under Single-Point, it jumps back to position under Analytic. I am looking at the Single-Point rubric template slide but the slider button suggests I am on the Analytic rubric template slide. If I want to go back to the Analytic rubric template slide, I first have to drag the slider button back over to Single-Point and then toggle back to Analytic, at which point the trigger fires properly and I jump back to the Analytic rubric template slide.
What am I missing to get the slider button to stay at the correct end of the slider for what's showing on the screen?
- ThierryEMMANUEL21 days agoCommunity Member
Hi ELOUPEI As I said, it was a team effort that I really enjoyed participating in with JoanneChen and Nedim . Your demo works as expected, I think. And in the end, Joanne wins the gold medal. Congratulations! She deserves a “solved.”
Fortunately, your slider problem is super easy to solve. Take a look at the re-re-modified demo (only on the slider).
Since you have two slides, you have two sliders with two different associated variables (slider3 and slider32). Changing the value of slider3 from 0 to 1 (which jumps to another slide) has NO effect on the slider32 variable, which is set to 1 by default. You have to slide it to O to return to the first slide, where slider3 is still at 1. You have to bring it back to 0, then to 1 to jump to the second slide. Where slider32 is still 0. You have to bring it back to 1, then to 0. Hence the problem.
Solution: a single variable for both sliders. It could be slider3 or slider32, but I chose another name for clarity (and I deleted the variables slide3 and slider32 to clean up the variable table). When you slide the first slider to 1, you jump to the second slide where the same slider variable is already at 1. You slide it to 0, return to the first slide, where the variable is already 0. And so on.
Related Content
- 4 months ago