Have you ever tried to set a quiz of just 10 questions in Moodle? The typical response time for a single click is of the order of 10 s. It takes several tens of clicks to create a single question. Then you have to preview them, see what's wrong (because it's bound to not do what you thought it would do.) And iterate.
To escape this tedium, I decide to write the questions in a text editor. After all, my draft questions are plain text so it seemed like a good starting point. And Moodle has an importer for this.
I looked it up as it was a while ago, and you can do this using a format called GIFT. OK, here we go. After having done half of them, it turns out GIFT is not expressive enough for my questions.
I recall there is some more flexible format, so some more searching gets me to Cloze. OK, Cloze format it is.
But hang on, the docs only describe the syntax for a single question, not an entire quiz. More searching, ah OK, simple: just create the quiz in XML and use the CDATA section for the actual questions (!?).
But so far so good. I'm good at copy-pasting boilerplate. But the question importer does not tell you where you made a mistake, so it takes a lot of slow iterations.
The importer also only puts the questions in a specific category if your source file has that information. The syntax to specify that information is a well-kept secret, or so it would seem given how hard it is to search for it. When I found it, I understood why: out of shame. You have to masquerade this info as a dummy question in the quiz, with its own special syntax.
Eventually it also turns out you can only really properly format the Cloze part in HTML. More iterations.
So in the end I have an XML file with lots of CDATA sections with a mix of HTML syntax and Cloze syntax.
I really wonder what it is like in the mind of the person who designed this solution.
#moodle