Forum Discussion
Text entry must contain
Hallo - I've been trying to find or think up a workaround for this but I can't! Can anybody help?
I have a text entry field that I want users to complete - they can write anything at all, but it must contain specific words (let's say, for example; "Specific Words"!).
I don't want them to be limited to writing 'Specific Words' (although they would still pass if they did) - I want to encourage them to write more, but be judged correctly if 'Specific Words' is included in the text.
Is there any way I could do this?
13 Replies
- WaltHamiltonSuper Hero
Steven,
These lines won't work, because the second one changes what the first one did, so the lower case is never searched for.
var n = str.search("drain");
var n = str.search("Drain");The attempt with two separate variables probably works, but these lines change the SL variable to the upper case regardless of which one is found.
player.SetVar("draincoolant", "Drain coolant");
}else if(m >= 0){
player.SetVar("draincoolant", "Drain coolant");
}else{Try var str = player.GetVar("draincoolant").toLowerCase(); if you want to ignore case. The problem is that the answer is changed to all lower case, which is only a problem if you come back at the end and reset the SL variable. In that case, I would use strOri to store the original value, then use str = strOri.toLowerCase(); Search str, and use strOri to write to SL.
- WaltHamiltonSuper Hero
Michelle
There is a sample that uses the same principles that Matthew does at this post: https://community.articulate.com/discussions/articulate-storyline/free-sample-check-essay-questions-for-concepts-not-words
Related Content
- 8 months ago
- 10 years ago
- 2 years ago