% symbol in input text

For general questions about Content Authoring

Moderator: Nav

% symbol in input text

Postby tahiya » Fri Dec 28, 2012 10:56 am

How do I get an input text box in a quiz to accept a % symbol as part of the answer? Right now it just rejects the symbol by deleting it from the box when you hit submit and then saying the answer is wrong.
play, play, play
Posts: 116
Joined: Thu Apr 14, 2011 3:12 pm

Re: % symbol in input text

Postby Nav » Fri Dec 28, 2012 2:21 pm

Hi Tahiya,
You have a number of ways of doing this.

- Use getText instead of getNumber and treat the answer as a string. You can't use greater-than or less-than, though.
- The input text object has a property called "Format". The last item in the drop down list (you'll have to scroll down) is "1.1%" This automatically adds a percentage sign on the text, so the user doesn't have to. Give it a try. Keep in mind that when you're using the conditional action, you'll just be evaluating the number. So the user enters "50", it will display as "50%" and then you look to see if they answered "50".
- Put the "%" sign outside the input text object in a regular static text object. That way the learner knows they don't have to enter it, and you can just deal with the number.

Let me know if those won't work for you.

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

Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

Not able to open ./cache/data_global.php