LMSouq
moodle-core Open

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

VI
Vicky Fasano
1 month ago
3 views
Problem Description
I am trying to use exams package to create my Moodle exams. I want to create a cloze question whit 3 numeric and one string sub-types but I am having problems with the exams2moodle(). Here is a simplification of my code: ```{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 When I knit this in the Rmarkdown, it works well, but not with exams2moodle(): exams2moodle("regresion.Rmd", n = 8, name = "Exam reg") I get the warning message: Error in split.default(solutionlist, gr) : first argument must be a vector I will appreciate any suggestion! Thank you!

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base