View source: R/quiz_formatting.R
extract_meta | R Documentation |
Extract meta fields from a tag
extract_meta(tags)
tags |
A single tag or vector of tags to extract the fields from. |
A named vector indicating the field and entry associated with it.
### Simple example
tag <- "{quiz, id: quiz_name_here, attempts: 10}"
# Extract metadata tags
meta <- extract_meta(tag)
### Example using a file
quiz_path <- good_quiz_path()
quiz_lines <- readLines(quiz_path)
# Put this in a data.frame so we can identify the content
quiz_df <- parse_quiz_df(quiz_lines)
# Extract the tags
tags <- quiz_df %>%
dplyr::filter(type == "tag") %>%
dplyr::pull("original")
# Extract metadata tags
meta <- extract_meta(tags)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.