How can I make states change when two variables are equal?

Dec 20, 2012

I may be approaching this the wrong way but here goes.

I have created a grid of rectangles.  Each rectangle contains a word or phrase or picture.  Each rectangle is paired with another rectangle so one rectangle may have a picture of a dog and another would have the word "dog" written on it.  My desired result is that when the user clicks the picture of the dog and the word dog both rectangles would disappear.

I'm approaching this by changing the state of the rectangle to hidden but I'm having trouble with the logic.  So far I've created a variable with different assigned values for each rectangle and when the user clicks the rectangle the value of the variable changes.  Initially none of the variables has the same value as another variable.  Clicking rectangle1 changes the value of variable1. 

Let's say the picture of the dog is on rectangle1 and the word "dog" is on rectangle8.  When the user clicks on rectangle1 the value "dog" is assigned to variable1.  When the user clicks on rectangle8 the value "dog" is assigned to variable8.  When two variables match I want the rectangles associated with those variables to disappear (state changes to hidden).

I haven't been able to figure out how to make this happen although I'm sure it can be done.  Any help would be appreciated!

8 Replies
Geert De Rycke

Hi Steve,

Here you see a sequence of how you can add conditions to a trigger.

1. Open the trigger window (adapt according to your needs) 

2. click on the show conditions link

3. click on the green + icon

4. Add your condition

You'll have to adapt according to your needs

repeat step 3-4 if you have multiple conditions .

Cheers
Geert

Annie Jean

Hi Steve,

I have played with the idea a bit. Since it was easier for me, I made an attempt using True/False variable.

To work, it asks for an action to look at your variable, so I have added a "submit selection" button.

It is not perfect and it asks for a lot of triggers. I haven't done all triggers for all objects but if you want to try it, the "birds" combination is hidding.

I have added a "selected" state to the squares, using this pre-built state to assign the value to the variable.

I also have triggers to change back the state of the items when submitting unless they are already hidden, in case someone doesn't select the appropriate match.

Excuse me for my English, it is not my native language.

Hope it helps and have a nice day!

Annie

Jeanette Brooks

Hello Steve, Geert, and Annie!

I like Annie's example a lot. And Annie, please don't apologize, your English is just fine and you are always so helpful here in the forums!

I also took a try at creating something you might be able to use, Steve... check out the 2 slides here: 

View published example

  • In the first slide, I used two button sets (one for the words, and one for the pictures) so that only one item from each category could be selected at a time. I used 2 triggers on each object to make the object and its match become hidden when the learner chooses correctly. 
  • But please also check out the second slide, because I actually like this one a little better. It's a twist on the same idea, but instead of having learners click the items, I used a drag and drop interaction. To me it felt like a matching activity would be more engaging to the learner this way. The items disappear when the learner drops an object onto its match.

The source file is here in case you'd like to deconstruct. Hope it's helpful!

Steve Shoemaker

Thanks for all of the responses.  What I'm trying to do is reveal a picture that's hidden by all of the boxes.  The boxes are going to form a 6 x 6 grid over a picture (actually a rebus-style puzzle).  When the learner chooses correct matches and those boxes disappear the puzzle/picture underneath will be gradually revealed.  I think Jeanette's solution will probably work best but I tried using layers for this project yesterday and the picture underneath wasn't showing.  I posted that problem in a different thread and one response suggested putting everything (the picture and the boxes) on the same layer.  That worked but now I've been having the problem I posted in this thread.

Thanks again for the responses.  I'll see if I can put all of this together.

Steve Shoemaker

I just altered Jeanette's first version by deleting the "finished" layer, adding a picture to the slide and sending it to the back (under the boxes) and the rearranging the boxes on top of the picture to better hide it.  I mixed up the boxes (buttons) so that pictures were intermingled with words and then previewed it.  It works perfectly!  I'm now going to recreate it myself because I learn best by doing.  I'll share the finished product so you can see what all this fuss has been about.  I'm really excited to finish this and share it with the faculty member who requested it.

Jeanette Brooks

Great to hear you're on your way with that, Steve! And Rene - yes, you could totally do what you have in mind! Attached below is an example - preview it and see if that gives you what you are looking for. Also here is a screencast explaining a bit about how you could build it: https://jeanette.viewscreencasts.com/337e88b1d83a20f8cde835db4a8afc14 

Steve Shoemaker

Jeanette, I love what you did with Rene's project.  The level of support from Articulate staff and the community is amazing and is really what separates Articulate from the competition.  Storyline is pretty good too! 

I've finished most of the project I've been working on.  I call it "Concentration" because it's very similar to the old TV game show.  I noticed one problem that I still have to fix:  If I click on a state (I'm using states and capitals for the demo to faculty) and then choose the wrong capital the state remains in the selected state.  I could just keep clicking on all of the capitals until I found the right one.  I'm going to add triggers that turn the state of the state back to Normal if the incorrect capital is selected (hmm...maybe I shouldn't have used states and capitals.  Makes it tough to distinguish between states like Maryland and states like Normal, Selected, etc.).

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