From 43af983800200e7840bae647e09b50d176685c75 Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Tue, 26 Mar 2024 23:24:47 +0100 Subject: [PATCH 1/9] randomize answers and allow retry in quizz questions --- shiny_tutorial/shiny_tutorial.Rmd | 106 ++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 28 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 5a5e61b..92f3487 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -31,31 +31,36 @@ quiz( answer("Un framework pour créer des applications web interactives avec R", correct = TRUE), answer("Une espèce de pokémon rare"), answer("Une crème contre les rayons bleus des écrans"), - answer("Un framework pour créer des applications web interactives avec Python", correct = TRUE) + answer("Un framework pour créer des applications web interactives avec Python", correct = TRUE), + allow_retry = TRUE ), question("Combien de composants sont nécessaires pour créer une application Shiny ?", answer("1"), answer("2", correct = TRUE), answer("3"), - answer("4") + answer("4"), + allow_retry = TRUE ), question("Quels sont les deux composants nécessaires pour créer une application Shiny ?", answer("ui.R et server.R", correct = TRUE), answer("ui.R et app.R"), answer("server.R et app.R"), - answer("ui.R et ui.R") + answer("ui.R et ui.R"), + allow_retry = TRUE ), question("Quel est le composant qui permet de définir l'interface utilisateur dans une application Shiny ?", answer("ui.R", correct = TRUE), answer("server.R"), answer("app.R"), - answer("ui.R et server.R") + answer("ui.R et server.R"), + allow_retry = TRUE ), question("Quel est le composant qui permet de définir le serveur dans une application Shiny ?", answer("server.R", correct = TRUE), answer("ui.R"), answer("app.R"), - answer("ui.R et server.R") + answer("ui.R et server.R"), + allow_retry = TRUE ) ) ``` @@ -68,26 +73,32 @@ quiz( answer("5"), answer("8"), answer("9"), - answer("12", correct = TRUE) + answer("12", correct = TRUE), + allow_retry = TRUE ), question("Quelle fonction permet de créer une page avec une barre latérale dans une application Shiny ?", answer("sidebarLayout", correct = TRUE), answer("pageWithSidebar", message="déprécié, utiliser sidebarLayout"), answer("pageWithFooter"), - answer("fluidPage") + answer("fluidPage"), + allow_retry = TRUE ), question("Quelles fonctions permettent de créer un layout multipages dans une application Shiny ?", answer("navbarPage", correct = TRUE), answer("tabsetPanel", correct = TRUE), answer("navlistPanel", correct = TRUE), - answer("fluidPanel") + answer("fluidPanel"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quels sont les frameworks pour développer des dashboards en shiny?", answer("shinydashboard", correct = TRUE), answer("shinybootstrap"), answer("shiny.semantic", correct = TRUE), answer("bslib", correct = TRUE), - answer("bs4Dash", correct = TRUE) + answer("bs4Dash", correct = TRUE), + allow_retry = TRUE, + random_answer_order = TRUE ) ) ``` @@ -100,19 +111,25 @@ quiz( answer("wordInput"), answer("selectInput"), answer("numericInput"), - answer("textInput", correct = TRUE) + answer("textInput", correct = TRUE), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction permet de créer un menu déroulant dans une application Shiny ?", answer("wordInput"), answer("selectInput", correct = TRUE), answer("numericInput"), - answer("textInput") + answer("textInput"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction permet de créer un champ numérique dans une application Shiny ?", answer("wordInput"), answer("selectInput"), answer("numericInput", correct = TRUE), - answer("textInput") + answer("textInput"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quels sont les types d'input disponibles dans une application Shiny ?", answer("text", correct = TRUE), @@ -124,13 +141,16 @@ quiz( answer("radio", correct = TRUE), answer("address"), answer("file", correct = TRUE), + allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de créer un curseur numérique dans une application Shiny ?", answer("sliderInput", correct = TRUE), answer("selectInput"), answer("numericInput"), - answer("textInput") + answer("textInput"), + allow_retry = TRUE, + random_answer_order = TRUE ) ) @@ -144,25 +164,33 @@ quiz( answer("renderPlot", correct = TRUE), answer("renderTable"), answer("renderPrint"), - answer("renderDataTable") + answer("renderDataTable"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un tableau dans une application Shiny ?", answer("renderTable", correct = TRUE), answer("renderPlot"), answer("renderPrint"), - answer("renderDataTable") + answer("renderDataTable"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un texte dans une application Shiny ?", answer("renderPrint", correct = TRUE), answer("renderTable"), answer("renderPlot"), - answer("renderDataTable") + answer("renderDataTable"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un tableau dynamique dans une application Shiny ?", answer("renderDataTable", correct = TRUE), answer("renderTable"), answer("renderPrint"), - answer("renderPlot") + answer("renderPlot"), + allow_retry = TRUE, + random_answer_order = TRUE ) ) @@ -176,25 +204,33 @@ quiz( answer("plotOutput", correct = TRUE), answer("tableOutput"), answer("printOutput"), - answer("dataTableOutput") + answer("dataTableOutput"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction permet de générer un tableau dans une application Shiny ?", answer("tableOutput", correct = TRUE), answer("plotOutput"), answer("printOutput"), - answer("dataTableOutput") + answer("dataTableOutput"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction permet de générer un texte dans une application Shiny ?", answer("printOutput", correct = TRUE), answer("tableOutput"), answer("plotOutput"), - answer("dataTableOutput") + answer("dataTableOutput"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction permet de générer un tableau dynamique dans une application Shiny ?", answer("dataTableOutput", correct = TRUE), answer("tableOutput"), answer("printOutput"), - answer("plotOutput") + answer("plotOutput"), + allow_retry = TRUE, + random_answer_order = TRUE ) ) ``` @@ -207,32 +243,42 @@ quiz( answer("reactive", correct = TRUE), answer("radioactive"), answer("renderactive"), - answer("proactive") + answer("proactive"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction reactive permet d'isoler une action dans une application Shiny ?", answer("isolate", correct = TRUE), answer("cache-cache"), answer("lockdown"), - answer("iwanttobreakfree") + answer("iwanttobreakfree"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle fonction reactive permet de générer une dépendance à une seule variable dans une application Shiny ?", answer("reactiveVal", correct = TRUE), answer("reactiveValues", message = "reactiveValues() est une fonction qui permet de stocker plusieurs valeurs réactives"), answer("reactorVal"), - answer("proactorValues") + answer("proactorValues"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quand peut-on utiliser la fonction observe() dans une application Shiny ?", answer("Pour modifier un object reactiveValues", correct = TRUE), answer("Pour déclencher l'affichage d'une fenêtre contextuelle", correct = TRUE), answer("Pour envoyer un email"), - answer("Pour modifier un élément de l'interface utilisateur") + answer("Pour modifier un élément de l'interface utilisateur"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelle(s) fonction(s) reactive permet(tent) de générer une dépendance à un évènement et d'éxécuter une action dans une application Shiny ?", answer("observeEvent", correct = TRUE), answer("observe"), answer("eventReactive", correct = TRUE), answer("observeInput"), - answer("reactiveEvent") + answer("reactiveEvent"), + allow_retry = TRUE, + random_answer_order = TRUE ) ) ``` @@ -245,7 +291,9 @@ quiz( answer("Shinyapps.io", correct = TRUE), answer("Posit Connect", correct = TRUE), answer("Shiny Server", correct = TRUE), - answer("Shiny Cloud") + answer("Shiny Cloud"), + allow_retry = TRUE, + random_answer_order = TRUE ), question("Quelles solutions de déploiement utilise docker pour déployer une application Shiny ?", answer("shinyproxy", correct = TRUE), @@ -253,7 +301,9 @@ quiz( answer("Shiny Server"), answer("SK8", correct = TRUE), answer("binder", correct = TRUE), - answer("Hugging Face Spaces", correct = TRUE) + answer("Hugging Face Spaces", correct = TRUE), + allow_retry = TRUE, + random_answer_order = TRUE ) ) -- GitLab From ce51356917cd7f11ac1594bc732471fcebfa949f Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Tue, 26 Mar 2024 23:52:06 +0100 Subject: [PATCH 2/9] add help messages to answers in shiny app structure quizz --- shiny_tutorial/shiny_tutorial.Rmd | 62 +++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 92f3487..a79fbd0 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -28,38 +28,60 @@ library(learnr) ```{r shiny-quizz-0, echo=FALSE} quiz( question("Qu'est-ce que Shiny?", - answer("Un framework pour créer des applications web interactives avec R", correct = TRUE), - answer("Une espèce de pokémon rare"), - answer("Une crème contre les rayons bleus des écrans"), - answer("Un framework pour créer des applications web interactives avec Python", correct = TRUE), + answer("Un framework pour créer des applications web interactives avec R", + correct = TRUE, + message = "[Shiny for R](https://shiny.posit.co/)"), + answer("Une espèce de pokémon rare", + message = "Il existe bien des pokémon dits chromatiques (brillants ou encore shiny): [pour en savoir plus](https://www.pokepedia.fr/Pok%C3%A9mon_chromatique), mais ce n'est pas la réponse attendue."), + answer("Une crème contre les rayons bleus des écrans", + message = "Il existe bien des crèmes pour protéger la peau des rayons UV, mais ce n'est pas la réponse attendue."), + answer("Un framework pour créer des applications web interactives avec Python", + correct = TRUE, + message = "[Shiny for Python](https://shiny.posit.co/py/)"), allow_retry = TRUE ), question("Combien de composants sont nécessaires pour créer une application Shiny ?", - answer("1"), - answer("2", correct = TRUE), - answer("3"), - answer("4"), + answer("1", message = "un seul composant ne suffit pas pour créer une application Shiny"), + answer("2", correct = TRUE, + message = "[Two-file Shiny apps](https://shiny.posit.co/r/articles/build/two-file/)"), + answer("3", message = "trois composants ne sont pas nécessaires pour créer une application Shiny"), + answer("4", message = "quatre composants ne sont pas nécessaires pour créer une application Shiny"), allow_retry = TRUE ), question("Quels sont les deux composants nécessaires pour créer une application Shiny ?", - answer("ui.R et server.R", correct = TRUE), - answer("ui.R et app.R"), - answer("server.R et app.R"), - answer("ui.R et ui.R"), + answer("ui.R et server.R", + correct = TRUE, + message = "[Two-file Shiny apps](https://shiny.posit.co/r/articles/build/two-file/)"), + answer("ui.R et app.R", + message = "c'est presque ça, mais il manque un composant"), + answer("server.R et app.R", + message = "c'est presque ça, mais il manque un composant"), + answer("hihi.R et byebye.R", + message = "sérieusement ?"), allow_retry = TRUE ), question("Quel est le composant qui permet de définir l'interface utilisateur dans une application Shiny ?", - answer("ui.R", correct = TRUE), - answer("server.R"), - answer("app.R"), - answer("ui.R et server.R"), + answer("ui.R", + correct = TRUE, + message = "[ui.R](https://shiny.posit.co/r/getstarted/build-an-app/hello-shiny/user-interface.html)"), + answer("server.R", + message = "pour le serveur comme le dit le nom de fichier"), + answer("app.R", + message = "app.R est un fichier qui permet de combiner ui.R et server.R"), + answer("ui.R et server.R", + message = "ui.R et server.R sont les deux composants nécessaires pour créer une application Shiny"), allow_retry = TRUE ), question("Quel est le composant qui permet de définir le serveur dans une application Shiny ?", - answer("server.R", correct = TRUE), - answer("ui.R"), - answer("app.R"), - answer("ui.R et server.R"), + answer("server.R", + correct = TRUE, + message = "[server.R](https://shiny.posit.co/r/getstarted/build-an-app/hello-shiny/server-function.html)"), + answer("ui.R", + message = "pour l'interface utilisateur comme le dit le nom de fichier"), + answer("app.R", + message = "app.R est un fichier qui permet de combiner ui.R et server.R"), + answer("ui.R et server.R", + message = "ui.R et server.R sont les deux composants nécessaires pour créer une application Shiny"), allow_retry = TRUE ) ) -- GitLab From 84ef76746cea9eeaf30aea9f757bb95eae7edb3c Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 00:13:57 +0100 Subject: [PATCH 3/9] add help messages to answers in shiny layout quizz --- shiny_tutorial/shiny_tutorial.Rmd | 58 ++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index a79fbd0..1a46ac0 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -92,33 +92,57 @@ quiz( ```{r shiny-quizz-1, echo=FALSE} quiz( question("En combien de colonnes est divisée une ligne dans une application Shiny ?", - answer("5"), - answer("8"), - answer("9"), - answer("12", correct = TRUE), + answer("5", + message = "beaucoup plus"), + answer("8", + message = "bien plus"), + answer("9", + message = "encore plus"), + answer("12", correct = TRUE, + message = "[grid with of a column should be between 1 and 12](https://rstudio.github.io/shiny/reference/column.html)"), allow_retry = TRUE ), question("Quelle fonction permet de créer une page avec une barre latérale dans une application Shiny ?", - answer("sidebarLayout", correct = TRUE), - answer("pageWithSidebar", message="déprécié, utiliser sidebarLayout"), - answer("pageWithFooter"), - answer("fluidPage"), + answer("sidebarLayout", + correct = TRUE, + message = "[voir sidebarLayout](https://rstudio.github.io/shiny/reference/sidebarLayout.html)"), + answer("pageWithSidebar", message="[déprécié](https://shiny.posit.co/r/reference/shiny/latest/pagewithsidebar), utiliser sidebarLayout"), + answer("pageWithFooter", + message = "pageWithFooter n'existe pas"), + answer("fluidPage", + message = "fluidPage permet de créer une page avec un contenu fluide: [voir fluidPage](https://rstudio.github.io/shiny/reference/fluidPage.html)"), allow_retry = TRUE ), question("Quelles fonctions permettent de créer un layout multipages dans une application Shiny ?", - answer("navbarPage", correct = TRUE), - answer("tabsetPanel", correct = TRUE), - answer("navlistPanel", correct = TRUE), - answer("fluidPanel"), + answer("navbarPage", + correct = TRUE, + message = "[navbarPage](https://rstudio.github.io/shiny/reference/navbarPage.html)"), + answer("tabsetPanel", + correct = TRUE, + message = "[tabsetPanel](https://shiny.posit.co/r/reference/shiny/latest/tabsetpanel)"), + answer("navlistPanel", + correct = TRUE, + message = "[navlistPanel](https://rstudio.github.io/shiny/reference/navlistPanel.html)"), + answer("fluidPanel", + message = "fluidPanel n'existe pas"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quels sont les frameworks pour développer des dashboards en shiny?", - answer("shinydashboard", correct = TRUE), - answer("shinybootstrap"), - answer("shiny.semantic", correct = TRUE), - answer("bslib", correct = TRUE), - answer("bs4Dash", correct = TRUE), + answer("shinydashboard", + correct = TRUE, + message = "[shinydashboard](https://rstudio.github.io/shinydashboard/)"), + answer("shinybootstrap", + message = "shinybootstrap n'existe pas"), + answer("shiny.semantic", + correct = TRUE, + message = "[shiny.semantic](https://appsilon.github.io/shiny.semantic/)"), + answer("bslib", + correct = TRUE, + message = "[bslib](https://rstudio.github.io/bslib/)"), + answer("bs4Dash", + correct = TRUE, + message = "[bs4Dash](https://rinterface.github.io/bs4Dash/index.html)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From a51f7fa305e18cc770a5ecb2c36fc6ededd7ca5c Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 00:30:20 +0100 Subject: [PATCH 4/9] add help messages in answers for UI input functions quizz --- shiny_tutorial/shiny_tutorial.Rmd | 79 ++++++++++++++++++++++--------- 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 1a46ac0..e663238 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -154,47 +154,80 @@ quiz( ```{r shiny-quizz-2, echo=FALSE} quiz( question("Quelle fonction permet de créer un champ de texte dans une application Shiny ?", - answer("wordInput"), - answer("selectInput"), - answer("numericInput"), - answer("textInput", correct = TRUE), + answer("wordInput", + message = "wordInput n'existe pas"), + answer("selectInput", + message = "selectInput permet de créer un menu déroulant: [voir selectInput](https://rstudio.github.io/shiny/reference/selectInput.html)"), + answer("numericInput", + message = "numericInput permet de créer un champ numérique: [voir numericInput](https://rstudio.github.io/shiny/reference/numericInput.html)"), + answer("textInput", + correct = TRUE, + message = "[voir textInput](https://rstudio.github.io/shiny/reference/textInput.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de créer un menu déroulant dans une application Shiny ?", - answer("wordInput"), - answer("selectInput", correct = TRUE), - answer("numericInput"), - answer("textInput"), + answer("wordInput", + message = "wordInput n'existe pas"), + answer("selectInput", + correct = TRUE, + message = "[voir selectInput](https://rstudio.github.io/shiny/reference/selectInput.html)"), + answer("numericInput", + message = "numericInput permet de créer un champ numérique: [voir numericInput](https://rstudio.github.io/shiny/reference/numericInput.html)"), + answer("textInput", + message = "textInput permet de créer un champ de texte: [voir textInput](https://rstudio.github.io/shiny/reference/textInput.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de créer un champ numérique dans une application Shiny ?", - answer("wordInput"), - answer("selectInput"), - answer("numericInput", correct = TRUE), + answer("wordInput", + message = "wordInput n'existe pas"), + answer("selectInput", + message = "selectInput permet de créer un menu déroulant: [voir selectInput](https://rstudio.github.io/shiny/reference/selectInput.html)"), + answer("numericInput", + correct = TRUE, + message = "[voir numericInput](https://rstudio.github.io/shiny/reference/numericInput.html)"), answer("textInput"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quels sont les types d'input disponibles dans une application Shiny ?", - answer("text", correct = TRUE), - answer("numeric", correct = TRUE), - answer("date", correct = TRUE), - answer("box"), - answer("email", correct = TRUE), - answer("checkbox", correct = TRUE), - answer("radio", correct = TRUE), + answer("text", + correct = TRUE, + message = "[voir text](https://rstudio.github.io/shiny/reference/textInput.html)"), + answer("numeric", + correct = TRUE, + message = "[voir numeric](https://rstudio.github.io/shiny/reference/numericInput.html)"), + answer("date", + correct = TRUE, + message = "[voir date](https://rstudio.github.io/shiny/reference/dateInput.html)"), + answer("box", + message = "box n'est pas un type d'input"), + answer("email", + message = "email n'est pas un type d'input"), + answer("checkbox", + correct = TRUE, + message = "[voir checkbox](https://rstudio.github.io/shiny/reference/checkboxInput.html)"), + answer("radio", + correct = TRUE, + message = "[voir radio](https://rstudio.github.io/shiny/reference/radioButtons.html)"), answer("address"), - answer("file", correct = TRUE), + answer("file", + correct = TRUE, + message = "[voir file](https://rstudio.github.io/shiny/reference/fileInput.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de créer un curseur numérique dans une application Shiny ?", - answer("sliderInput", correct = TRUE), - answer("selectInput"), - answer("numericInput"), - answer("textInput"), + answer("sliderInput", + correct = TRUE, + message = "[voir sliderInput](https://rstudio.github.io/shiny/reference/sliderInput.html)"), + answer("selectInput", + message = "selectInput permet de créer un menu déroulant: [voir selectInput](https://rstudio.github.io/shiny/reference/selectInput.html)"), + answer("numericInput", + message = "numericInput permet de créer un champ numérique: [voir numericInput](https://rstudio.github.io/shiny/reference/numericInput.html)"), + answer("textInput", + message = "textInput permet de créer un champ de texte: [voir textInput](https://rstudio.github.io/shiny/reference/textInput.html)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From b087bf76c9e8b9c2eafac069778570c618e0245d Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 00:37:24 +0100 Subject: [PATCH 5/9] add helper messages in anwsers for server rendering functions quizz --- shiny_tutorial/shiny_tutorial.Rmd | 52 +++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index e663238..7b568bc 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -240,34 +240,54 @@ quiz( ```{r shiny-quizz-3, echo=FALSE} quiz( question("Quelle est la fonction qui permet de générer un graphique dans une application Shiny ?", - answer("renderPlot", correct = TRUE), - answer("renderTable"), - answer("renderPrint"), - answer("renderDataTable"), + answer("renderPlot", + correct = TRUE, + message = "[renderPlot](https://rstudio.github.io/shiny/reference/renderPlot.html)"), + answer("renderTable", + message = "renderTable permet de générer un tableau: [voir renderTable](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("renderPrint", + message = "renderPrint permet de générer un texte: [voir renderPrint](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("renderDataTable", + message = "renderDataTable permet de générer un tableau dynamique: [voir renderDataTable](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un tableau dans une application Shiny ?", - answer("renderTable", correct = TRUE), - answer("renderPlot"), - answer("renderPrint"), - answer("renderDataTable"), + answer("renderTable", + correct = TRUE, + message = "[renderTable](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("renderPlot", + message = "renderPlot permet de générer un graphique: [voir renderPlot](https://rstudio.github.io/shiny/reference/renderPlot.html)"), + answer("renderPrint", + message = "renderPrint permet de générer un texte: [voir renderPrint](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("renderDataTable", + message = "renderDataTable permet de générer un tableau dynamique: [voir renderDataTable](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un texte dans une application Shiny ?", - answer("renderPrint", correct = TRUE), - answer("renderTable"), - answer("renderPlot"), - answer("renderDataTable"), + answer("renderPrint", + correct = TRUE, + message = "[renderPrint](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("renderTable", + message = "renderTable permet de générer un tableau: [voir renderTable](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("renderPlot", + message = "renderPlot permet de générer un graphique: [voir renderPlot](https://rstudio.github.io/shiny/reference/renderPlot.html)"), + answer("renderDataTable", + message = "renderDataTable permet de générer un tableau dynamique: [voir renderDataTable](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle est la fonction qui permet de générer un tableau dynamique dans une application Shiny ?", - answer("renderDataTable", correct = TRUE), - answer("renderTable"), - answer("renderPrint"), - answer("renderPlot"), + answer("renderDataTable", + correct = TRUE, + message = "[renderDataTable](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), + answer("renderTable", + message = "renderTable permet de générer un tableau: [voir renderTable](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("renderPrint", + message = "renderPrint permet de générer un texte: [voir renderPrint](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("renderPlot", + message = "renderPlot permet de générer un graphique: [voir renderPlot](https://rstudio.github.io/shiny/reference/renderPlot.html)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From ec9e56fa04723bece1e1838538964cb5126445ee Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 00:48:35 +0100 Subject: [PATCH 6/9] add helper messages in answers for UI output functions quizz --- shiny_tutorial/shiny_tutorial.Rmd | 55 +++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 7b568bc..902d65c 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -300,34 +300,55 @@ quiz( ```{r shiny-quizz-4, echo=FALSE} quiz( question("Quelle fonction permet de générer un graphique dans une application Shiny ?", - answer("plotOutput", correct = TRUE), - answer("tableOutput"), - answer("printOutput"), - answer("dataTableOutput"), + answer("plotOutput", + correct = TRUE, + message = "[plotOutput](https://rstudio.github.io/shiny/reference/plotOutput.html)"), + answer("tableOutput", + message = "tableOutput permet de générer un tableau: [voir tableOutput](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("textOutput", + message = "textOutput permet de générer un texte: [voir printOutput](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("dataTableOutput", + message = "dataTableOutput permet de générer un tableau dynamique: [voir dataTableOutput](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de générer un tableau dans une application Shiny ?", - answer("tableOutput", correct = TRUE), - answer("plotOutput"), - answer("printOutput"), - answer("dataTableOutput"), + answer("tableOutput", + correct = TRUE, + message = "[tableOutput](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("plotOutput", + message = "plotOutput permet de générer un graphique: [voir plotOutput](https://rstudio.github.io/shiny/reference/plotOutput.html)"), + answer("textOutput", + message = "textOutput permet de générer un texte: [voir textOutput](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("dataTableOutput", + message = "dataTableOutput permet de générer un tableau dynamique: [voir dataTableOutput](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), - question("Quelle fonction permet de générer un texte dans une application Shiny ?", - answer("printOutput", correct = TRUE), - answer("tableOutput"), - answer("plotOutput"), - answer("dataTableOutput"), + question("Quelles fonctions permettent de générer un texte dans une application Shiny ?", + answer("textOutput", + correct = TRUE, + message = "[printOutput](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("tableOutput", + message = "tableOutput permet de générer un tableau: [voir tableOutput](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("verbatimTextOutput", + correct = TRUE, + message = "[verbatimTextOutput](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("dataTableOutput", + message = "dataTableOutput permet de générer un tableau dynamique: [voir dataTableOutput](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction permet de générer un tableau dynamique dans une application Shiny ?", - answer("dataTableOutput", correct = TRUE), - answer("tableOutput"), - answer("printOutput"), - answer("plotOutput"), + answer("dataTableOutput", + correct = TRUE, + message = "[dataTableOutput](https://rstudio.github.io/shiny/reference/renderDataTable.html)"), + answer("tableOutput", + message = "tableOutput permet de générer un tableau: [voir tableOutput](https://rstudio.github.io/shiny/reference/renderTable.html)"), + answer("textOutput", + message = "textOutput permet de générer un texte: [voir textOutput](https://rstudio.github.io/shiny/reference/renderPrint.html)"), + answer("plotOutput", + message = "plotOutput permet de générer un graphique: [voir plotOutput](https://rstudio.github.io/shiny/reference/plotOutput.html)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From fc2945c494f6d8de763b9f1e29c28a93428ed972 Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 00:59:08 +0100 Subject: [PATCH 7/9] add helper messages in answers for reactive expressions quizz --- shiny_tutorial/shiny_tutorial.Rmd | 73 ++++++++++++++++++++++--------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 902d65c..40375f6 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -360,43 +360,74 @@ quiz( ```{r shiny-quizz-5, echo=FALSE} quiz( question("Quelle fonction permet de créer une dépendance entre un input côté UI et une autre expression côté serveur dans une application Shiny ?", - answer("reactive", correct = TRUE), - answer("radioactive"), - answer("renderactive"), - answer("proactive"), + answer("reactive", + correct = TRUE, + message = "[reactive](https://rstudio.github.io/shiny/reference/reactive.html)"), + answer("radioactive", + message = "radioactive n'est pas une fonction de Shiny"), + answer("renderactive", + message = "renderactive n'est pas une fonction de Shiny"), + answer("proactive", + message = "proactive n'est pas une fonction de Shiny"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction reactive permet d'isoler une action dans une application Shiny ?", - answer("isolate", correct = TRUE), - answer("cache-cache"), - answer("lockdown"), - answer("iwanttobreakfree"), + answer("isolate", + correct = TRUE, + message = "[isolate](https://rstudio.github.io/shiny/reference/isolate.html)"), + answer("cache-cache", + message = "cache-cache n'est pas une fonction de Shiny, mais vous connaissez bien le jeu"), + answer("lockdown", + message = "lockdown n'est pas une fonction de Shiny, mais vous connaissez bien le confinement"), + answer("iwanttobreakfree", + message = "iwanttobreakfree n'est pas une fonction de Shiny, mais vous connaissez bien la chanson"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle fonction reactive permet de générer une dépendance à une seule variable dans une application Shiny ?", - answer("reactiveVal", correct = TRUE), - answer("reactiveValues", message = "reactiveValues() est une fonction qui permet de stocker plusieurs valeurs réactives"), - answer("reactorVal"), - answer("proactorValues"), + answer("reactiveVal", + correct = TRUE, + message = "[reactiveVal](https://rstudio.github.io/shiny/reference/reactiveVal.html)"), + answer("reactiveValues", + message = "reactiveValues() est une fonction qui permet de stocker plusieurs valeurs réactives [reactiveValues](https://rstudio.github.io/shiny/reference/reactiveValues.html)"), + answer("reactorVal", + message = "reactorVal n'est pas une fonction de Shiny"), + answer("proactorValues", + message = "proactorValues n'est pas une fonction de Shiny"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quand peut-on utiliser la fonction observe() dans une application Shiny ?", - answer("Pour modifier un object reactiveValues", correct = TRUE), - answer("Pour déclencher l'affichage d'une fenêtre contextuelle", correct = TRUE), - answer("Pour envoyer un email"), - answer("Pour modifier un élément de l'interface utilisateur"), + answer("Pour modifier un object reactiveValues", + correct = TRUE, + message = "[observe](https://rstudio.github.io/shiny/reference/observe.html)"), + answer("Pour déclencher l'affichage d'une fenêtre contextuelle", + correct = TRUE, + message = "[observe](https://rstudio.github.io/shiny/reference/observe.html)"), + answer("Pour envoyer un email", + message = "observe() n'est pas une fonction pour envoyer un email"), + answer("Pour modifier un élément de l'interface utilisateur", + message = "observe() n'est pas une fonction pour modifier un élément de l'interface utilisateur"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelle(s) fonction(s) reactive permet(tent) de générer une dépendance à un évènement et d'éxécuter une action dans une application Shiny ?", - answer("observeEvent", correct = TRUE), - answer("observe"), - answer("eventReactive", correct = TRUE), - answer("observeInput"), - answer("reactiveEvent"), + answer("observeEvent", + correct = TRUE, + message = "[observeEvent](https://rstudio.github.io/shiny/reference/observeEvent.html)"), + answer("observe", + message = "observe() n'est pas une fonction pour générer une dépendance à un évènement"), + answer("eventReactive", + correct = TRUE, + message = "[eventReactive](https://rstudio.github.io/shiny/reference/observeEvent.html)"), + answer("observeInput", + message = "observeInput n'est pas une fonction pour générer une dépendance à un évènement"), + answer("reactiveEvent", + message = "reactiveEvent n'est pas une fonction pour générer une dépendance à un évènement"), + answer("bindEvent", + correct = TRUE, + message = "[bindEvent](https://rstudio.github.io/shiny/reference/observeEvent.html)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From c7b988c9eb9f361dcb8bdb8287c8e5aec371197c Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 01:06:57 +0100 Subject: [PATCH 8/9] add helper messages in answersfor shiny app deployment solutions quizz --- shiny_tutorial/shiny_tutorial.Rmd | 37 ++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 40375f6..10c6620 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -439,20 +439,37 @@ quiz( ```{r shiny-quizz-6, echo=FALSE} quiz( question("Quelles sont les solutions existantes pour déployer une application Shiny ?", - answer("Shinyapps.io", correct = TRUE), - answer("Posit Connect", correct = TRUE), - answer("Shiny Server", correct = TRUE), - answer("Shiny Cloud"), + answer("Shinyapps.io", + correct = TRUE, + message = "[Shinyapps.io](https://www.shinyapps.io/)"), + answer("Posit Connect", + correct = TRUE, + message = "[Posit Connect](https://posit.co/products/enterprise/connect/)"), + answer("Shiny Server", + correct = TRUE, + message = "[Shiny Server](https://www.rstudio.com/products/shiny/shiny-server/)"), + answer("Shiny Cloud", + message = "Shiny Cloud n'existe pas"), allow_retry = TRUE, random_answer_order = TRUE ), question("Quelles solutions de déploiement utilise docker pour déployer une application Shiny ?", - answer("shinyproxy", correct = TRUE), - answer("Posit Connect"), - answer("Shiny Server"), - answer("SK8", correct = TRUE), - answer("binder", correct = TRUE), - answer("Hugging Face Spaces", correct = TRUE), + answer("shinyproxy", + correct = TRUE, + message = "[shinyproxy](https://www.shinyproxy.io/)"), + answer("Posit Connect", + message = "Posit Connect n'utilise pas docker pour déployer une application Shiny"), + answer("Shiny Server", + message = "Shiny Server n'utilise pas docker pour déployer une application Shiny"), + answer("SK8", + correct = TRUE, + message = "SK8 utilise une infrastructure basé sur docker/Kubernetes pour déployer une application Shiny [SK8](https://sk8.inrae.fr)"), + answer("binder", + correct = TRUE, + message = "binder utilise une infrastructure basé sur docker pour déployer une application Shiny [binder](https://mybinder.org)"), + answer("Hugging Face Spaces", + correct = TRUE, + message = "Hugging Face Spaces utilise une infrastructure basé sur docker pour déployer une application Shiny [Hugging Face Spaces](https://huggingface.co/spaces)"), allow_retry = TRUE, random_answer_order = TRUE ) -- GitLab From d1ea59095ce3775d9c31cbe78e25d2b6ca77f36a Mon Sep 17 00:00:00 2001 From: Joseph Tran <joseph.tran@inrae.fr> Date: Wed, 27 Mar 2024 01:14:19 +0100 Subject: [PATCH 9/9] update shinyproxy help message --- shiny_tutorial/shiny_tutorial.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shiny_tutorial/shiny_tutorial.Rmd b/shiny_tutorial/shiny_tutorial.Rmd index 10c6620..9c10e0c 100644 --- a/shiny_tutorial/shiny_tutorial.Rmd +++ b/shiny_tutorial/shiny_tutorial.Rmd @@ -456,7 +456,7 @@ quiz( question("Quelles solutions de déploiement utilise docker pour déployer une application Shiny ?", answer("shinyproxy", correct = TRUE, - message = "[shinyproxy](https://www.shinyproxy.io/)"), + message = "Shinyproxy utilise une infrastructure basé sur docker pour déployer une application Shiny [shinyproxy](https://www.shinyproxy.io/)"), answer("Posit Connect", message = "Posit Connect n'utilise pas docker pour déployer une application Shiny"), answer("Shiny Server", -- GitLab