Jump to navigation

Class: QuestionGroup

Numbas.QuestionGroup

new QuestionGroup(exam)

Represents a group of questions.

Parameters:
Name Type Description
exam Numbas.Exam
Properties:
Name Type Description
exam Numbas.Exam

The exam this group belongs to.

xml Element

The XML defining the group.

json object

The JSON object defining the group.

questionSubset Array.<number>

The indices of the picked questions, in the order they should appear to the student.

questionList Array.<Numbas.Question>
Source:

Members

settings

Settings for this group.

Properties:
Name Type Description
name string
pickingStrategy string

How to pick the list of questions: 'all-ordered', 'all-shuffled' or 'random-subset'.

pickQuestions number

If pickingStrategy is 'random-subset', how many questions to pick.

Source:

Methods

chooseQuestionSubset()

Decide which questions to use and in what order.

Source:

loadFromJSON(data)

Load this question group's settings from the given JSON dictionary.

Parameters:
Name Type Description
data object
Source:

loadFromXML(xml)

Load this question group's settings from the given XML <question_group> node.

Parameters:
Name Type Description
xml Element
Source: