Hello,
I am writing a short answer quiz where I need to use Regex for the answer.But I don't how to do.Here an exemple :

Quiz : Where is the book ?
Possible answers : The book is on the table - On the table
Wrong answers: The book is under the table - The book is far from the table.
The answer should contain " on the table "
How can I do it so that both answers can be true ?
Please, I can not sleep.Help me.

Thanks

Comments

nevets’s picture

If you are asking for the pattern depending on context, this should help /on the table/i

nyan’s picture

My God !!! It was so simple.Thank you very much.What about if I want the answer to contain a list of words by random ?

nevets’s picture

You do not say how you are creating the quiz and that will make a difference. In general, for a quiz, " words by random" does not make much sense since the answer has to be something you can test for. Maybe you can expand on what you are trying to do.

kip stanning’s picture

thx @nyan for your question! i would like to use the short question to ask my students, which principles of our constitution they know of. their answer should include 6 different strings. it should not matter in which order or with what endings the required words are submitted.

regards
karl

kip stanning’s picture

thx @nyan for your question! i would like to use the short question to ask my students, which principles of our constitution they know of. their answer should include 6 different strings. it should not matter in which order or with what endings the required words are submitted.

regards
karl