new QuestionGroup(exam, number)
Represents a group of questions.
Parameters:
Name | Type | Description |
---|---|---|
exam |
Numbas.Exam | |
number |
number | The index of this group in the list of groups. |
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> |
Members
Methods
chooseQuestionSubset()
Decide which questions to use and in what order.
createQuestion(n, loading) → {Numbas.Question}
Create a question in this group.
Parameters:
Name | Type | Description |
---|---|---|
n |
number | The index of the question in the definitions. |
loading |
boolean | Is the question being resumed? |
Fires:
- Numbas.Exam#event:createQuestion
Returns:
Type | Description |
---|---|
Numbas.Question |
question |
loadFromJSON(data)
Load this question group's settings from the given JSON dictionary.
Parameters:
Name | Type | Description |
---|---|---|
data |
object |
loadFromXML(xml)
Load this question group's settings from the given XML <question_group> node.
Parameters:
Name | Type | Description |
---|---|---|
xml |
Element |