You can display the value of variables in any text element

There are lots of great learning activities where you want the learner to type in an answer and then be able to display what they typed.

Here's how to create a simple version of that type (see what we did there?) of activity. 

Plus, we also have a link to a sample we've created using a variation of these steps, based on the game MadLibs.

Setting up a Form Control so the learner can type

The first thing to do is add a Form Control to allow the learner to type on the page.

Here are the steps to do that, in this case a Text Input form control:

 

 

Use the Full Screen button to view this lesson in a modal window.

Click here to view the Guide version of these steps.

With that step out the way, next we'll set up a text element to display what the learner types.

Display the value of a variable in a text element

When the learner types into the Text Input form control, the typing is automatically saved as a variable associated with that form control. You can add the name of that variable into a text element, and the value that was typed will be displayed as text.

Here's how to set that up: 

 

 

Use the Full Screen button to view this lesson in a modal window.

Click here to view the Guide version of these steps.

Here's an example

We used the basic steps listed above to create this sample based on the game MadLibs.

Just like the steps above, this sample uses Text Input form controls to capture your typing and save it as a variable. Then, the text element displays the associated variable for each type-in field within the story text.

There are lots of ways to vary this type of interaction.

In the steps above, the text element will change in real-time as the learner types. 

But in the game sample, we hid the text element until the learner clicked a button, using a Show action.

The variable is stored for the course as a whole, so you can also have the text element on a completely different page. Or show it on multiple pages.

What can you think to try?

 

 

  0     0

Similar Projects

Questions  ( 0 )