Is this possible? Random # Generator for Addition Problems with Answers

Hey, friends!

I am *trying* to create a diagnostic assessment in which learners are given a basic addition problem they have to answer. Based on that answer they either "move up" or "move down" in difficulty, with a final amount of correct or incorrect answers telling the teacher where the student is in terms of understanding a specific addition concept.

To make development easier I used random # variables and triggers to generate two random #s - one for the top # and one for the bottom # - for the addition problems. 

The problem I'm running into is that anything a user puts in is counted as correct if it's between #s 1-10. That makes sense because in the "acceptable numeric values" spot in Question Bank Form View I put "Value is Between 1 and 10" and "Answer is correct if Any of the above is true". Obviously that doesn't work because users can answer that 3+2=6 and get a "That's correct!" response since that answer, 6, is between 1-10.

My question is: How do I set up correct answers for random-#-generated addition problems? Is this even possible if the #s are always random? 

Thanks for any insight!

10 Replies
Joe Waddington

I think I solved this! 

I created 4 variables:

  • First Random number
  • Second Random number
  • Sum = 0
  • Student Answer

At the start of the slide, I put triggers to add the first variable and the second variable to the Sum, getting your answer.

I created a text box for the student to enter their answer.

When the student hits the check answer button, I have a trigger that compares Sum to the Student answer, and marks it as right or wrong. 

I've attached the storyline file for you to see.

Hope it helps!

Joe Waddington

2 things going on -

Your text field is set to a text value instead of a numeric value. And you are basing the check on the StudentAnswer, not the variable assigned to the text box you created. 

I had the same problem when I started. You can tell it to compare both Sum and TextEntry, unless both are set as numeric values. Textentry won't even appear in the drop-down selection unless its set as a numeric value.

Heather Vogt

Hmmm...I just copied your original slide; removed the layer; and then moved the check mark, x  and their triggers to the base layer. I didn't make any changes to the variables or text field.

I think I see what you're talking about: "Set StudentAnswer equal to typed value when the control loses focus" is what the original says, but my tweaks says to set TextEntry equal to the typed value". I have no idea how to fix that.

Heather Vogt

Wow. I thought I created this *exactly* the way yours looked, Joe, but I STILL can't get it to work! I keep getting wrong answer feedback when my answer is correct, and the next button I created to move on to the next question doesn't move on either (or it doesn't seem to - I keep getting a repeat of the same addition problem)! I attached a "fresh" project. Thanks for any insight anyone can give me. I do not understand what I'm doing wrong.

Joe Waddington

To answer your first question -

When you create a text entry or number entry box, by default it creates a variable named "text entry" or "Number Entry", and creates a trigger that assigns whatever the user types in that box to that variable.

For this, I created a new variable, StudentAnswer. When I created it, I made sure it was a numeric variable. Then I changed the trigger to assign whatever the student typed in that box to the variable StudentAnswer.

Several of your slides don't have the number entry box assigned to the student answer, and so its marking it as wrong.

Here's what's going on with the last file you attached:

The problem is you are using the same variable over and over, and not resetting the numbers. So it looks like you are getting the same slide... but in reality, you are getting different slides, but the numbers haven't changed. And when you get to the slides where you didn't change number entry box to assign to the studentanswer variable, it counts it as wrong.

There are a couple ways to fix this:

First - you could have different variables for each slide. for example, Question 1 would have Q1Top, Q1Bottom, Q1Sum, and Q1Answer. Question 2 would have Q2Top, Q2Bottom, etc.

This is important if you want articulate to remember the numbers it asked for each question.

If you don't need the keep those numbers, and just want a random generator for the student to practice on, you can reset the numbers with triggers.

Add the following triggers to the slide:

triggers for slide

They have to be in this order, because Storyline manages triggers from top to bottom for each object. Basically, what it is doing is resetting the StudentAnswer and Sum to 0, and randomizing the A1Top and a1Bottom triggers. Then it will add A1Top and A1Bottom to get the new value for Sum.

I hope that made sense and helps you. Let me know if you have any more questions.

Heather Vogt

Joe, I really appreciate the time and energy you're putting into helping me! I appreciate it more than you know.

I don't need Articulate to keep track of the numbers, and I don't want to make a single slide for each of the questions in this diagnostic assessment (that could be a lot of slides!), so would I need to make two slides so there's a next slide to bounce to so the #s in the first trigger have time to reset? If I had a single slide, how would I restart it so the timeline can restart?


Joe Waddington

No problem :)  It makes me think about things, and help me too!

If you just want to keep the information, and this just becomes a practice session for them, then I would change the next question button to jump back the that slide. So if your question slide is 1.1, then the trigger would be Jump to 1.1 when user clicks. I'd probably add an exit or quit button or something that takes them out of the cycle, when they wanted to quit. You could have that button go to a new slide, or just exit out of the course.