Reference to a template variable in item content
Source:R/TemplateVariableRef.R
TemplateVariableRef-class.RdUse this object in an assessment item's content list to display a template
variable using QTI printedVariable. It does not define an answer field or
contribute points. When the complete item is exported, the referenced name
must be declared in its template list. Both named outputs and intermediate
result identifiers can be referenced. In Rmd, use template_value() inline.
Examples
variables <- new("MaximaVariables", code = "string(['a = 1]);",
variables = c(a = "integer"))
reference <- new("TemplateVariableRef", identifier = "a")
item <- new("Entry", template = list(variables),
content = list("<p>Enter ", reference, ": ",
numericGap(1), "</p>"))
createItemBody(item)
#> <itemBody>
#> <div>
#> <p>Enter
#> <printedVariable identifier="a"></printedVariable>
#> :
#> <textEntryInteraction responseIdentifier="id_gap_6424" expectedLength="1" placeholderText=""></textEntryInteraction>
#> </p>
#> </div>
#> </itemBody>