Forum Discussion
Matching drag and drop activity
Hi, I am trying to create a drag and drop activity that mimics the functionality of the built in matching drag and drop activity, but is more flexible. I don't want the boxes on the right to be the same size as the boxes on the left as I want to match up definitions and extended answers.
What I do like about the in built version is that if you drop an answer where there already one it moves the existing one into the empty slot, as in the second image. Whereas on my version I don't know how to do that, so when I drag one into my drop target it sits behind the existing one, as in the first image.
I have attached the file - if anyone is able to take a look and see how I can do this I would be really grateful.
7 Replies
- AndrewBlemings-Community Member
Because the target boxes are so small, the free answer that's hiding the dropped one doesn't move into an empty slot because it's not on the target. In the built-in method, answers can compete for the targets but in your custom version, the answer choice on the right isn't on the target:
As far as the free answer is concerned, it's on its own starting point, not a target, so there's nothing for it to get out of the way of.
There are probably a few ways of rigging up a solution, including some with JavaScript, but I think the easiest workaround would be to have all of the answer choices stacked together so that none of them are near the targets in the first place. The learner can then drag the top one to a target, revealing the second in the pile, and when that drag that one the third one will show. If they remove or replace one of them, it'll return to its origin, the pile.
Either that or a bucket of triggers, or a single JavaScript trigger to essentially replace and condense the logic the other triggers would use to check which spot is empty and move the now-free answer to it.
- JoC62Community Member
Thanks I have done other ones in the way that you describe, I was just hoping that there was a way to mirror the built in functionality. It's a shame that we can't resize the boxes on the built in version as that would be so much better!
Hello JoC62,
Thanks for sharing your insight with us. We understand that you'd like the ability to create more flexible matching activities with differently sized matching areas while keeping the convenient swap behavior that's available in the built-in interactions in Storyline 360.
We've shared this feedback with our product team so they know what matters most to you when designing custom drag-and-drop experiences in Storyline.
Have a great weekend!
- DShawCommunity Member
JoC62β a fix that might work for you in your second problem in your version, in the drag and drop options (Format tab > Drag and Drop), tick "Return item to start point if dropped outside a targetβ Combine this with "Only one item per drop target"
This means a slot can't be double-occupied so the second item bounces back to its origin. It's not a true swap (the user has to consciously drag the first item away first), but it prevents the "sitting behind" problem. You could do it with triggers but that would be a lot of triggers π¬. If I were doing it Iβd use Javascript
- JoC62Community Member
Thank you! That does solve part of the problem. I'm not confident using Javascript unfortunately as that would definitely be the easiest solution.
- DShawCommunity Member
JoC62β I've created and ran a script in Rise that you should be able to use to build what you want; as long as I understood your requirement exactly! Here's what to do:
In the builder
- Design your activity (add items, set colours, sizes, etc.)
- Click Copy HTML button
Create the HTML file
- Open Notepad (Windows) or TextEdit (Mac)
- On Mac, also go to Format β Make Plain Text (Cmd+Shift+T) so it doesn't save as RTF
- Press Ctrl+V (or Cmd+V on Mac) to paste the HTML
- Save the file:
- File β Save As
- Filename: index.html (this exact name matters β Storyline looks for it)
- Save as type dropdown: change from "Text Documents" to "All Files"
- Save it somewhere you'll find it β e.g. Desktop
Put it in a folder
- Create a new folder, e.g. Desktop/dragdrop-activity
- Move your index.html into that folder
So you should have: Desktop/dragdrop-activity/index.html
Insert into Storyline
- Open Storyline and go to the slide where you want the activity
- Top ribbon: Insert tab β click Web Object
- In the Address field, click the small folder icon at the right
- Browse to and select the FOLDER (dragdrop-activity) β not the file itself
- In the dialog:
- "Display in slide" β selected (don't pick "new browser window")
- Click OK
- A grey placeholder rectangle appears on the slide. Drag its corners to size and position it where you want the activity to show
You won't be able to view the interaction in the web object until you publish
https://share.articulate.com/i2cyT-u4hHgZUzGx7mnAW
Related Content
- 10 months ago
- 1 year ago
- 1 year ago