#WHEN DOES REGULAR EXPRESSION NOT WORK PLUS#
For instance the expression "it’s blue, white(,| and) red/i" would match all of the above responses plus any combination of capital letters: It's blue, white, red IT'S BLUE, WHITE, RED, etc.Įxample 2. In Moodle 1.9, by default a regular expression match is case sensitive to make the match case insensitive you must add the /i parameter right at the end of your expression. This will match any of those 4 responses:.In the Answer 2 box you would type this regular expression: "it’s blue, white(,| and) red" (quotes should not be typed, of course).For more details, see First correct answer below. In the Answer 1 box you would type the "best" answer, e.g. Suppose your question was "What are the colors of the French flag?". It is not possible to give complete examples of the vast possibilities offered by this system, and the following are just some possibilities.Įxample 1. However, the RegExp system system gives you access to a more powerful system for analysing the student's answers.Ĭorrect answer matching a regular expression pattern Like the Short Answer question, the RegExp Short Answer question expects the respondent to answer an "open" question with a word or a short phrase. The documentation for the "Use regular expressions" option in the Lesson module is to be found at: Short answer analysis.It is different from the "Use regular expressions" option in the Lesson module. The RegExp Short Answer question described in this documentation page is a 3rd-party plugin, which allows you to create questions for the Quiz activity.11.3 Other Moodle question types based on regular expressions.11.2 Learn more about regular expressions.10 Inserting regexp sub-questions in Cloze type questions.6 Previewing questions in popup window (teacher only).5 Entering Answers in Edit Question mode (teacher).4 Detecting missing required words or character strings.2 Correct answer matching a regular expression pattern.