4

In some questions, I need to include the different types of tasks or sub-items, e.g., multiple-choice and numeric, in a single exercise. Is this possible in R/exams?

In the example below, assume that Part A and Part B are the tasks and must be within the same exercise. It is clear that they could easily be written in two separate exercises but could they also be combined in a single exercise?

Question 01

Part A

What is the capital of Germany?

a. Bonn
b. Berlin
c. Munich
d. Hamburg

Part B

What is the population of Germany's capital?

~##ANSWER1##~

Akram
  • 355
  • 1
  • 10

1 Answers1

3

Cloze exercises

Such questions are supported in R/exams and are called cloze exercises. For worked examples see boxhist, boxhist2, fourfold, fourfold2, lm, among others. The caveat is that such exercises are not supported by all exams2xyz interfaces. Most importantly, they are supported by exams2moodle and exams2openolat, though.

Illustrative example: German capital (Rmd version)

To turn your illustrative example into an Rmd exercise you need:

Question
========

What is the capital of Germany? \#\#ANSWER1\#\#

What is the population of Germany's capital (in millions)? \#\#ANSWER2\#\#

Answerlist
----------
* Bonn
* Berlin
* Munich
* Hamburg
* 

Meta-information
================
exname: German capital
extype: cloze
exclozetype: schoice|num
exsolution: 0100|3.669495
extol: 0.1
exshuffle: TRUE

Rendered in Moodle the exercise looks like this:

Moodle screenshot of German capital cloze exercise

Details and variations

The \#\#ANSWERi\#\# placeholders are replaced by the corresponding interaction elements in the final exercise. The answer list in combination with the exclozetype then provide the information that is necessary to build the interaction elements. Note that the fifth answer list element, corresponding to the population size, is empty.

It is also possible to write cloze exercises without \#\#ANSWERi\#\# placeholders but these are then somewhat more limited in how the interaction elements can be controlled. See boxhist vs. boxhist2 and fourfold vs. fourfold2.

Rnw version

The Rnw version of the same exercise is as follows:

\begin{question}
What is the capital of Germany? ##ANSWER1##

What is the population of Germany's capital (in millions)? ##ANSWER2##

\begin{answerlist}
  \item Bonn
  \item Berlin
  \item Munich
  \item Hamburg
  \item 
\end{answerlist}
\end{question}

\exname{German capital}
\extype{cloze}
\exclozetype{schoice|num}
\exsolution{0100|3.669495}
\extol{0.1}
\exshuffle{TRUE}
Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • That's clear now. Many thanks, Achim for your detailed answer. Would it be also possible to combine essay type tasks with mchoice (or numeric, string etc) in a single exercise? – Akram Jul 04 '21 at 01:56
  • 1
    On the R/exams side you can specify this and it is also possible to export it to QTI 2.1, e.g., for OpenOlat. But there is no export to Moodle because - to the best of my knowledge - there is no support for essay components in Moodle's "cloze" questions (https://docs.moodle.org/310/en/Embedded_Answers_(Cloze)_question_type) or for multiple-choice components in "essay" questions (https://docs.moodle.org/310/en/Essay_question_type). – Achim Zeileis Jul 04 '21 at 10:10
  • Thanks so much for the links. Can one set Moodle essay (auto-grade) question type in R-exams? – Akram Jul 06 '21 at 06:44
  • No, currently this is not possible. At the moment we don't support any additional Moodle plugins yet. – Achim Zeileis Jul 06 '21 at 09:45