Title: | Check-Fields and Check-Boxes for 'rmarkdown' |
---|---|
Description: | Creates auto-grading check-fields and check-boxes for 'rmarkdown' or 'quarto' HTML. It can be used in class, when teacher share materials and tasks, so students can solve some problems and check their work. In contrast to the 'learnr' package, the 'checkdown' package works serverlessly without 'shiny'. |
Authors: | George Moroz [aut, cre] |
Maintainer: | George Moroz <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.12 |
Built: | 2025-01-19 03:14:36 UTC |
Source: | https://github.com/agricolamz/checkdown |
Create hint for 'rmarkdown'
check_hint( hint_text, hint_title = "Click here to see/close the hint", type = c("onclick", "onmouseover", "ondblclick"), hint_id = sample(1e+05:1, 1) )
check_hint( hint_text, hint_title = "Click here to see/close the hint", type = c("onclick", "onmouseover", "ondblclick"), hint_id = sample(1e+05:1, 1) )
hint_text |
hint paragraph text; can contain markdown |
hint_title |
click paragraph text; can contain markdown |
type |
character that describes behavior of the hint. Possible values are: |
hint_id |
unique identifier of the question |
returns the html tags and javascript code
George Moroz <[email protected]>
check_hint("You can use argument `echo=FALSE`!")
check_hint("You can use argument `echo=FALSE`!")
Create list of hints for 'rmarkdown'
check_hints( hint_text, hint_title = "Click here to see/close the hint", hint_title_prefix = "", hint_title_suffix = "", list_title = "Click here to see/close the list of hints", type = c("onclick", "onmouseover", "ondblclick") )
check_hints( hint_text, hint_title = "Click here to see/close the hint", hint_title_prefix = "", hint_title_suffix = "", list_title = "Click here to see/close the list of hints", type = c("onclick", "onmouseover", "ondblclick") )
hint_text |
hint paragraph texts; can contain markdown |
hint_title |
hint title texts; can contain markdown |
hint_title_prefix |
string that added before each hint_title |
hint_title_suffix |
string that added after each hint_title |
list_title |
unique identifier for each hint |
type |
character that describes behavior of the hints. Possible values are: |
returns the html tags and javascript code
George Moroz <[email protected]>
check_hints(1:4)
check_hints(1:4)
Create check-fields and check-boxes for 'rmarkdown'
check_question( answer, right = "Correct", wrong = "I have a different answer", options = NULL, type = NULL, button_label = "check", alignment = NULL, placeholder = "", random_answer_order = FALSE, title = NULL, width_of_in_order = paste0(round(1/length(answer) * 85), "%"), height_of_in_order = "60px", style_of_in_order = "padding:5px;border: 1px solid #aaaaaa; display: inline-block;", q_id = sample(1:1e+05, 1) )
check_question( answer, right = "Correct", wrong = "I have a different answer", options = NULL, type = NULL, button_label = "check", alignment = NULL, placeholder = "", random_answer_order = FALSE, title = NULL, width_of_in_order = paste0(round(1/length(answer) * 85), "%"), height_of_in_order = "60px", style_of_in_order = "padding:5px;border: 1px solid #aaaaaa; display: inline-block;", q_id = sample(1:1e+05, 1) )
answer |
correct answer (can be a double or a string). It is possible to put here a vector of several answers. |
right |
form reaction on right answer |
wrong |
form reaction on wrong answer |
options |
vector of values for the selection list type |
type |
character that defines type of the list. Possible values: |
button_label |
character value that will be displayed on the button |
alignment |
character argument for options' alignment: |
placeholder |
character that defines a short hint that describes the expected value of an input field. This works with the |
random_answer_order |
logical argument that denotes whether answers should be shuffled, when the |
title |
character value that will be displayed as a question title. It is possible to put there the question. You can put markdown markup. Since this argument wraps the form contents with |
width_of_in_order |
character with some values for width of the boxes, when the |
height_of_in_order |
character with some values for height of the boxes, when the |
style_of_in_order |
character that contains CSS style for the |
q_id |
unique identifier of the question |
returns the html tags and javascript code
George Moroz <[email protected]>
check_question(answer = 5)
check_question(answer = 5)
Insert audio
insert_audio( src, controls = TRUE, autoplay = FALSE, loop = FALSE, muted = FALSE, preload = c("none", "auto", "metadata") )
insert_audio( src, controls = TRUE, autoplay = FALSE, loop = FALSE, muted = FALSE, preload = c("none", "auto", "metadata") )
src |
character. It specifies the location (URL) of the audio file. |
controls |
logical. When |
autoplay |
logical. When |
loop |
logical. When |
muted |
logical. When |
preload |
character. It specifies if and how the author thinks that the audio file should be loaded when the page loads. Possible values are |
returns set of html tags
George Moroz <[email protected]>
insert_audio("1.wav")
insert_audio("1.wav")
Insert multiple images into questions and hints
insert_images( src, alt = "image", image_width = "100%", image_height = "100%" )
insert_images( src, alt = "image", image_width = "100%", image_height = "100%" )
src |
image file names |
alt |
alternate texts for an image in case If a browser cannot find an image |
image_width |
image widths. Could be absolute value in pixels or percantage. |
image_height |
image heights. Could be absolute value in pixels or percantage. |
returns set of html tags
George Moroz <[email protected]>
insert_images(c("1.png", "2.png"))
insert_images(c("1.png", "2.png"))
Create an overall sum score for all correct tasks in the document
insert_score()
insert_score()
returns the html tags and javascript code
George Moroz <[email protected]>