【发布时间】:2021-09-08 23:06:24
【问题描述】:
我尝试了论坛中发布的 R/exams 示例之一,并尝试创建 Moodle 问题,但收到以下错误消息。
exams2moodle("sample_1.Rnw")
## Error in split.default(solutionlist, gr) : first argument must be a vector.
同样的情况也发生在其他 exams2xyz() 接口中。
示例是 Sweave 格式的完形填空题(无解题环境):sample-1.Rnw。
\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}
【问题讨论】:
-
我无法复制这个。对我来说,练习按预期进行。您能否检查一下
Sample_1.Rnw是否真的包含您在上面发布的 Sweave 内容?此外,您的帖子中sample_1.Rnw(小写 s)和Sample_1.Rnw(大写 s)之间的不匹配有点可疑。请确保您使用的是正确的练习。 -
感谢您的评论。是的,我将小写 s 更改为与 sweave 文件匹配的大写。仍然会弹出相同的错误消息,如下所示。 Exams2moodle("Sample_1.Rnw") split.default(solutionlist, gr) 中的错误:第一个参数必须是向量
-
好的,感谢您的检查。我现在发现了问题:在没有解决方案环境的情况下,
cloze练习尚不支持使用exshuffle选项。我会发布一个完整的答案。