Ignore spaces

Re: Ignore spaces

door Joseph Rézeau -
Aantal antwoorden: 0
Foto van Core developers Foto van Particularly helpful Moodlers Foto van Plugin developers Foto van Testers Foto van Translators

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.knipoog

Bijlage 2018-01-15_13-59-38.jpg
Gemiddelde van de beoordelingen:  -