Skip to contents

Create object TextGapOpal

Usage

textGapOpal(
  solution = character(),
  response_identifier = generate_id(type = "gap"),
  points = 1,
  placeholder = "",
  expected_length = if (length(solution_variable)) 10 else size_gap(solution),
  case_sensitive = FALSE,
  tolerance = 0,
  incorrect = 0,
  solution_variable = character()
)

gapTextOpal(
  solution = character(),
  response_identifier = generate_id(type = "gap"),
  points = 1,
  placeholder = "",
  expected_length = if (length(solution_variable)) 10 else size_gap(solution),
  case_sensitive = FALSE,
  tolerance = 0,
  incorrect = 0,
  solution_variable = character()
)

Arguments

solution

A character vector containing the values considered as correct answers. Omit when using solution_variable.

response_identifier

A character value representing an identifier for the answer. By default, it is generated as 'id_gap_dddd', where dddd represents random digits.

points

A numeric value, optional, representing the number of points for this gap. Default is 1

placeholder

A character value, optional, used to place helpful text in the text input field in the content delivery engine. Default is "".

expected_length

A numeric value, optional, used to set the size of the text input field in the content delivery engine. Default value is adjusted by solution size, or 10 for a dynamic answer.

case_sensitive

A boolean value, determining whether the evaluation of the correct answer is case sensitive. Default is FALSE.

tolerance

A numeric value defining how many characters will be taken into account to tolerate spelling mistakes in the evaluation of candidate answers. Default is 0.

incorrect

Score for an incorrect nonempty response, in points. Must be finite and non-positive. Default 0; omissions receive zero.

solution_variable

An optional QTI identifier of a string template variable used as the correct answer. Requires tolerance = 0 and cannot be combined with solution.

Value

An object of class TextGapOpal

See also

[entry()][numericGap()][textGap()]

Examples

tgo_min <- textGapOpal("answer")

tgo <- textGapOpal(solution = "answer",
             response_identifier  = "id_gap_1234",
             points = 2,
             placeholder = "put your answer here",
             expected_length = 20,
             case_sensitive = TRUE,
             tolerance = 2)