I don't seem to be able to correctly import an exam generated with this lm template.
The exams2canvas("lm.Rmd", n = 10)
function will generate the following error:
Error in switch(type, num = "numerical_question", schoice = "multiple_choice_question", : EXPR must be a length 1 vector
I can export it with exams2qti21
, but then Canvas will not offer the supplemental file (without generating any import error). This is the HTML of the question
<p> </p>
<p>Using the data provided in <a>regression.csv</a> estimate a linear regression of <code>y</code> on <code>x</code> and answer the following questions.</p>
<p><br /><br />b. Estimated slope with respect to <code>x</code>:<br /><br /><br /></p>
As you can see no href...
TL;DR
This is not about the supplementary files but about the question type. Using supplementary files with a single question (num, schoice, mchoice) works correctly in exams2canvas()
.
Background
The error in exams2canvas()
is caused by the "cloze" question with schoice and num elements. Canvas supports only cloze questions with schoice elements placed in the text (displayed as multiple dropdowns). Hence, the question cannot be prepared for Canvas correctly.
Clearly, the error message was not helpful in pointing to this problem. In the devel version of the package I have now added an explicit error message for this.
The problems with the exams2qti21()
output are probably due to insufficient customizations for Canvas. Internally, exams2canvas()
interfaces exams2qti12()
(QTI 1.2 not 2.1) but with several tweaks so that the resulting output can be imported correctly into Canvas. For the output from exams2qti21()
we have not been able to do similar tweaks to make it work correctly.
The problem with the missing supplements is most likely caused by the default base64 = TRUE
in exams2qti21()
. Base64 encoding is not supported in Canvas and such content is simply stripped upon import, hence the missing href.