Skip to contents

This class represents a Quiz object. It is a container for a list of questions.

Details

The Quiz class is a container for a list of questions. It is used to store and manipulate questions. Questions can be added to the Quiz object using the add_question method, or directly using a GIFT file with the import_gift method.

Public fields

debug

A boolean indicating if the debug mode is activated

Active bindings

list

This function returns the list of questions

Methods


Method new()

This function initializes the Quiz object

Usage

Quiz$new(x, debug = FALSE)

Arguments

x

either a filename and its path, a list containing the data of the Quiz object, or a character vector containing the GIFT formatted text

debug

A boolean indicating if the debug mode is activated (FALSE)

Returns

The Quiz object


Method import_gift()

This function imports a GIFT formatted text into the Quiz object

Usage

Quiz$import_gift(text)

Arguments

text

A character vector containing the GIFT formatted text


Method import()

This function imports a list of questions into the Quiz object

Usage

Quiz$import(data)

Arguments

data

A list containing the questions data

Returns

The Quiz object


Method print()

This function prints the Quiz object

Usage

Quiz$print()


Method clone()

The objects of this class are cloneable with this method.

Usage

Quiz$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.