require(MultipleChoice)
Scorekeeper <<- list(problem=NULL, attempts=NULL, score=NULL)
show_hints <- TRUE

Question 1.

The rain in Spain falls mainly on the

MC_question("spain", 
        "plane" = "No, that's something that flies.", 
        "plain" = "**RIGHT**", 
        "plenum", 
        "plan" = "Not a bad choice, but no.", 
        "play", 
        "playa", 
        "place", 
        "palace")
callModule(MC, "spain", "spain", hints = TRUE)

Exercise 2

When in the course of human events, it becomes necessary for one ...

MC_question("declaration", "people" = "**RIGHT**", "government" = "**WRONG**")
callModule(MC, "declaration", "declaration",
           hints = TRUE)

Show the changing scores

actionButton("update", "Send scores.")
tableOutput("scores")
output$scores <- renderTable({
  if (input$update == 0) return(NULL)
  data.frame(problem = Scorekeeper$problem, 
             answer = Scorekeeper$answer,
             attempts = Scorekeeper$attempts, 
             score = Scorekeeper$score, 
             stringsAsFactors = FALSE)
})


dtkaplan/MultipleChoice documentation built on May 15, 2019, 4:58 p.m.