library(learnr)
learnr::question( "Which planet do we live on?", answer("Mars", correct = FALSE), answer("Earth", correct = TRUE), answer("Saturn", correct = FALSE), allow_retry = TRUE )
shiny::observeEvent( input$get_state, { objs = learnr:::get_tutorial_state() output$state = shiny::renderText( paste( capture.output(str(objs)), collapse = "\n" ) ) invisible() } )
shiny::actionButton("get_state", "Get State") shiny::br() shiny::br() learnrhash:::wrapped_verbatim_text_output("state")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.