We are using a loop with exams2nops
to produce several exam versions of the same exam, but with different databases generated in an introduction file which is added to the final PDF produced by the exams2nops
function. However, each loop produces an exam with the same exam IDs, is any way of controlling the ID giving to each exam?
So, what we need is to customize the generation of the exam ID with corresponding rds file for later nops_eval
.
There is some limited control, see argument startid
.
In general the ID is always composed as yymmddxxxxx
, where yy
is the year of the date of the exam, mm
the month, dd
the day, and xxxxx
is a consecutive ID starting from 00001
by default. However, with startid
you can start from a different initial ID.
For example, exams2nops(..., date = "2021-01-20")
starts with 21012000001
while exams2nops(..., date = "2021-01-20", startid = 42)
starts with 21012000042
.
Personally, when I mix less than 10 different batches of NOPS exams, I used startid = 1
, startid = 10001
, startid = 20001
, etc.
Note also that you can nops_eval()
all of these together then, you just need to manually merge the .rds files produced by them. To do so, readRDS()
each .rds file into some object, combine all objects with c()
, and saveRDS()
into a new .rds file that you use subsequently. If you want to merge a large number of .rds files in the current working directory, you can use the following code:
## readRDS all *.rds files in the current working directory
x <- lapply(Sys.glob("*.rds"), readRDS)
## combine all resulting lists
y <- do.call("c", x)
## saveRDS into a single .rds file
saveRDS(y, "all.rds")