问题描述
我正在尝试使用考试包创建我的Moodle考试。我想创建一个3个数字和一个字符串子类型的完形填空问题,但是我在testss2moodle()上遇到问题。 这是我的代码的简化:
```{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-@R_168_4045@ion
================
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中将其编织起来时,它可以很好地工作,但不适用于testss2moodle():
exams2moodle("regresion.Rmd",n = 8,name = "Exam reg")
我收到警告消息:
Error in split.default(solutionlist,gr) :
first argument must be a vector
任何建议,我将不胜感激!谢谢!
解决方法
我将R / Markdown练习放入文件exams
中,然后使用exams
2.3-6(在撰写本文时为当前的CRAN发行版)和2.4-0(当前的R-Forge开发版本)。一切正常,没有错误,并且将练习导入Moodle后按预期进行了操作。
我建议您更新//call paginator
use Illuminate\Pagination\Paginator;
软件包的版本,并在必要时更新R本身的版本。那你应该没事。