Fail to run "learnr_questions.Rmd" from exams2learnr

Viewed 24

I tried to run the example file "learnr_questions.Rmd" that comes as an example in exams2learnr package. The chunk:

exams2learnr("swisscapital.Rmd", allow_retry = TRUE, incorrect = "Incorrect, try again.")

generates "Invalid 'definition' argument" error. What am I doing wrong?

1 Answers

TL;DR: Please install at least version 2.4-0 of the exams package. At the time of writing this is the R-Forge version:

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

Notes: This error seems to happen when using a recent version of learnr with the CRAN release version of exams (version 2.3-6). As this wasn't a problem in older versions of learnr, the exams2learnr package claimed in its DESCRIPTION file that exams >= 2.3-6 was sufficient but this is not true anymore with more recent versions of learnr. Hence, I have just updated the DESCRIPTION of exams2learnr to correctly require exams >= 2.4-0.

Related