2

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 Answers1

0

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.

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • Thanks, professor Achim. I did what you said. ("exams": ‘2.4.0’ ; "exams2learnr" : ‘0.1.0’; "learnr": ‘0.10.1’) The error persists. I will try to figure out an alternative. – Eduardo-Uresti Jul 08 '22 at 14:43
  • An ugly way is to generate an R data file with R-exams questions using "exams2learnr" (a list of questions for example), and then upload the data in the setup of the "learnr" document and use the questions and every chunk I want. I already did, but I feel very uncomfortable. – Eduardo-Uresti Jul 08 '22 at 15:46
  • Professor Achim. Thanks for your time and patience. My problem was the R version I had installed: I updated my R and it works great! Thanks again! -Eduardo – Eduardo-Uresti Jul 09 '22 at 14:08
  • Thanks for the feedback! R-Forge provides current windows boundaries only for the current version of R. If you have an older R version you need to install the source version rather than the binary. You can do so by adding `type = "source"` in the `install. packages` command (and you need to have the Rtools installed). – Achim Zeileis Jul 09 '22 at 14:55