Forum: support
Monitor Forum | Start New ThreadRE: Create several exams with different question order but exactly same questions [ Reply ] By: Achim Zeileis on 2019-07-24 02:24 | [forum:46864] |
As similar questions are asked occasionally I just implemented an alternative solution to this: exams2pdf() can now also take a matrix of file names that exactly indicates which selection of exercises is to be used in which version of an exam. Additionally, a matrix of random seeds can be supplied where the seeds are set immediately before processing each of the exercises. Thus, you can set up a matrix of files as indicated in the original question. And then the same set of seeds can be used in every row of the seed matrix assuring that the same exercises are obtained: ## select exercises, seeds, and four combinations (see original question) set.seed(1) exc <- c("deriv", "dist", "boxplots", "ttest") rsd <- sample(1:9999, 4) idx <- rbind(c(2, 3, 1, 4), c(3, 1, 4, 2), c(2, 1, 3, 4), c(1, 4, 2, 3)) ## expand exercises and seeds to matrix exc <- exc[idx] rsd <- rsd[idx] dim(exc) <- dim(rsd) <- dim(idx) ## generate exams library("exams") exams2pdf(exc, seed = rsd, template = "exam.tex") |
RE: Create several exams with different question order but exactly same questions [ Reply ] By: Achim Zeileis on 2017-12-03 22:26 | [forum:45487] plain-order.zip (215) downloads |
Francis, for producing different versions of the same exam, the easiest solution in exams2pdf() is to use different templates. And to fix the ordering you can replace the %% \exinput{exercises} with the \input{} statements for the desired exercises, e.g., \input{exercise2} \input{exercise3} \input{exercise1} \input{exercise4} Originally, we introduced this feature to allow for text between certain exercises or further special formatting. But it can also be used to change the ordering. Attached is a plain .tex file in four versions (A-D) with the different desired orderings. With this you can do: base.order <- list("tstat2.Rmd","cholesky.Rmd","boxhist.Rmd","confint.Rmd") exams2pdf(base.order, template = c("plainA", "plainB", "plainC", "plainC", "plainD")) A potential caveat is that this stores the meta-information only once. Thus, when correcting the exam, you have to re-permute the solutions because the permutations are not stored in the meta-information. A possible strategy could be to write a small wrapper function that carries out and stores the ordering. |
Create several exams with different question order but exactly same questions [ Reply ] By: francis tuerlinckx on 2017-12-02 15:59 | [forum:45486] |
I am using the R package exams. I am trying to generate four versions of exactly the same exam with R-exams, but with each having a different question order. Also, I would like to have full control over the order. For example, if I have four questions (1-2-3-4), I want to generate versions: (2-3-1-4), (3-1-4-2), (2-1-3-4), (1-4-2-3). Here is the code I could use: base.order = list("tstat2.Rmd","Cholesky.Rmd","boxhist.Rmd","confint.Rmd") order1 = base.order[c(2,3,1,4)] order2= base.order[c(3,1,4,2)] order3 = base.order[c(2,1,3,4)] order4= base.order[c(1,4,2,3)] set.seed(1322) exams2pdf(order1,template="exam") set.seed(1322) exams2pdf(order2,template="exam") set.seed(1322) exams2pdf(order3,template="exam") set.seed(1322) exams2pdf(order4,template="exam") The problem is that the same question in different versions makes use of different numbers (so the questions are not exactly equal). How can this be solved? |