#' examples UI Function
#'
#' @description A shiny Module.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList
mod_examples_ui <- function(id){
ns <- NS(id)
tagList(
h2("Quelques exemples"),
tabsetPanel(
tabPanel("Question à réponse numérique",
br(),
verbatimTextOutput(ns("ex_num"))),
tabPanel("Question à choix multiple",
br(),
verbatimTextOutput(ns("ex_schoice"))),
tabPanel("Question contenant plusieurs questions",
br(),
verbatimTextOutput(ns("ex_cloze"))),
tabPanel("Question avec de l'aléatoire",
br(),
verbatimTextOutput(ns("ex_rand_num")))
)
)
}
#' examples Server Function
#'
#' @noRd
mod_examples_server <- function(input, output, session){
ns <- session$ns
output$ex_schoice <- renderPrint({
cat_internal_txtfiles("ex_schoice.Rmd")
})
output$ex_num <- renderPrint({
cat_internal_txtfiles("ex_num.Rmd")
})
output$ex_cloze <- renderPrint({
cat_internal_txtfiles("ex_cloze.Rmd")
})
output$ex_rand_num <- renderPrint({
cat_internal_txtfiles("ex_rand_num.Rmd")
})
}
## To be copied in the UI
# mod_examples_ui("examples_ui_1")
## To be copied in the server
# callModule(mod_examples_server, "examples_ui_1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.