R/exams Moodle:用数字和字符串项填空

R/exams Moodle: Cloze with numeric and a string item

我正在尝试使用考试包来创建我的 Moodle 考试。我想创建一个包含 3 个数字和一个字符串子类型的完形填空问题,但我在使用 exams2moodle() 时遇到了问题。 这是我的代码的简化:

```{r data generation, echo = FALSE, results = "hide"}
## DATA GENERATION
options(scipen = 999)
#here in my version, I generated the data and solutions, but I simplified the code for a better understanding

cambio_delta <- 20.1
r2 <- 0.97
y0_1 <- 19.56
sol_str<- "Not possible"

```

Question
========

Here goes the question speech

Answerlist
----------
* Question 1 (this is numeric)
* Question 2 (this is numeric)
* Question 3 (this is numeric)
* Question 4 (this is STRING, the answer suppose to be "Not possible")


Meta-information
================
extype: cloze
exclozetype: num|num|num|string
exsolution: `r 100*r2`|`r cambio_delta`|`r y0_1`|`r sol_str`
extol: 0.05|0.05|0.05
exname: regresion

当我在 Rmarkdown 中编织它时,它运行良好,但不适用于 exams2moodle():

exams2moodle("regresion.Rmd", n = 8, name = "Exam reg")

我收到警告消息:

Error in split.default(solutionlist, gr) : 
  first argument must be a vector

我将不胜感激任何建议!谢谢!

我将 R/Markdown 练习放入文件 regresion.Rmd 然后 运行 你的代码与 exams 2.3-6(当时的当前 CRAN 发布版本写作)和 2.4-0(当前 R-Forge 开发版本)。一切正常,没有错误,练习在导入 Moodle 后按预期工作。

我建议您更新 exams 软件包的版本,如果需要,还可以更新 R 本身。那你应该没问题。