Sharing a random CSV data set across exercises with exams2moodle()

房东的猫 提交于 2020-12-12 06:47:30

问题


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 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:

  • 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!