Hello everybody,

I'd like to have a question type which ignores spaces.

For example, the answer is M = (N % 3) * 4

But the correct answers here are many, including M=(N%3)*4

- Is there a way to do that ?

I searched many plugins and question types, but I was unable to find out a solution.

* I can use wildcards but a wildcard can match any character so if someone answers M=(2N%3)*4 will see correct, which is not

- Can I set a wildcard to space character only ?

Any tips ?

Thanks.

Moving to quiz forum...

Although, can this be done with, Regular_Expression_Short-Answer_question_type

Thanks,

I have this plugin and the truth is still can't find how.

I try with parentheses, ?, *.

Any hint could be very helpful.

Hi John,

It might help if you said which QUESTION is asked to which you are expecting this answer.

A simple way to reduce acceptable answers would be to give clear instructions to the student, e.g. "do not use any blanks/spaces in your answer" OR "please separate ALL elements of your answer with blanks/spaces".

The REGEXP question type was primarily aimed at analysing answers written in "natural language", not maths or physics formulas, etc. However, it is possible to achieve what you want by entering those 2 formulas which will accept answers with or without blanks.

Formula #1: see below

will accept 128 possible answers, such as:

M = (N % 3 ) * 4

M = (N % 3 ) *4

M = (N % 3 )* 4

M = (N % 3 )*4

M = (N % 3) * 4

M = (N % 3) *4

M = (N % 3)* 4

M = (N % 3)*4

M = (N %3 ) * 4

M = (N %3 ) *4

M = (N %3 )* 4

M = (N %3 )*4

M = (N %3) * 4

M = (N %3) *4

M = (N %3)* 4

M = (N %3)*4

M = (N% 3 ) * 4

M = (N% 3 ) *4

M = (N% 3 )* 4

M = (N% 3 )*4

M = (N% 3) * 4

M = (N% 3) *4

M = (N% 3)* 4

M = (N% 3)*4

M = (N%3 ) * 4

etc.

Further to Marcus Green's suggestion, this formula will accept an inversion:

Formula #2: see below

will also accept 128 possible answers including:

M = 4 * (N % 3 )

M = 4 * (N % 3)

M = 4 * (N %3 )

M = 4 * (N %3)

M = 4 * (N% 3 )

M = 4 * (N% 3)

M = 4 * (N%3 )

M = 4 * (N%3)

M = 4 *(N % 3 )

M = 4 *(N % 3)

M = 4 *(N %3 )

M = 4 *(N %3)

M = 4 *(N% 3 )

M = 4 *(N% 3)

etc.

**EDIT** the text editor on this forum modifies my reg expressions so I have attached them as pics.

Hope that helps. Don't thank me, as POTUS would tweet "I am a genius", even if I say so myself.