Moodle: Activities & Resources: Quiz Question Types: Regular Expression Short Answer
Regular Expression Short Answer is an enhanced short answer question type that analyzes the student's response more thoroughly by using regular expression (RegExp) syntax. It is best used with questions that require natural language answers and not mathematical or scientific answers.
Possible answers must be written using RegExp syntax. Question settings allow entry of several possible answers, and the first answer entered must be the best possible answer.Learning RegExp syntax can take some time, so be sure to use the following reference pages before attempting to create this question type.
Examples
Here is an example of a regular expression short answer response in sentence form with a symbol, still marked correct because of how the RegExp was written in the question settings.
Here is an example of where all possible answers were entered in an attempt to fish for points but earned zero based on the RegExp constructed.
The following explains how to enter these questions in the question bank.
Adding a Regular Expression Short Answer Question to the Question Bank
- In your Moodle course, click on a quiz or on your Course Administration menu.
- In either the Quiz Administration menu or the Course Administration menu, click Question Bank and then Questions.
- Inside the question bank, click Create a new question.
- Select Regular expression short answer from the list of question types and then click Add.
- Complete the general settings, including the selected category, Question name, and Question text.
NOTE: It is suggested that the instructor make sure that the category is correct for better organization and that the question name is specific to the question or section topic so that it is easier to find and edit later.
- Answer 1 must be a correct answer that does not use RegExp syntax. It will also be the first or only correct answer shown depending on whether Show alternate is set to Yes (not recommended when generating a large number of answers using RegExp). Custom feedback can also be added.
- In the subsequent Answers, use RegExp syntax to provide more correct and incorrect responses. Custom feedback can also be added for each answer.
- After clicking Save changes and continue editing, you will be able to see errors if you have any in your RegExp. You can also click Show/Hide alternate answers and (Re-)Calculate alternate answers to preview all possible generated correct answers.
- Finally, if your quiz setting for How questions behave is set to Adaptive mode (with or without penalties), the Help button mode can be set to None, Letter, Word, or Word or punctuation. If a penalty is to be set with the use of the help button, options for Settings for multiple tries and Buying letters or words appear below the answer blanks. If How questions behave is set to Interactive with multiple tries, then Hints provided under this setting will be presented to the test taker.
- When you are finished creating the question, answers, and reviewing the additional settings, Save your changes.
- To add your newly created question to a Quiz, see the GROK article Adding Quiz Questions to a Quiz.
Additional Resources
For more information on using Quizzes and RegExp syntax, see the following resources:
20525
2/23/2024 12:27:44 PM