Copy link to clipboard
Copied
I have a project where users need to write the time in a Text Entry Box.
1. Users clic a speaker to hear the audio (tells the time. For example: It is one o'clock.)
2. Then, users type that sentence time in a TEB.
3. TEB has a variable declared (for example: writing_01 is equal to It is one o'clock)
4. Then, a submit button checks if writing_01 is equal to the given sentence (for example: It is one o'clock).
Issue:
When users type the word o'clock (the submit button gives an incorrect answer). However, when I removed the apostrophe the answer is correct.
Problem:
Users learned to write o'clock with the apostrophe.
Can you suggest a proper way to handle the apostrophe?
Thanks.
You're welcome. Why choose a complicated approach if it can be done so easily....
Did any of the solutions work for you? Hope you are having a great day!
Copy link to clipboard
Copied
If you use the default setting for a validated TEB, and give 'one o'clock' as correct answer, it works perfectly. Why do you use an advanced action? Have a look at this post:
http://blog.lilybiri.com/text-entry-boxes-back-to-basics
Even though it is a point-and-click creation, in an advanced action you are coping with a programming language and its rules. If you need really an advanced action (which is not the case in my opinion) an easy way would be to store the correct value 'one o'clock' in another user variable and compare the associated TEB variable with that other user variable. Same workflow as is needed when checking a TEB for an empty entry:
http://blog.lilybiri.com/where-is-null-in-cp2017
Copy link to clipboard
Copied
Thank you Lilybiri.
I'll try the approach you suggested. I also read your articles about TEB and thanks for posting those. They are very well explained.
Copy link to clipboard
Copied
You're welcome. Why choose a complicated approach if it can be done so easily....
Copy link to clipboard
Copied
Ok the issue is the use of the apostrophe.
There are two ways that you can get around this...
1. Create varible(s) that will be used to represent the correct answer for a given question.
The your advance action would be like so:
2. You can use a fancy escape method so that the apostrophe is able to be used in the string when doing the compare in your advanced action like so:
In order for the apostrophe to be used during your compare, when using and advanced action, you will need to put three '\' characters together and then your apostrophe = \\\' This will allow the correct answer entered by the learner in the TEB It is one o'clock. to be evaluagted allowing for the correcgt ansewr to be determined. Please keep in mind that case sensitivity plays a role...so if the learner was to enter it is one o'clock - the lowercase 'i' would then yeild a wrong answer.
This should get you back on track!
Copy link to clipboard
Copied
The image for my answer above that goes "1. Create varible(s) that will be used to represent the correct answer for a given question. The your advance action would be like so:"
Sorry I fogot to add the image...
Copy link to clipboard
Copied
Thank you OH_CP.
I appreciated your suggestion. I'll try that and see how it works.
Sincerely,
Copy link to clipboard
Copied
Did any of the solutions work for you? Hope you are having a great day!