没有解决方案环境的完形填空问题在 R/exams 中不起作用

Cloze questions without solution environment does not work in R/exams

我尝试了论坛中发布的 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}

此问题仅出现在 R/exams 版本 2.3-6(当前 CRAN 发行版)的完形填空问题中,没有解决方案环境但启用了 exshuffle 选项。最简单的解决方案是安装 2.4-0 版,其中错误已得到修复。在撰写本文时,这是 R-Forge 上的开发版本:

install.packages("exams", repos = "https://R-Forge.R-project.org")

或者,您也可以通过添加 {solution}(包括合适的 {answerlist})或省略 exshuffle 选项来解决该问题。但是安装固定 R/exams 版本当然是首选。