Search code examples
r-examslearnr

Fail to run "learnr_questions.Rmd" from exams2learnr


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?


Solution

  • TL;DR: Please install at least version 2.4-0 of the exams package.

    Notes: This error seems to happen when using a recent version of learnr with the version 2.3-6 of exams (which was the CRAN release when the question was asked). 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.