I've solutions of a cloze question, sol4=FALSE and sol5=TRUE but when I export the exercise to moodle with exsolution: r mchoice2moodle(sol4)
|r mchoice2moodle(sol5)
, both solutions equal TRUE (corresponding to c and d)! Do you know this is some kind of Moodle bug or what am I doing wrong?
You cannot represent logical questions/answers by multiple-choice questions of length 1 in Moodle. In R/exams, mchoice
questions are allowed to have this format and hence no error is generated. But in Moodle, the corresponding MULTIRESPONSE
type needs to have at least two choice and at least one of these needs to be true.
Therefore, instead of using a multiple-choice question of length 1, I would use a single-choice question of length 2 like this:
Question
========
The p-value is: ##ANSWER1##
The null hypothesis is: ##ANSWER2##
Answerlist
----------
*
* not rejected
* rejected
Meta-information
================
exname: Hypothesis test
extype: cloze
exclozetype: num|schoice
exsolution: 0.123|10
Then you get a simple drop-down menu with both choices rather than just a single check box. This also has the advantage that you can clearly distinguish between not answering and not true.