Sinval
Sinval

Reputation: 1417

How does exshuffle works in cloze questions (package `exams`)?

I would like to understand how does exsuffle works on cloze questions. Does it work with various schoice questions with a different number of possible answers?

I expect to have the possible answers shuffled when presenting the exercises in Moodle. With the observed behavior, the order is always the same.

Upvotes: 3

Views: 730

Answers (3)

Achim Zeileis
Achim Zeileis

Reputation: 17183

The exshuffle option in the meta-information for R/exams questions also works for schoice or mchoice elements within cloze questions. Notes:

  • Bug fix: Prior to R/exams version 2.4-0 specifying exshuffle in cloze question without an answer list in the solution part of the exercise lead to an error. This prompted this StackOverflow question but has been fixed now.
  • Numeric values for exshuffle (i.e., sub-sampling a larger number of answer alternatives) also work.
  • Instead of setting exshuffle to TRUE which does the shuffling on the R side, it is also possible to do the shuffling in Moodle (as pointed out by @JPMD) by selecting a cloze_mchoice_display that includes shuffling, e.g., MULTICHOICE_S or MULTICHOICE_VS etc..
  • Currently, only a single exshuffle value can currently be set for the entire question. Thus, if there are multiple schoice and/or mchoice elements, this single exshuffle value is applied to all of them.

Upvotes: 3

JPMD
JPMD

Reputation: 664

or you can use (for future reference) "MULTICHOICE_VS" as in:


    exams2moodle(questions,
             name = "exameXPTO", 
             cloze = list(cloze_mchoice_display = "MULTICHOICE_VS"), 
             envir =.GlobalEnv)

:-)

Upvotes: 2

Sinval
Sinval

Reputation: 1417

```
options[[1]] <- sample(paste0(c(correct_answer, possible_answers[!possible_answers %in% correct_answer])))
solutions[[1]] <- options[[1]]==correct_answer
```

Upvotes: 2

Related Questions