From 240635372a87b97c32132c03ee60bf608b834439 Mon Sep 17 00:00:00 2001 From: mitchelloharawild Date: Thu, 16 Jan 2025 13:06:48 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20numbats/?= =?UTF-8?q?moodlequiz@da2f2a6e1b54fb14023f9d29dfe5033a5ba03db6=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgdown.yml | 2 +- reference/cloze_questions.html | 45 +++++++++++++++++++++++++++++++++- search.json | 2 +- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/pkgdown.yml b/pkgdown.yml index c767c1c..b320027 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -2,7 +2,7 @@ pandoc: 3.1.11 pkgdown: 2.1.1 pkgdown_sha: ~ articles: {} -last_built: 2025-01-16T08:30Z +last_built: 2025-01-16T13:06Z urls: reference: http://emitanaka.org/moodlequiz/reference article: http://emitanaka.org/moodlequiz/articles diff --git a/reference/cloze_questions.html b/reference/cloze_questions.html index 265dea4..63b59d5 100644 --- a/reference/cloze_questions.html +++ b/reference/cloze_questions.html @@ -128,7 +128,50 @@

Functions

Examples

- +
# Short-answer question: Where is the best coffee?
+cloze_shortanswer(
+  options = c("Melbourne" = 1),
+  case_sensitive = FALSE
+)
+#> [1] "`{1:SHORTANSWER:%100%Melbourne#}`{=html}"
+
+# Multiple-choice question: Select all lower-case answers
+cloze_multichoice(
+  options = c("a" = 1, "F" = 0, "g" = 1, "V" = 0, "K" = 0),
+  type = "vertical"
+)
+#> [1] "`{1:MULTIRESPONSE:%100%a#~%0%F#~%100%g#~%0%V#~%0%K#}`{=html}"
+
+# Where is Melbourne?
+cloze_singlechoice(
+  choices(
+    c("New South Wales", "Victoria", "Queensland", "Western Australia",
+      "South Australia", "Tasmania", "Australian Capital Territory",
+      "Northern Territory"),
+    "Victoria"
+  ),
+  type = "dropdown"
+)
+#> [1] "`{1:MULTICHOICE:%0%New South Wales#~%100%Victoria#~%0%Queensland#~%0%Western Australia#~%0%South Australia#~%0%Tasmania#~%0%Australian Capital Territory#~%0%Northern Territory#}`{=html}"
+
+# Numerical question: Pick a number between 1 and 10
+cloze_numerical(
+  answer = 5.5,
+  tolerance = 4.5
+)
+#> [1] "`{1:NUMERICAL:=5.500000:4.500000#}`{=html}"
+
+# Automatic cloze questions
+cloze(42) # Numerical
+#> [1] "`{1:NUMERICAL:=42.000000:0.000000#}`{=html}"
+cloze("Australia") # Short answer
+#> [1] "`{1:SHORTANSWER:%100%Australia#}`{=html}"
+cloze("rep_len", c("rep", "rep.int", "rep_len", "replicate")) # Single choice
+#> [1] "`{1:MULTICHOICE:%0%rep#~%0%rep.int#~%100%rep_len#~%0%replicate#}`{=html}"
+cloze(c("A", "B", "C"), letters) # Multiple choice
+#> Error in choices(choices, x): The correct answer does not exist in the provided options.
+
+
diff --git a/search.json b/search.json index ce56140..5feb365 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"http://emitanaka.org/moodlequiz/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Emi Tanaka. Author, maintainer. Mitchell O'Hara-Wild. Author.","code":""},{"path":"http://emitanaka.org/moodlequiz/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tanaka E, O'Hara-Wild M (2025). moodlequiz: R Markdown format Moodle XML cloze quizzes. R package version 0.1.0.9001, http://emitanaka.org/moodlequiz/, https://github.com/emitanaka/moodlequiz.","code":"@Manual{, title = {moodlequiz: R Markdown format for Moodle XML cloze quizzes}, author = {Emi Tanaka and Mitchell O'Hara-Wild}, year = {2025}, note = {R package version 0.1.0.9001, http://emitanaka.org/moodlequiz/}, url = {https://github.com/emitanaka/moodlequiz}, }"},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"moodlequiz","dir":"","previous_headings":"","what":"R Markdown format for Moodle XML cloze quizzes","title":"R Markdown format for Moodle XML cloze quizzes","text":"moodlequiz R package allows creation Moodle quiz questions using literate programming R Markdown. makes easy quickly create quiz can randomly replicated new datasets, questions, options answers.","code":""},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R Markdown format for Moodle XML cloze quizzes","text":"can install development version moodlequiz like :","code":"remotes::install_github(\"numbats/moodlequiz\")"},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"R Markdown format for Moodle XML cloze quizzes","text":"Moodle quiz students select right variables data map onto plot aesthetics ggplot2. quiz created R Markdown document . Knitting document generate 5 different versions quiz x, y, color, size mapped randomly one variables mtcars data.","code":"--- title: Drawing a scatterplot output: moodlequiz::moodlequiz: replicates: 5 moodlequiz: category: datavis-scatterplots --- # Data ```{r setup, include = FALSE} library(tidyverse) library(rlang) library(moodlequiz) knitr::opts_chunk$set(echo = FALSE, results = \"hide\", fig.height = 4, fig.width = 5, fig.path = \"\", fig.cap = \"\", fig.align = \"center\") ``` ```{r data} cols <- colnames(mtcars) cats <- c(\"cyl\", \"vs\", \"am\", \"gear\", \"carb\") nums <- setdiff(cols, cats) x <- sample(nums, 1) y <- sample(setdiff(nums, x), 1) color <- sample(cats, 1) size <- sample(setdiff(nums, c(x, y)), 1) ``` You have been asked to analyse the `mtcars` data. The variables and the class types of the data is shown below. ```{r, echo = TRUE, results = \"show\"} str(mtcars) ``` # Plot As a starting point, you decide to draw a scatter plot for some variables. Complete the code below to get the target plot below: ```r ggplot(mtcars, aes(x = `r cloze(x, cols)`, y = `r cloze(y, cols)`, color = factor(`r cloze(color, cols)`), size = `r cloze(size, cols)`)) + `r cloze(\"geom_point\", ls(envir = as.environment(\"package:ggplot2\"), pattern = \"^geom_\"))`() ``` ```{r, results = \"show\"} ggplot(mtcars, aes(!!sym(x), !!sym(y), size = !!sym(size), color = factor(!!sym(color)))) + geom_point() + theme(plot.background = element_rect(color = \"black\")) ```"},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a set of choices for single or multiple choice questions — choices","title":"Create a set of choices for single or multiple choice questions — choices","text":"Create set choices single multiple choice questions","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a set of choices for single or multiple choice questions — choices","text":"","code":"choices(options, answer)"},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a set of choices for single or multiple choice questions — choices","text":"options character vector selectable choices answer character vector correct answers","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Cloze-Type Questions for Moodle — cloze_questions","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"functions create cloze-type questions Moodle quizzes, designed use inline R code chunks R Markdown document formatted moodlequiz::moodlequiz output format.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"","code":"cloze_shortanswer( options, weight = max(options), feedback = \"\", case_sensitive = FALSE ) cloze_multichoice( options, weight = max(options), feedback = \"\", type = c(\"vertical\", \"horizontal\"), shuffle = FALSE ) cloze_singlechoice( options, weight = max(options), feedback = \"\", type = c(\"dropdown\", \"vertical\", \"horizontal\"), shuffle = FALSE ) cloze_numerical(answer, weight = 1, tolerance = 0, feedback = \"\") cloze(x, ...)"},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"options named vector answer options. single/multiple choice questions choices() helper function can help create vector. Names correspond answers, values specify weights (e.g., 100 correct answer partial weights partially correct answers). multiple-choice single-choice questions, includes correct distractor options. weight numeric value specifying weight question. Defaults highest weight options. feedback character vector providing feedback answers. case_sensitive Logical. cloze_shortanswer, whether answer case-sensitive. Defaults FALSE. type character string specifying presentation style options. cloze_multichoice, valid values \"vertical\" \"horizontal\". cloze_singlechoice, valid values \"dropdown\", \"vertical\", \"horizontal\". shuffle Logical. cloze_multichoice cloze_singlechoice, whether answer options shuffled. Defaults FALSE. answer numeric value specifying correct numerical answer(s). tolerance numeric value specifying acceptable range deviation cloze_numerical answers. Defaults 0. x cloze(), correct answer also determines question type (e.g. numeric use cloze_numerical() character use cloze_shortanswer() cloze_singlechoice()/cloze_multichoice() selectable options given second argument). ... Additional arguments passed cloze() methods (available options cloze_*() arguments).","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"character string containing Moodle-compatible XML inline text specified cloze question(s).","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"cloze_shortanswer(): Creates short-answer question student provides text response. cloze_multichoice(): Creates multiple-choice question students can select one correct answers. cloze_singlechoice(): Generates single-choice question students select one correct answer list. cloze_numerical(): Generates numerical question students input numeric response optional tolerance. cloze(): Automatic question types based class answers.","code":""},{"path":[]},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":null,"dir":"Reference","previous_headings":"","what":"R Markdown format for Moodle XML quizzes — moodlequiz","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"Provides alternative interface working exams package producing Moodle questions type.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"","code":"moodlequiz( replicates = 1L, self_contained = TRUE, extra_dependencies = NULL, theme = NULL, includes = NULL, lib_dir = NULL, md_extensions = NULL, pandoc_args = NULL, ... )"},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"replicates number times questions rendered, useful producing multiple versions quiz different random samples. keep identify replicates questions random importation Moodle recommend organising materials categories using top level headers. self_contained Produce standalone HTML file external dependencies, using data: URIs incorporate contents linked scripts, stylesheets, images, videos. Note even self contained documents MathJax still loaded externally (necessary size). extra_dependencies Extra dependencies list html_dependency class objects typically generated htmltools:htmlDependency(). theme One following: bslib::bs_theme() object (list bslib::bs_theme() argument values) Use option custom themes using Bootstrap 4 3. case, .scss/.sass files provided css parameter may utilize theme's underlying Sass utilities (e.g., variables, mixins, etc). NULL theme (.e., html_dependency_bootstrap()). character string specifying Bootswatch 3 theme name (backwards-compatibility). includes Named list additional content include within document (typically created using includes function). lib_dir Directory copy dependent HTML libraries (e.g. jquery, bootstrap, etc.) . default name document _files appended . md_extensions Markdown extensions added removed default definition R Markdown. See rmarkdown_format additional details. pandoc_args Additional command line options pass pandoc ... Additional function arguments pass base R Markdown HTML output formatter html_document_base","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"function intended internal generation XML output. strongly recommended use [moodlequiz::moodlequiz()] output format, provides higher-level interface creating Moodle-compatible quizzes.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"","code":"moodlequiz_xml( replicate = \"\", self_contained = TRUE, extra_dependencies = NULL, theme = NULL, includes = NULL, lib_dir = NULL, md_extensions = NULL, pandoc_args = NULL, ... )"},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"replicate character string specifying many replications quiz produced. self_contained Logical. TRUE, output document self-contained, embedding resources directly file. Defaults TRUE. extra_dependencies Additional dependencies include output. can specified html_dependency object list objects. theme character string specifying theme output. can standard theme name custom CSS file. includes Additional content include output. list named elements, in_header, before_body, after_body. lib_dir Directory copy library files output. NULL, library files copied. md_extensions character string specifying Markdown extensions passed Pandoc. pandoc_args Additional arguments pass Pandoc. ... Additional arguments passed bookdown::html_document2()","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"R Markdown output format object.","code":""},{"path":[]},{"path":"http://emitanaka.org/moodlequiz/news/index.html","id":"moodlequiz-development-version","dir":"Changelog","previous_headings":"","what":"moodlequiz (development version)","title":"moodlequiz (development version)","text":"First major release.","code":""},{"path":"http://emitanaka.org/moodlequiz/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New features","title":"moodlequiz (development version)","text":"Added cloze() cloze_*() functionality. Added moodlequiz() output format R Markdown. Added choices() helper constructing graded vectors choices.","code":""}] +[{"path":"http://emitanaka.org/moodlequiz/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Emi Tanaka. Author, maintainer. Mitchell O'Hara-Wild. Author.","code":""},{"path":"http://emitanaka.org/moodlequiz/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Tanaka E, O'Hara-Wild M (2025). moodlequiz: R Markdown format Moodle XML cloze quizzes. R package version 0.1.0.9001, http://emitanaka.org/moodlequiz/, https://github.com/emitanaka/moodlequiz.","code":"@Manual{, title = {moodlequiz: R Markdown format for Moodle XML cloze quizzes}, author = {Emi Tanaka and Mitchell O'Hara-Wild}, year = {2025}, note = {R package version 0.1.0.9001, http://emitanaka.org/moodlequiz/}, url = {https://github.com/emitanaka/moodlequiz}, }"},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"moodlequiz","dir":"","previous_headings":"","what":"R Markdown format for Moodle XML cloze quizzes","title":"R Markdown format for Moodle XML cloze quizzes","text":"moodlequiz R package allows creation Moodle quiz questions using literate programming R Markdown. makes easy quickly create quiz can randomly replicated new datasets, questions, options answers.","code":""},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"R Markdown format for Moodle XML cloze quizzes","text":"can install development version moodlequiz like :","code":"remotes::install_github(\"numbats/moodlequiz\")"},{"path":"http://emitanaka.org/moodlequiz/index.html","id":"example","dir":"","previous_headings":"","what":"Example","title":"R Markdown format for Moodle XML cloze quizzes","text":"Moodle quiz students select right variables data map onto plot aesthetics ggplot2. quiz created R Markdown document . Knitting document generate 5 different versions quiz x, y, color, size mapped randomly one variables mtcars data.","code":"--- title: Drawing a scatterplot output: moodlequiz::moodlequiz: replicates: 5 moodlequiz: category: datavis-scatterplots --- # Data ```{r setup, include = FALSE} library(tidyverse) library(rlang) library(moodlequiz) knitr::opts_chunk$set(echo = FALSE, results = \"hide\", fig.height = 4, fig.width = 5, fig.path = \"\", fig.cap = \"\", fig.align = \"center\") ``` ```{r data} cols <- colnames(mtcars) cats <- c(\"cyl\", \"vs\", \"am\", \"gear\", \"carb\") nums <- setdiff(cols, cats) x <- sample(nums, 1) y <- sample(setdiff(nums, x), 1) color <- sample(cats, 1) size <- sample(setdiff(nums, c(x, y)), 1) ``` You have been asked to analyse the `mtcars` data. The variables and the class types of the data is shown below. ```{r, echo = TRUE, results = \"show\"} str(mtcars) ``` # Plot As a starting point, you decide to draw a scatter plot for some variables. Complete the code below to get the target plot below: ```r ggplot(mtcars, aes(x = `r cloze(x, cols)`, y = `r cloze(y, cols)`, color = factor(`r cloze(color, cols)`), size = `r cloze(size, cols)`)) + `r cloze(\"geom_point\", ls(envir = as.environment(\"package:ggplot2\"), pattern = \"^geom_\"))`() ``` ```{r, results = \"show\"} ggplot(mtcars, aes(!!sym(x), !!sym(y), size = !!sym(size), color = factor(!!sym(color)))) + geom_point() + theme(plot.background = element_rect(color = \"black\")) ```"},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a set of choices for single or multiple choice questions — choices","title":"Create a set of choices for single or multiple choice questions — choices","text":"Create set choices single multiple choice questions","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a set of choices for single or multiple choice questions — choices","text":"","code":"choices(options, answer)"},{"path":"http://emitanaka.org/moodlequiz/reference/choices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a set of choices for single or multiple choice questions — choices","text":"options character vector selectable choices answer character vector correct answers","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Cloze-Type Questions for Moodle — cloze_questions","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"functions create cloze-type questions Moodle quizzes, designed use inline R code chunks R Markdown document formatted moodlequiz::moodlequiz output format.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"","code":"cloze_shortanswer( options, weight = max(options), feedback = \"\", case_sensitive = FALSE ) cloze_multichoice( options, weight = max(options), feedback = \"\", type = c(\"vertical\", \"horizontal\"), shuffle = FALSE ) cloze_singlechoice( options, weight = max(options), feedback = \"\", type = c(\"dropdown\", \"vertical\", \"horizontal\"), shuffle = FALSE ) cloze_numerical(answer, weight = 1, tolerance = 0, feedback = \"\") cloze(x, ...)"},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"options named vector answer options. single/multiple choice questions choices() helper function can help create vector. Names correspond answers, values specify weights (e.g., 100 correct answer partial weights partially correct answers). multiple-choice single-choice questions, includes correct distractor options. weight numeric value specifying weight question. Defaults highest weight options. feedback character vector providing feedback answers. case_sensitive Logical. cloze_shortanswer, whether answer case-sensitive. Defaults FALSE. type character string specifying presentation style options. cloze_multichoice, valid values \"vertical\" \"horizontal\". cloze_singlechoice, valid values \"dropdown\", \"vertical\", \"horizontal\". shuffle Logical. cloze_multichoice cloze_singlechoice, whether answer options shuffled. Defaults FALSE. answer numeric value specifying correct numerical answer(s). tolerance numeric value specifying acceptable range deviation cloze_numerical answers. Defaults 0. x cloze(), correct answer also determines question type (e.g. numeric use cloze_numerical() character use cloze_shortanswer() cloze_singlechoice()/cloze_multichoice() selectable options given second argument). ... Additional arguments passed cloze() methods (available options cloze_*() arguments).","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"character string containing Moodle-compatible XML inline text specified cloze question(s).","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"cloze_shortanswer(): Creates short-answer question student provides text response. cloze_multichoice(): Creates multiple-choice question students can select one correct answers. cloze_singlechoice(): Generates single-choice question students select one correct answer list. cloze_numerical(): Generates numerical question students input numeric response optional tolerance. cloze(): Automatic question types based class answers.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/cloze_questions.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate Cloze-Type Questions for Moodle — cloze_questions","text":"","code":"# Short-answer question: Where is the best coffee? cloze_shortanswer( options = c(\"Melbourne\" = 1), case_sensitive = FALSE ) #> [1] \"`{1:SHORTANSWER:%100%Melbourne#}`{=html}\" # Multiple-choice question: Select all lower-case answers cloze_multichoice( options = c(\"a\" = 1, \"F\" = 0, \"g\" = 1, \"V\" = 0, \"K\" = 0), type = \"vertical\" ) #> [1] \"`{1:MULTIRESPONSE:%100%a#~%0%F#~%100%g#~%0%V#~%0%K#}`{=html}\" # Where is Melbourne? cloze_singlechoice( choices( c(\"New South Wales\", \"Victoria\", \"Queensland\", \"Western Australia\", \"South Australia\", \"Tasmania\", \"Australian Capital Territory\", \"Northern Territory\"), \"Victoria\" ), type = \"dropdown\" ) #> [1] \"`{1:MULTICHOICE:%0%New South Wales#~%100%Victoria#~%0%Queensland#~%0%Western Australia#~%0%South Australia#~%0%Tasmania#~%0%Australian Capital Territory#~%0%Northern Territory#}`{=html}\" # Numerical question: Pick a number between 1 and 10 cloze_numerical( answer = 5.5, tolerance = 4.5 ) #> [1] \"`{1:NUMERICAL:=5.500000:4.500000#}`{=html}\" # Automatic cloze questions cloze(42) # Numerical #> [1] \"`{1:NUMERICAL:=42.000000:0.000000#}`{=html}\" cloze(\"Australia\") # Short answer #> [1] \"`{1:SHORTANSWER:%100%Australia#}`{=html}\" cloze(\"rep_len\", c(\"rep\", \"rep.int\", \"rep_len\", \"replicate\")) # Single choice #> [1] \"`{1:MULTICHOICE:%0%rep#~%0%rep.int#~%100%rep_len#~%0%replicate#}`{=html}\" cloze(c(\"A\", \"B\", \"C\"), letters) # Multiple choice #> Error in choices(choices, x): The correct answer does not exist in the provided options."},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":null,"dir":"Reference","previous_headings":"","what":"R Markdown format for Moodle XML quizzes — moodlequiz","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"Provides alternative interface working exams package producing Moodle questions type.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"","code":"moodlequiz( replicates = 1L, self_contained = TRUE, extra_dependencies = NULL, theme = NULL, includes = NULL, lib_dir = NULL, md_extensions = NULL, pandoc_args = NULL, ... )"},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"R Markdown format for Moodle XML quizzes — moodlequiz","text":"replicates number times questions rendered, useful producing multiple versions quiz different random samples. keep identify replicates questions random importation Moodle recommend organising materials categories using top level headers. self_contained Produce standalone HTML file external dependencies, using data: URIs incorporate contents linked scripts, stylesheets, images, videos. Note even self contained documents MathJax still loaded externally (necessary size). extra_dependencies Extra dependencies list html_dependency class objects typically generated htmltools:htmlDependency(). theme One following: bslib::bs_theme() object (list bslib::bs_theme() argument values) Use option custom themes using Bootstrap 4 3. case, .scss/.sass files provided css parameter may utilize theme's underlying Sass utilities (e.g., variables, mixins, etc). NULL theme (.e., html_dependency_bootstrap()). character string specifying Bootswatch 3 theme name (backwards-compatibility). includes Named list additional content include within document (typically created using includes function). lib_dir Directory copy dependent HTML libraries (e.g. jquery, bootstrap, etc.) . default name document _files appended . md_extensions Markdown extensions added removed default definition R Markdown. See rmarkdown_format additional details. pandoc_args Additional command line options pass pandoc ... Additional function arguments pass base R Markdown HTML output formatter html_document_base","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"function intended internal generation XML output. strongly recommended use [moodlequiz::moodlequiz()] output format, provides higher-level interface creating Moodle-compatible quizzes.","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"","code":"moodlequiz_xml( replicate = \"\", self_contained = TRUE, extra_dependencies = NULL, theme = NULL, includes = NULL, lib_dir = NULL, md_extensions = NULL, pandoc_args = NULL, ... )"},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"replicate character string specifying many replications quiz produced. self_contained Logical. TRUE, output document self-contained, embedding resources directly file. Defaults TRUE. extra_dependencies Additional dependencies include output. can specified html_dependency object list objects. theme character string specifying theme output. can standard theme name custom CSS file. includes Additional content include output. list named elements, in_header, before_body, after_body. lib_dir Directory copy library files output. NULL, library files copied. md_extensions character string specifying Markdown extensions passed Pandoc. pandoc_args Additional arguments pass Pandoc. ... Additional arguments passed bookdown::html_document2()","code":""},{"path":"http://emitanaka.org/moodlequiz/reference/moodlequiz_xml.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate Moodle Quiz XML Output for R Markdown — moodlequiz_xml","text":"R Markdown output format object.","code":""},{"path":[]},{"path":"http://emitanaka.org/moodlequiz/news/index.html","id":"moodlequiz-development-version","dir":"Changelog","previous_headings":"","what":"moodlequiz (development version)","title":"moodlequiz (development version)","text":"First major release.","code":""},{"path":"http://emitanaka.org/moodlequiz/news/index.html","id":"new-features-development-version","dir":"Changelog","previous_headings":"","what":"New features","title":"moodlequiz (development version)","text":"Added cloze() cloze_*() functionality. Added moodlequiz() output format R Markdown. Added choices() helper constructing graded vectors choices.","code":""}]