x <- sample(2:8, 1)9 Space Syntax
9.1 Why use this method?
9.2 You are ready to use this method if
9.3 Questions you can answer
9.4 Example Questions
9.4.1 Fill-In-The-Blanks (fitb())
Create fill-in-the-blank questions using fitb(), providing the answer as the first argument.
- 2 + 2 is
You can also create these questions dynamically, using variables from your R session.
- The square root of 64 is:
The blanks are case-sensitive; if you don’t care about case, use the argument ignore_case = TRUE.
- What is the letter after D?
If you want to ignore differences in whitespace use, use the argument ignore_ws = TRUE (which is the default) and include spaces in your answer anywhere they could be acceptable.
- How do you load the tidyverse package?
You can set more than one possible correct answer by setting the answers as a vector.
- Type a vowel:
You can use regular expressions to test answers against more complex rules.
- Type any 3 letters:
9.4.2 Multiple Choice (mcq())
- “Never gonna give you up, never gonna: ”
- “I down in Africa” -Toto
9.4.3 True or False (torf())
- True or False? You can permute values in a vector using
sample().
9.4.4 Longer MCQs (longmcq())
When your answers are very long, sometimes a drop-down select box gets formatted oddly. You can use longmcq() to deal with this. Since the answers are long, It’s probably best to set up the options inside an R chunk with echo=FALSE.
What is a p-value?
opts_p <- c(
"the probability that the null hypothesis is true",
answer = "the probability of the observed, or more extreme, data, under the assumption that the null-hypothesis is true",
"the probability of making an error in your conclusion"
)What is true about a 95% confidence interval of the mean?
# use sample() to randomise the order
opts_ci <- sample(c(
answer = "if you repeated the process many times, 95% of intervals calculated in this way contain the true mean",
"there is a 95% probability that the true mean lies within this range",
"95% of the data fall within this range"
))9.5 Checked sections
Create sections with the class webex-check to add a button that hides feedback until it is pressed. Add the class webex-box to draw a box around the section (or use your own styles).
I am going to learn a lot:
opts <- c(
"the probability that the null hypothesis is true",
answer = "the probability of the observed, or more extreme, data, under the assumption that the null-hypothesis is true",
"the probability of making an error in your conclusion"
)
cat("What is a p-value?", longmcq(opts))