Search code examples
moodler-exams

How do I create a cloze question type with a combination of single and multiple choices?


My problem occurs in questions exported to moodle. I intend to create a cloze question that has a part being single choice (schoice) and another part being multiple choice (mchoice). When exporting using the exams2moodle function I have two possible behaviors: either all questions are displayed as schoice (drop-down menu) or all are displayed as mchoice (check box). Visually the second case may even work, however it does not correctly score points or penalties, as the questions is treated as mchoice, regardless of its definition.

How do these distinct behaviors occur? The first item defines the behavior of the question, if the first is schoice then everyone will appear as such and vice versa.

Minimal example (all questions are shown as mchoice in moodle)

\begin{question}
This is the question. This is the question

\begin{answerlist}
  \item Multiple choice answer 1.
  \item Multiple choice answer 2.
  \item Multiple choice answer 3.
  \item Multiple choice answer 4.
  \item Single choice 1.
  \item Single choice 2.  
\end{answerlist}
\end{question}

\exname{cloze_schoice_mchoice}
\extype{cloze}
\exclozetype{mchoice|schoice}
\exsolution{1100|10}

enter image description here

Minimal example (all questions are shown as schoice in moodle)

\begin{question}
This is the question. This is the question

\begin{answerlist}
  \item Single choice 1.
  \item Single choice 2.  
  \item Multiple choice answer 1.
  \item Multiple choice answer 2.
  \item Multiple choice answer 3.
  \item Multiple choice answer 4.
\end{answerlist}
\end{question}

\exname{cloze_schoice_mchoice}
\extype{cloze}
\exclozetype{schoice|mchoice}
\exsolution{10|1100}

enter image description here

Is it possible to get a proper behavior or do some workaround?


Solution

  • This was a bug in exams2moodle(), thanks for pointing this out. I have fixed it in exams 2.4-0. If you install that, running exams2moodle() gives you check boxes for the mchoice questions and a drop-down menu for the schoice questions. These defaults can be modified via

    exams2moodle(...,
      cloze = list(cloze_mchoice_display = ..., cloze_schoice_display = ...))