how text input variables work

build learning interactivity

Moderator: Nav

how text input variables work

Postby tahiya » Wed Jun 20, 2012 2:08 pm

Just for my edification:
If I create a text input field and have the user inputs going into a local variable, does the trigger of "on value change" cause the variable to update with each keystroke, or does it somehow submit content to the variable after the user vacates the text entry box? I guess I"m asking how does the variable trigger relationship identify when the user is DONE inputting?
play, play, play
Posts: 116
Joined: Thu Apr 14, 2011 3:12 pm

Re: how text input variables work

Postby Nav » Wed Jun 20, 2012 3:48 pm

Hi Tahiya,
Great question. The answer is "sure". Basically there are a number of ways to set this up, and each one is perfectly valid.

You could use onValueChange to update your variable, and it would indeed update the variable after each keystroke.

Or, you could use the "onUnfocus" method, which would what you suggested. As soon as the learner clicks outside the input text object, it would update the variable.

Or, quite commonly, people have a submit button that acts as the trigger. I usually use a submit button because I feel it's reassuring for the learner to have something to click on when they're done typing, but every situation varies.

Please let me know if anything is unclear.

- Nav
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Re: how text input variables work

Postby markbreugelmans » Sun Jul 22, 2012 3:45 am

Hi Nav,

I'm using this functionality to check if a learner has given any input. So I've created an action which says OnValueChange a true/false variable changes to "true".
Later I want to add a point to a score variable (number) for every true. It seems that this is not working? What could possibly go wrong? Is this the right way to do this?

Posts: 12
Joined: Sun Jan 02, 2011 12:40 pm

Re: how text input variables work

Postby Nav » Mon Jul 23, 2012 2:00 pm

Hi Mark,
You want to give them a point for entering something (whatever) into a input text object? Probably what I would do is this...

Trigger: InputTextObject > onValueChange
Condition: InputTextObject > getValue != (blank)
True Response: Variables > True False > VariableName > setValue > true (checked)
False Response: Variables > True False > VariableName > setValue > false (unchecked)

Basically, check to see if the InputTextObject is NOT blank, and mark the variable as true in that case. And then do whatever you're already doing to add up the score based on that variable.

If that doesn't help, I'd recommend contacting us directly. I have a feeling I don't fully understand what you're trying to set up, and seeing what you've got set up, and hearing what you're envisioning will help us find a solution that works for you.

- Nav
Posts: 866
Joined: Mon Nov 05, 2007 2:58 pm

Return to Action/Flow Chart/Variable

Who is online

Users browsing this forum: No registered users and 1 guest

Not able to open ./cache/data_global.php