| moodle_m2s | R Documentation |
The exams package does not support multiple-choice questions with multiple correct answers but only one allowed answer;
but Moodle does. The function reads the XML file generated by exams2moodle and changes for all mchoice questions:
<single>...</single> to <single>true</single>, and
modifies the attribute fraction in the tags <answer fraction="...">...</answer>.
If fraction is less than 0, it is set to zero, and if fraction is greater than 0, it is set to 100.
If the file does not end with .xml, .xml is appended. At the end, the modified XML code is stored in newfile.
moodle_m2s(file, newfile = NULL, verbose = 1)
file |
character: Moodle XML file with exercises to read from |
newfile |
character: Moodle XML file to write to (default: |
verbose |
integer: generate output (default: |
invisibly the file name written to
if (interactive()) {
newfile <- tempfile(fileext=".xml")
moodle_m2s(system.file("xml", "klausur-test.xml", package="exams.moodle"), newfile=newfile)
file.edit(newfile)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.