Author: Christian Ghiaus
INSA Lyon, France, 18/04/2021
This tutorial shows how to create a quiz in Moodle 3 with embedded answers (called cloze questions) imported as a random question from an .xml
file generated in Python 3.
Requirements:
- Acces to Moodle in editing mode.
- Availability of the file
PyClz00.xml
.
Typical workflow:
- Create the questions in Python and save them in an
.xml
file (see Tutorial_py2xml.md). - Create and set up a quiz in Moodle.
- Create a category for the specific question of the quiz in the question bank.
- Import the
.xml
file into the question bank in the category of the quiz corresponding to the type of question. - Preview the questions of a category in the question bank. If there are errors in the questions:
- Delete the questions from the category.
- Correct the questions in Python (see Tutorial_py2xml.md).
- Go to step 4.
- Add a random question to the quiz.
- Preview an existing quiz.
In the following, the Moodle commands are in bold and the context in Moodle is highlighted
. The actions are in My Course
in the context Home / My courses / ... My course
.
See Tutorial_py2xml.md to create the questions in Python and save them as PyClz00.xml
file. For this tutorial, use the file PyClz00.xml
as provided.
Home / My courses / ... My course
- Turn editing on.
- Add an actvity or resource.
- Chose quiz.
- Name the quiz PyCloze, select the quiz settings (Timing, Grade, etc.), then Save and return to course.
Home / My courses / ... My course
- Select the quiz PyCloze.
Home / My courses / ... My course/PyCloze
- Select Question bank / Categories
Home / My courses / ... My course / PyCloze / Question bank / Categories
- Add category Name: PyCloze random questions for Parent category Default for PyCloze.
- Push Add category button.
Home / My courses / ... My course
From My course
:
- Select the quiz PyCloze, Question bank, Import.
- In File format, chose Moodle XML format.
- Attention: in General, select Import category PyCloze random questions.
- In Import questions from file, drag & drop the file
PyCloze00.xml
, then push Import button.
Home / My courses / ... My course / General / PyCloze / Question bank / Import
The imported questions are displayed. At the bottom of the page, push Continue button.
Home / My courses / ... My course / General / PyCloze / Question bank / Questions
- Select the category: PyCloze random questions (6).
- Under Actions, push Edit and select Preview.
- Push Fill in the correct responses button and check the view of the question.
- Push Close preview button.
Home / My courses / ... My course / General / PyCloze / Question bank / Questions
- Select a category: PyCloze random questions (6).
- Tick the box next to Question name / ID number to select all questions.
- Push Delete button at the bottom of the list of questions.
See the Tutorial_py2xml.md to correct the questions in Python and save them as PyCloze00.xml
.
Home / My courses / ... My course / General / PyCloze
- Edit quiz.
Home / My courses / ... My course / General / PyCloze / Edit quiz
- Add and select A random question.
- Select Category PyCloze random questions (6).
- Push Add random question button.
- You can preview the questions by pushing the magnifying glass.
- Select the mark for the question and the grade for the quiz. See Tips&Tricks on grades, marks and points in Moodle.
- Save the quiz.
Home / My courses / ... My course
- Chose the test PyCloze.
- Push Preview quiz now button.