Jump to navigation

Class: NextPart

Numbas.parts.NextPart

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.

Source:

Members

availabilityCondition :JME

When should this next part be available to the student?

Type:
Source:

index :number

Index of the definition of this part in the question's list of part definitions.

Type:
Source:

instance :Numbas.parts.Part

Reference to the instance of this next part, if it's been created.

Type:
Source:

instanceVariables :Object.<Numbas.jme.token>

Values of replaced variables for this next part, once it's been created.

Type:
Source:

label :string

Label for the button to select this next part.

Type:
Source:

penalty :string

Name of the penalty to apply when this part is visited.

Type:
Source:

penaltyAmount :number

Amount of penalty to apply when this part is visited.

Type:
Source:

penaltyAmountString :JME

Expression defining the amount of penalty to apply when this part is visited.

Type:
Source:

variableReplacements :Array.<object>

List of variable replacements to make when creating this part.

Type:
Source:

Methods

finaliseLoad()

Perform any tidying up or processing that needs to happen once the definition has been loaded.

Source:

loadFromJSON(data)

Load the definition of this next part from JSON.

Parameters:
Name Type Description
data object
Source:

loadFromXML(xml)

Load the definition of this next part from XML.

Parameters:
Name Type Description
xml Element
Source:

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
Source: