2

I want to create a Moodle quiz with 300 random replications from 6 exercise templates using exams2moodle() from R/exams. The 6 exercise templates depend on a data set that is randomly generated as a CSV file from a larger data base in the first exercise.

The command exams2pdf() does just what I want but I want to reproduce what exams2pdf() does with the exams2moodle() command. However, this just generates a quiz with 300 questions of type 1, 300 of type 2, ..., and 300 of type 6. I don't know how to force Moodle to combine the first type 1 question in the same quiz along with the first type 2 question, the first type 3 question, ..., and the first type 6 question. Then, the exam created would be the same one that the command exams2pdf() generates.

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49
  • Welcome to StackOverflow. Please take the [tour](http://stackoverflow.com/tour) have a look around, and read through the [HELP center](http://stackoverflow.com/help), then read [How to Ask Question](http://stackoverflow.com/help/how-to-ask), [What types of questions should I avoid asking?](http://stackoverflow.com/help/dont-ask) and provide a [MCVE: Minimal, Complete, and Verifiable Example](http://stackoverflow.com/help/mcve). If people around can easily read and understand what you mean, or what the problem is, they'll be more likely willing to help:) – Dwhitz May 26 '20 at 09:49
  • The short answer to this is that this is currently not possible in Moodle. I just voted to re-open this question... then I can share some more links and details. – Achim Zeileis May 27 '20 at 17:54
  • I'm also linking to related discussions from the R/exams forum on R-Forge. The outcome is still the same: the type of sampling you want is not available in Moodle. But maybe some of the details are still of interest to you: https://R-Forge.R-project.org/forum/forum.php?thread_id=33666&forum_id=4377&group_id=1337 and https://R-Forge.R-project.org/forum/forum.php?thread_id=33912&forum_id=4377&group_id=1337 – Achim Zeileis May 27 '20 at 19:32
  • Achim Zeileis, Thank you very much. Sorry my poor use of english language. If you can, please explain Dwhitz what I wanted. Again, thank you. – José Antonio Oyola Velasco May 29 '20 at 09:55

1 Answers1

2

The short answer to this is that this type of sampling is currently not possible in Moodle. You only have the option to inlcude a specific question in a quiz or to select a random question from a certain pool. But there is (to the best of my knowledge) no way of linking the selection of the random questions across pools. Potential workarounds are:

  • Instead of having 300 versions of the quiz you just have, say, 10 versions. Then you can put together all 10 quizzes, each with a fixed sequence of questions. And then you need to split up your participants into 10 groups and assign them to one of the ten quizzes. This is very tedious but lets you use your questions without modification.
    Technical note: When generating the quiz with exams2moodle() with .Rmd (rather than .Rnw) exercises you have to set envir = .GlobalEnv (or some other environment). Only then the randomly-generated data from the first exercise is shared with subsequent exercises when using knitr (while this is the only option when using Sweave()).
  • Instead of having 6 separate exercises, you combine them into a single cloze exercise. Whether this is feasible, though, depends on the complexity of the 6 tasks. If they are too complex, the cloze exercise would become too long and too convoluted.

For some more discussion regarding these issues, see the following threads from the R/exams forum on R-Forge:

Achim Zeileis
  • 15,710
  • 1
  • 39
  • 49