'How to include all elements of a vector in an exams2moodle or exams2pdf output?

I am working on a simple code to find the square root of the following elements:

   dat <- c(4,9,16,25,36,49,64,81,100,121,144,169,196,225)
   num<-sample(dat ,1,replace=F)   

Parts of the seed file are configured like this:

 examen01<-c("SinRad.Rmd")
   semilla<-sample(100:1000, 1)
   set.seed(semilla) 

   exams2moodle(examen01,n=14,svg=TRUE,name="SinRadConRad",
              encoding="UTF-8",dir="salida",edir="ejercicios",
              mchoice = list(shuffle = TRUE,answernumbering = "ABCD",
              solution = FALSE,
              eval = list(partial = TRUE,rule = "none")))

I intend that, with n=14, all the responses to the options found in the "dat" vector are included, but I see that there are responses that are repeated.

How to achieve 14 answers for the 14 possibilities, without repeating or missing any?

Thank you very much



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source