## ---- include = FALSE---------------------------------------------------------
library("exams2learnr")
set.seed(403)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "##",
message = FALSE,
warning = FALSE,
eval = FALSE,
echo = TRUE
)
## -----------------------------------------------------------------------------
# library("exams2learnr")
# run_quiz(c("capitals.Rmd", "fruit.Rmd", "function.Rmd"))
## -----------------------------------------------------------------------------
# qn <- exams2learnr("function.Rmd")
# class(qn)
# ## [1] "learnr_text" "tutorial_question"
# print(qn)
# ## Question: "What is the name of the R function for extracting the fitted
# ## log-likelihood from a fitted (generalized) linear model object?"
# ## type: "learnr_text"
# ## allow_retry: FALSE
# ## random_answer_order: FALSE
# ## answers:
# ## ✔: "logLik"
# ## messages:
# ## correct: "Correct!"
# ## incorrect: "Incorrect"
# ## message: "logLik
is the R function for extracting the
# ## fitted log-likelihood from a fitted (generalized) linear model object.
# ## See ?logLik
for the corresponding manual page."
# ## Options:
# ## trim: TRUE
## -----------------------------------------------------------------------------
# qz <- exams2learnr(c("swisscapital.Rmd", "switzerland.Rmd"))
# class(qz)
# ## [1] "tutorial_quiz"
# print(qz)
# ## Quiz: "Quiz"
# ##
# ## Question: "What is the seat of the federal authorities in Switzerland
# ## (i.e., the de facto capital)?"
# ## type: "learnr_radio"
# ## allow_retry: FALSE
# ## random_answer_order: FALSE
# ## answers:
# ## X: "Zurich"
# ## X: "Basel"
# ## ✔: "Bern"
# ## X: "Vaduz"
# ## X: "Geneva"
# ## messages:
# ## correct: "Correct!"
# ## incorrect: "Incorrect"
# ## message: "There is no de jure capital but the de facto capital and
# ## seat of the federal authorities is Bern.