All Projects → agricolamz → checkdown

agricolamz / checkdown

Licence: GPL-2.0 license
R package for Rmarkdown for creating autocheck questions and hints

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to checkdown

Rmarkdown Website Tutorial
Tutorial for creating websites w/ R Markdown
Stars: ✭ 26 (+4%)
Mutual labels:  rmarkdown, teaching
Talks
Repository of publicly available talks by Leon Eyrich Jessen, PhD. Talks cover Data Science and R in the context of research
Stars: ✭ 16 (-36%)
Mutual labels:  rmarkdown, teaching
Cosx.org
统计之都主站
Stars: ✭ 180 (+620%)
Mutual labels:  rmarkdown
tableaunoir
An online blackboard 🖉 with fridge magnets 🌈🧲 for teaching, and making animations 🏃 and presentations ⎚.
Stars: ✭ 149 (+496%)
Mutual labels:  teaching
grillade
Grid sytem for shiny apps or rmarkdown and to create htmlwidgets matrix
Stars: ✭ 16 (-36%)
Mutual labels:  rmarkdown
Postcards
💌 Create simple, beautiful personal websites and landing pages using only R Markdown.
Stars: ✭ 208 (+732%)
Mutual labels:  rmarkdown
reportmd
Create multi-page HTML reports in R
Stars: ✭ 23 (-8%)
Mutual labels:  rmarkdown
Knitr
A general-purpose tool for dynamic report generation in R
Stars: ✭ 2,134 (+8436%)
Mutual labels:  rmarkdown
Ensembler
Ensembler is a python package that provides fast and easy access to 1D and 2D model system simulations. It can be used for method development or to deepen understanding of a broad spectrum of modeling methods, from basic sampling techniques to enhanced sampling and free energy calculations. It is easy to install, fast, increases shareability, co…
Stars: ✭ 42 (+68%)
Mutual labels:  teaching
learningmachines
Teaching machine learning!
Stars: ✭ 46 (+84%)
Mutual labels:  teaching
Rmarkdown tutorial
Reproducible Research with Rmarkdown: data management, analysis, and reporting all-in-one
Stars: ✭ 18 (-28%)
Mutual labels:  rmarkdown
Xaringanextra
🎡 A playground of enhancements and extensions for xaringan slides.
Stars: ✭ 240 (+860%)
Mutual labels:  rmarkdown
Knitr Book
Dynamic Documents with R and knitr
Stars: ✭ 215 (+760%)
Mutual labels:  rmarkdown
countup
⏱️ countup.js R htmlwidget
Stars: ✭ 36 (+44%)
Mutual labels:  rmarkdown
Bslib
Tools for theming shiny and rmarkdown from R via Bootstrap (3 or 4) Sass.
Stars: ✭ 197 (+688%)
Mutual labels:  rmarkdown
Online R learning
Online R learning for applied statistics
Stars: ✭ 132 (+428%)
Mutual labels:  teaching
Rmarkdown
Dynamic Documents for R
Stars: ✭ 2,319 (+9176%)
Mutual labels:  rmarkdown
R4ds Exercise Solutions
Exercise solutions to "R for Data Science"
Stars: ✭ 226 (+804%)
Mutual labels:  rmarkdown
sds env
Spatial Data Science Environment
Stars: ✭ 20 (-20%)
Mutual labels:  teaching
hugo-apero
Apéro is a Hugo theme for personal websites. A Hugo theme you'll want to hang out with 🌌 . This is the source for the theme files to install.
Stars: ✭ 122 (+388%)
Mutual labels:  rmarkdown

checkdown

Project Status: Active - The project has reached a stable, usable state and is being actively developed. CRAN version DOI

G. Moroz

Installation

Get the stable version from CRAN:

install.packages("checkdown")

… or get the development version from GitHub:

install.packages("devtools")
devtools::install_github("agricolamz/checkdown")

1. Demo (it is better to look in the html-version)

The main goal of this package to create checking fields and boxes in rmarkdown. It could be used in class, when teacher share materials and tasks (as an .html page or an .html slides), so student can solve some problems and check themselves. It is really important since some students are too shy to ask a question, so you can create tasks that will check on the fly the understanding of the class material and give some hints to those students that get stuck. In contrast to the learnr package the checkdown package works without shiny and could be stored as a simple .html page (e. g. on Github Pages). In contrast to the exams output the checkdown package creates intaractive autochecking tasks. The interactive virsion of the exams output is bind to Blackboard Learn, that is really nice, but looks like an overkill for the simple task that checkdown solves.

Load the library:

library(checkdown)

1.1 Ask question with the check_question() function

Imagine that we want to create a checkbox with the answer 4. All you need is to create a following chunk with the chunck atribute results='asis' in your rmarkdown document:

check_question(answer =  4)

It is possible to change wrong and right answer's messages using wrong and right arguments of the check_question() function. Let's create some more questions.

Solve 3+3:

check_question(answer =  6, right = "correct", wrong = "not correct")

Type la-la:

check_question(answer =  "la-la")

Number of answers is not limited:

check_question(answer =  1:5)

It is also possible to create a list of answers for students to choose:

check_question("banana", options = c("apple", "banana", "bread"))

check_question("banana", options = c("apple", "banana", "bread"), type = "radio")
check_question(c("banana", "apple"), options = c("apple", "banana", "bread"), type = "checkbox")

If the list of possible answers is small, it is possible to align them in one line using alignment argument:

check_question("banana", options = c("apple", "banana", "bread"), type = "radio", alignment = TRUE)

You can shuffle answers using the random_answer_order argument:

check_question("banana", options = c("apple", "banana", "bread"), type = "radio", random_answer_order = TRUE)

If you don't want to give the possibility of automatically check your question, just put NULL in the answer argument:

check_question(NULL, options = c("apple", "banana", "bread"), type = "radio")

1.2 Give some hints with the check_hint() function

Sometimes you know in advance what kind of mistakes will your students do. Some students are shy and don't like asking questions, so hints could partially solve this problem. Again all you need is to create a following chunk with the chunck atribute results='asis' in your rmarkdown document:

check_hint("You can use the rmarkdown package")

Of course it is possible to change the message:

check_hint("You can use the rmarkdown package",
           hint_title = "CLICK HERE")

It is possible to use Markdown inside messages:

check_hint("* You can use `markdown` **inside** the [`chcekdown` package](https://agricolamz.github.io/checkdown/)",
           hint_title = "Click he`R`e")
check_question(answer =  4, 
               wrong = "a**R**e you su**R**e", 
               right = "### `R`ight")

There is also a function for multiple hints:

check_hints(hint_text = c("look into the hint 2", "look into the hint 1"),
            hint_title = c("hint 1", "hint 2"), 
            list_title = "list of hints")

2. Inserting images

Sometimes it is nice to use images as a question. It also could be useful to insert images in hints. In order to do it you need to use insert_images() function, and enumerate the correct answer.

check_question(answer = 3, 
               type = "radio",
               options = insert_images(c("windows.png", 
                                         "mac.png",
                                         "linux.png"), 
                                         image_width = 30))

Arguments image_width and image_height also except vector of values in case you need different size for different pictures. It is also possible to create a picture during the session, save it and use in checkdown functions.

tmp <- tempfile(fileext = ".png")
library(ggplot2)
ggplot(data = mtcars, aes(mpg, disp)) + geom_point()
ggsave(filename = tmp)

Let's use obtained picture in the hint (notice, how I used percantage in the image_width argument):

check_hint(paste("Here is our plot: <br>", 
                 insert_images(tmp, image_width = "40%")))

It looks like it is better to change font size, if you want to change the size of the picture.

3. Some important notes

  • It is possible to avoid code in the output .html. Just use the chunk argument echo=FALSE.
  • For now the package checkdown works only with html output and will not print anything for other otputs.
  • Be careful with number precision: rounding could be different on different computers so if you ask your student to calculate log(3/4) it is possible that they will see only 6 or 7 numbers after the comma. So it make sence explicitly specify precision using round() function.
log(3/4)
check_question(answer =  round(log(3/4), 6))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].