Could someone help me on a drag and drop activity (Articulate Storyline 3)?

Hi everyone.

I'm working on an eLearning module in Articulate Storyline 3, and I'm attempting an activity I haven't tried before. It's a drag and drop activity. 

The idea is that there's a "basket" in the centre of the screen, and surrounding said basket are 15 independent objects. The user must click and drag each object into the centre basket. 

The trick is though, some of these items are "prohibited" and will not enter the basket, so in a sense... there are "correct" items to drop in the basket, and then there are "incorrect" items that drop in the basket. I would like a correct message to pop, and an incorrect message to also pop, for every corresponding item dropped into the basket. 

To make it a bit more complex, I want to have a weight capacity as well. Each item has a certain amount of weight to it, and the centre basket itself is 4.0kg (about 8.8 Ibs, but I'm using kg for this). The user cannot exceed 20.0kg (44 Ibs) or else they will get an error message and may have to start over. 

Can anyone provide me with some advice on how to do this? I have figured out the drag/drop interactivity, I'm just trying to add the above complexities into it.

Thank you all.


21 Replies
Allison LaMotte

Hi Craig,

This sounds totally doable!

For the correct/incorrect messages, I would use drop-and-drop states, which are explained in this article. You can also change the drag-and-drop options so that the objects are returned to the start point if they're dropped in the incorrect target. Find out more about that here

For the weight part of things, it sounds like you'll need to use variables. This is what I would try:

  • create a numeric variable for the total weight with an initial value of 0
  • create a numeric variable for each object with an initial value that is equal to the weight of that object
  • add a trigger for each object that adds the value of the associated variable to the total weight variable when the object is dragged over the drop target
  • create a layer that shows the "too heavy" error message
  • add a trigger to show the error message when the total weight variable is more than the total allowed weight

I hope that makes sense! Let me know if you run into any issues. 

Craig Brown

Hi Allison, thank you so much for your reply.

Your response makes total sense, and adding variables was easy, but it's not... quite doing what I want. I'm not sure what I'm doing wrong. 

I've added in all the numbers in terms of weight, but how do I add a variable to objects? Like... when I drag and drop say, Item 1, which has a numerical value of 1.9, my total count thing doesn't go up as intended? 

Craig Brown

Hi Allison. I'll show you what I've done so far:

Here's what I'm looking to do...

On the third slide (the 'Your Kit' activity), there are 14 objects surrounding the major object in the centre. Each object in the surrounding circle, from 2 to 14, all need to have a designated variable number. For example, item number two has a variable value of 1.9.

Every time the user clicks and drags one of these icons into the centre red bag, I want the number in the centre to increase, from 4 onward (the initial red bag itself is 4.0kg). So for example, if I drag item two into the centre red bag, the value will rise from 4, becoming 5.9 (4 + 1.9). 

If the user makes the number exceed 20kg, then I want the hidden "Too much weight" layer to appear.

What do you think? 

Craig Brown

Okay, so I managed to figure out the number adding. It's all working now. I had to change the variable name of the total weight mechanic, adding some symbols onto it, e.g. %TotalWeight% - now it works. 

The next problem I'm encountering is that I want the error layer to appear, when the total weight number exceeds 20.0 (so if it hits 20.1) but... I'm unsure how to do that. I thought I could make a trigger but it's not quite working as planned. 

I fear I may have to update the trigger/variable so that the error message triggers when the -exact- numbers appear on screen? 

Craig Brown

I have encountered a new issue. 

When I click on my "Repack" button, the idea is that the slide resets. However, rather than return to the starting variable number of 4, my centre red bag icon retains the previous variable number.

So let's say I throw a bunch of stuff in there and for some reason, decide to press "Repack" at 15. When the slide resets, instead of being at 4, the centre weight number will be 15. 

Where could I be going wrong? 

Craig Brown

Actually, nevermind! 

Phil, you are a Goddamn legend. A gentleman and a scholar.

I played around with the variable fields and finally found the "greater than" field, and it works! YEEEEEEEEEEEEEES!

Thank you Phil, and thank you Allison! I will try to convince my partner that if we ever have children, we are naming them after you guys, haha. :) 

Sorry, it's 2:13 AM and I'm working on my project... so I am SUPER happy right now. 

Craig Brown

Hi guys, so uh... I have a new problem. Yay.

In my above activity, the user needs to click, drag and drop items from the items around the outside, into the primary item on the inside. 

If the user drags in too many items, they will be forced to repack. Alternatively, they can choose a repack option at any time. "Repack" essentially means the slide starts over.

If the user drag/drops the appropriate items, a Next button on another layer will appear.

However, I have noticed that if the user immediately clicks on Repack, or is forced to repack, then the Next button will suddenly appear without the requirements of dragging/dropping the appropriate items.

How can I make the repack button restart the slide as it was? With no Repack button appearing until its supposed to? 

Allison LaMotte

Hi Craig,

I was able to download your file, thanks :) Just wanted to point out that there's actually a built-in an "add attachment" button to comments (see the bottom lefthand side of the comment box), so next time you don't need to upload it to onedrive.

I'm looking at your file, and I see what you mean. It looks like you'll probably need to add a condition to this trigger, but I'm not sure which one since I'm not sure when you want the next button to appear. Does that make sense? If you tell me more about when you'd like it to appear, I can help try and figure out what condition may work.

Craig Brown

Hi Allison,

Ah, I totally missed that, but thank you for letting me know. 

In regards to the activity, there are five out of 14 items that will allow the user to reveal the next button so that they can progress. I will list them down below by number and name: 

2 - Food and Drink
5 - Stationery
8 - Sleeping Equipment
9 - Toiletries and Sanitation
11 - Personal Protective Equipment 

Once these five items have been clicked/dragged and dropped into the centre red bag, the next button layer will be revealed and will allow the user to progress. 

If the user wants to, they have to option of starting this activity again by clicking on the 'Repack?' button. If the user throws too many items in the bag (and thus the variable number under the bag exceeds over 20), then a layer with a message will appear, forcing the user to repack.

This is where I've run into my latest problem. If the user clicks on the 'Repack?' button by choice, or they packed too many items in the bag and are forced to repack, they will click the button, which will essentially restart the slide... but for some reason, the Next button will appear regardless if they click Repack, and I don't understand why. I hope this makes sense.

Basically, the Next button should only appear when the minimum five items above are packed into the bag. I don't know why it's appearing when the Repack? button is clicked.

Allison LaMotte

Hi Craig,

I'm not sure why the Next button was showing up even when you clicked on the repack button right away without touching the drag items, but it does seem to be fixed now that I added conditions to the trigger I mentioned in my previous comment. I've attached my version of the file. Can you have a look and see if it's working as expected on your end?

Allison LaMotte

You're welcome! :) So glad it's working. I added some conditions to the trigger that opens the Next layer. Before, it said to show the layer if the state of those 5 objects was Hidden and I added onto to that to say that it should only do that if the state of all the other objects was Normal. I'm not entirely sure why that solved the problem, since I don't think all those objects were hidden before when the Next button was appearing, but I'm glad it worked!