Skip to contents

Create XML or zip file for question specification

Usage

createQtiTask(object, dir = ".", verification = FALSE, zip = FALSE,
  task_names = NULL, qti_version = NULL)

# S4 method for class 'AssessmentItem'
createQtiTask(
  object,
  dir = ".",
  verification = FALSE,
  zip = FALSE,
  task_names = NULL,
  qti_version = NULL
)

# S4 method for class 'character'
createQtiTask(
  object,
  dir = getwd(),
  verification = FALSE,
  zip = FALSE,
  task_names = NULL,
  qti_version = NULL
)

Arguments

object

An instance of the S4 object (SingleChoice, MultipleChoice, Essay, Entry, Ordering, OneInRowTable, OneInColTable, MultipleChoiceTable, DirectedPair).

dir

A character value, optional; a folder to store xml file; working directory is used by default.

verification

A boolean value, optional; checks the validity of the XML file. Default is FALSE.

zip

A boolean value, optional; TRUE creates a zip archive with the manifest and task files inside. Default is FALSE.

task_names

Display naming policy: "title", "filename", "both", or "hidden". NULL uses option rqti.task_names, falling back to "title". See task_names.

qti_version

QTI version of the export: "2.1" or "2.2". NULL uses option rqti.qti_version, falling back to "2.1".

Value

A path to xml or zip file.

Examples

essay <- new("Essay", prompt = "Test task", title = "Essay")
if (FALSE) { # \dontrun{
# creates folder with XML (side effect)
createQtiTask(essay, "result")
# creates folder with zip (side effect)
createQtiTask(essay, "result", zip = TRUE)
} # }