variables, triggers, drag and drop

Jul 16, 2014

I am doing a freeform drag and drop. I have 2 drop boxes and 10 items to drag. In each of the boxes there may be one or more correct answers. I am trying to total the correct answers. If I have 3 out of 4 correct answers I want to get the correct amount of points. I have assigned a value of 0 to a variable called Total. I have added a trigger to add 1 to total when he user drops a shape on the correct drop box. But when I go to the results slide I don't have any totals for anything. Maybe I'm not showing the correct thing on the results slide. Help please. Thanks

5 Replies
Robert Lengacher

Jean, The results slide pulls the total number of points earned automatically as shown in this image from the Drag and Drop Question Wizard. Other types of items sometimes allow points per item, but I don't think that's an option with Drag and Drop - Freeform.

I think you could achieve what you want by doing the following:

  1. Design your Drag and Drop interaction as you like.
  2. Create a variable (Total) to tally up the number of correct points for this item based on how many items are dropped correctly.
  3. Insert a Results Slide
  4. In the Edit Results Slide dialog, deselect the drag and drop interaction so that it will not be included in the results
  5. Create a new variable called ResultPlusDragAndDrop or something like that.
  6. On the Results slide Insert a new textbox.
  7. In the new text box insert a Variable reference to display the value of ResultPlusDragAndDrop.
  8. Insert 2 new triggers to Adjust the variable ResultPlusDragAndDrop
  9. Trigger 1 add the value of Variable Results.ScorePoints (the default results score variable) when the timeline starts on the results slide.
  10. Trigger 2 would add the value of Variable Total (from the Drag and Drop slide) when the timeline starts on the results slide.
  11. Then you could move (NOT delete) the text box containing the Results.ScorePoints variable reference off screen and move the text box with the reference to ResultPlusDragAndDrop into its place to show the new combined total points.
  12. You would also need to use a similar method to create a new percent variable that is adjusted based on the default number of points plus the 4 points from the Drag and Drop slide.

This would get really unwieldy if you did this type of thing for multiple slides, but might be worth it in your case.

Robert Lengacher

Hi Jean - To get what you want, as I understand it, you'll have to do a little math.

  1. Find the total number of Correct points that the user can score. To do this you'll add all of the points from normal interactions, like the image in my last post and any additional items that you set up manually. For example, let's say that you have 6 normal interactions with the correct points set to 2 points each and 1 additional drag-and-drop worth up to 4 points (like the one you described in your original post), then it would be 6*2+4=16 total points.
  2. Divide that sum by 100. So in our example, you would now have 0.16
  3. Create a new number variable called totalPercent or something like that.
  4. Then on the results slide, add two triggers immediately AFTER the two triggers I recommended in my first post.
  5. Trigger 3: Adjust variable totalPercent equal to the value of resultsPlusDragAndDrop when the slide timeline starts
  6. Trigger 4: Adjust variable totalPercent to divide by the value found in step 2 (In my example it's 0.16) when the slide timeline starts
  7. On the results slide, create a textbox and insert a variable reference to show the value of totalPercent and type a % symbol after the reference.
  8. That should work.

I have attached a quick and very ugly .story file illustrating the combination of both my posts. The thing works, but there are a couple of issues with mine that you should note:

  • My Drag and Drop Interaction on slide is not designed very carefully, so a user could drop B blocks on A and not be penalized. Also, by dropping A blocks on the A target multiple times, they could game the system and get a total far higher than just 4 points (I believe).
  • You may have to tweak some of the other variables and triggers that show the Success and Failure layers on the results slide, because they are based on the automated variable values, not your custom variable values.

Let me know how this works.

Ramona Meyer

Thank you, Robert, for you detailed explanation, but especially for your sample file.  Once I was able to get in there and play around in the file, I was finally able to figure it out (although it admittedly took me some time).

However, I'm assuming with these changes, we cannot have the LMS track the completion results by the results slide, correct?  

I did find some code in another thread (https://community.articulate.com/discussions/articulate-storyline/is-there-a-way-to-score-each-individual-match-of-a-drag-and-drop) for a workaround, but it didn't look like it'd been tested and confirmed within the thread by others:

In story.html file,
ResizeBrowser(g_strBrowserSize);
var player = GetPlayer() <


In lms/SCORMFunctions.js (SCORM 1.2)
function SCORM_SetScore(intScore, intMaxScore, intMinScore){
intScore = parent.scormdriver_content.player.GetVar("MyScore") <

While it's on my list to learn, I don't know any javascript at this point.  Does anyone know if this code would work?  Anything specific I'd need to switch out to reference my variables I created for the partial scoring drag and drop?

Thanks!

This discussion is closed. You can start a new discussion or contact Articulate Support.