new NextPart(parentPart)
Definition of a 'next part' option following on from a part.
Parameters:
Name | Type | Description |
---|---|---|
parentPart |
Numbas.parts.Part | The part this one follows on from. |
Members
index :number
Index of the definition of this part in the question's list of part definitions.
Type:
instance :Numbas.parts.Part
Reference to the instance of this next part, if it's been created.
Type:
instanceVariables :Object.<Numbas.jme.token>
Values of replaced variables for this next part, once it's been created.
Type:
label :string
Label for the button to select this next part.
Type:
penalty :string
Name of the penalty to apply when this part is visited.
Type:
penaltyAmount :number
Amount of penalty to apply when this part is visited.
Type:
penaltyAmountString :JME
Expression defining the amount of penalty to apply when this part is visited.
Type:
variableReplacements :Array.<object>
List of variable replacements to make when creating this part.
Type:
Methods
finaliseLoad()
Perform any tidying up or processing that needs to happen once the definition has been loaded.
loadFromJSON(data)
Load the definition of this next part from JSON.
Parameters:
Name | Type | Description |
---|---|---|
data |
object |
loadFromXML(xml)
Load the definition of this next part from XML.
Parameters:
Name | Type | Description |
---|---|---|
xml |
Element |
usesStudentAnswer() → {boolean}
Do any of the variable replacements for this next part rely on information from the student's answer to the parent part? Returns true if a variable replacement definition contains a variable name which is not a question variable - it must come from the marking algorithm.
Returns:
Type | Description |
---|---|
boolean |