HTML(paste0('<textarea id="inputTextToSave4" style="width: 700px; height: 250px;" rows="3" cols="40"><<echo=FALSE,results=hide>>= questions <- solutions <- NULL questions[1] <-"',
tr("alta"),
'" solutions[1] <- FALSE questions[2] <- "',
tr("altb"),
'" solutions[2] <- TRUE questions[3] <- "',
tr("altc"),
'" solutions[3] <- FALSE questions[4] <- "',
tr("altd"),
'" solutions[4] <- FALSE questions[5] <- "',
tr("alte"),
'" solutions[5] <- FALSE o <- sample(1:5) # serve para embaralhar as alternativas questions <- questions[o] solutions <- solutions[o] @ \\begin{question} ',
tr("quesunica"),
' \\begin{answerlist} \\item \\Sexpr{questions[1]} \\item \\Sexpr{questions[2]} \\item \\Sexpr{questions[3]} \\item \\Sexpr{questions[4]} \\item \\Sexpr{questions[5]} \\end{answerlist} \\end{question} \\begin{solution} \\begin{answerlist} \\item \\Sexpr{mchoice2text(solutions[1])} \\item \\Sexpr{mchoice2text(solutions[2])} \\item \\Sexpr{mchoice2text(solutions[3])} \\item \\Sexpr{mchoice2text(solutions[4])} \\item \\Sexpr{mchoice2text(solutions[5])} \\end{answerlist} \\end{solution} %% META-INFORMATION %% \\extype{schoice} %% \\exsolution{\\Sexpr{mchoice2string(solutions, single=TRUE)}} </textarea>'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.