When I export the xml file of a multiple choice question, it contains the following lines:
<idnumber>arbitrary_id_set_by_user</idnumber>
<answernumbering>ABCD</answernumbering>
<tag></tag>
Is there a way to add idnumber
, answernumbering
and tag
to the metainformation section of the question so that r-exams can export to moodle XML as <idnumber>idnumber</idnumber>
,<answernumbering>ABCD</answernumbering>
, <tag>tag1</tag>
, and <tag>tag2</tag>
etc?
The <answernumbering>
tag can be set in exams2moodle()
via the answernumbering=
argument, see ?exams2moodle
. The reason for this is that this is set in the same way for all exercises in a quiz. This is more consistent than setting it individually and potentially inconsistently in the meta-information of the different exercises.
The <idnumber>
tag appears to be used by Moodle only for internal purposes. It is also not mentioned in the official Moodle XML documentation at https://docs.moodle.org/311/en/Moodle_XML_format. Hence we did not implement it in exams2moodle()
.
The <tag>
is currently not supported in exams2moodle()
because we felt that it would be more important to have tags in the Rmd (or Rnw) exercise itself and not the Moodle version of the exercise. For structuring the content on the Moodle side the exsection
meta-information can be used, see boxhist for a worked example.
Finally, you can add arbitrary metainformation by using the exextra
tag. This is used, for example, in the essayreg exercise template. However, there is no general way of using this extra metainformation to insert additional XML code in the exams2moodle()
output. To do that, the source code underlying exams2moodle()
would have to be adapted correspondingly.