| qti_item | R Documentation |
These functions build and manipulate qti_item objects, for analysis and for reading and writing to QTI XML.
qti_item(
id = NULL,
title = NULL,
type = c("choice"),
prompt = NULL,
options = NULL,
key = NULL,
rm_prefix = TRUE,
href = sprintf("qti-item-%s.xml", id),
xml = NULL
)
id |
Item ID as an integer or string. |
title |
Item title, as a string, with max 280 characters. |
type |
Item type, only "choice" is currently supported. |
prompt |
Stem text, as a single string. |
options |
Option text, as vector of strings, one per option. |
key |
Numeric vector of 0/1 response scores, one per option. |
rm_prefix |
Logical with default |
href |
Optional file name for item, with default created using
|
xml |
Optional XML representation of item, as character. If not supplied, this is created automatically from the remaining arguments. |
qti_item returns an object of class
“qti_item”, which is a list containing named elements for
the item id, title, and type, as supplied via
arguments, the prompt and options text with formatting and
resources stripped, and the QTI XML representation of the item.
item <- qti_item(
id = 999,
title = "Example Item",
type = "choice",
prompt = "What does this image tell you? <img src='life.png' />",
options = c("Everything", "Something",
"Nothing, but look at this code:<br/><pre>lm(life ~ R)</pre>"),
key = c(1, 1, 0)
)
item
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.