问题
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.
回答1:
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 withexams2moodle()
with .Rmd (rather than .Rnw) exercises you have to setenvir = .GlobalEnv
(or some other environment). Only then the randomly-generated data from the first exercise is shared with subsequent exercises when usingknitr
(while this is the only option when usingSweave()
). - 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, thecloze
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:
- https://R-Forge.R-project.org/forum/forum.php?thread_id=33666&forum_id=4377&group_id=1337
- https://R-Forge.R-project.org/forum/forum.php?thread_id=33912&forum_id=4377&group_id=1337
来源:https://stackoverflow.com/questions/62018204/sharing-a-random-csv-data-set-across-exercises-with-exams2moodle