convert2JSON is a helper function for the multiQuestions
quiz function. It converts its input list into a Javascript object and returns
it as JSON text. This text can then be read by the multiQuestions Javascript code.
Arguments
- x
The input list of the
multiQuestionsfunction, which is a list of lists, each containing 3 or 4 elements (question, options, answer, and optionally tip).- choice
A character string specifying the quiz mode. Either
"single"(default) or"multiple"for multiple-choice.
