Would it be an Edit Box connected to an array of answers?
Printable View
Would it be an Edit Box connected to an array of answers?
sorry, but what do you mean by answer-checker?
Something like a set of predetermined answers to be checked (by a checkbox)?
You may take a look at the Question & Answer object,
that serves specifically for similar purposes (if I understood your purposes XD)
An edit box can be linked to anything holding list of values/strings, like a list (or array if you prefer)
so also this kind of setup can be surely pursued,
particularly if you have huge sets of questions/answers stored in a more database-sque structure
Not a multiple choice. More like player types in answer to a question and it must match some answer-bank.
So like an Edit Box Object connected to an array with a string parser??
But I'm not sure how to setup the parser
Ahh ok, now I understand X)
Then I think the editbox+array would be a good solution.
I guess you don't want a "full string" match, since you mention the string parser,
maybe you'd want to check specific keywords?
You could check keywords (and also keyword position, if you want to be more selective).
A simple setup could be:
set the array to contain on Y0 the complete answer, on Y1 the comma-delimited keywords (X index= question number)
then on answer submitted,
you would parse the answer on loop "Numberofstrings" time, with " "(space) delimiter,
and check each parsed string against the set of pre-determined keywords you stored in the array,
by launching another sub-loop on array Y1 comma-delimited terms.
On each match, you may add 1 to a counter,
if counter = "Numberofstrings" (of the array stored keywords)
the answer would be correct.
I guess it would be easier to do than to write down like this XD
A pair of lists or a simple ini would work just as well as an array in this setting ;)
Thanks alot guys. I'm struggling a bit trying to understand it but I'll figure it out.
Quick question: Can you guys confirm if the edit box object pops up the mobile keyboard?
How do people test mobile games?
I once did that so I know what you are talking about.
I will look in my old files to find it.
This is from a tutorial that I used once.
This is assuming that the correct answer is FROGGY and the Edit Box's nome is input_box .
IF: [Keyboard & Mouse Object] > The Keyboard > Upon pressing a key
<< press ENTER on your keyboard >>
IF: [Special Object] > Compare two general values
<< check if expression Edittext$( "input_box" ) is equal “FROGGY” >>
THEN: [input_box] > Destroy
THEN: [Storyboard Controls] > Next frame
Yeah, I know that “Edittext$( "input_box" )” looks scary and it won’t be too easy to remember by
hard… But, ya’ know, you don’t really have to remember it! How’s that? Well, in MMF2 there’s
that sweet “Retrieve data from an object” button, which enables you to browse for the data
you’re interested in, retrieve it from specified objects and don’t worry about any memorizing at
all. All you’d have to do, is to click on the aforementioned button, right-click on the “input_box”
object and select the “Get Text” command from the drop-down menu… And – voila! – you’ve
got the same expression waiting for you!
You’re most probably also wondering why the heck have I ordered our app to destroy the
“input_box” object before jumping to the next frame, right? Well, we’re gonna’ add some frame
fade-in’s and fade-out’s bit later on, and Edit objects don’t usually go too well with them.
OK, let’s cut the chit-chat and continue with our programming part… Here’s the event played
out when the player has entered an incorrect password:
IF: [Keyboard & Mouse Object] > The Keyboard > Upon pressing a key
<< press ENTER on your keyboard >>
IF: [Special Object] > Compare two general values
<< check if expression Edittext$( "input_box" ) is different than “FROGGY” >>
THEN: [Sound object] > Samples > Play sample
<< Select some kind of a short “error” sound from the MMF2’s sound library >>
Very cool advaith. Thanks a ton
Finally got it to work.
How would you make the answers case INsensitive?
Maybe using Lower$("string") on comparing both input and stored answers?
This is an idea:
In the edit box properties ,under Misc. (is the Settings tab), change Case modification to Turn to Lowercase . That will change all text to lowercase, so you will not need to worry about anyone typing in UPPERCASE.