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)
Method import_gift()
This function imports a GIFT formatted text into the Quiz object
Arguments
text
A character vector containing the GIFT formatted text
Method import()
This function imports a list of questions into the Quiz object
Arguments
data
A list containing the questions data
This function prints the Quiz object
Method clone()
The objects of this class are cloneable with this method.
Arguments
deep
Whether to make a deep clone.