CustomPartTypeDefinition

fieldtypedescription
type_nameTranslation
descriptionTranslation
settingsArray of CustomPartTypeSetting
can_be_gapBoolean
can_be_stepBoolean
marking_notesArray of JMENote
help_urlTranslation
publishedBoolean
extensionsExtensions
input_widgetCustomPartInputWidget

Translation

One of the following items:

typedescription
TranslationStructA structured translatable string with placeholders.
FileStringA simple filestring. This implies that it can also just be a string.

TranslationStruct

fieldtypedescription
contentTranslationContentThe content with optional placeholders ({{placeholder-name}}).
placeholdersMap from String to TranslationThe values for the placeholders. It maps the placeholder-name to it's translatable value. The value for a placeholder can thus (if needed) be different for different locales.

TranslationContent

One of the following items:

typedescription
Map from String to FileStringMap from locale to content. You can use this to specify different content for different locales.
FileStringA filestring. Possibly to a file that is placed in locale folders and is therefore localized.

FileString

One of the following items:

typedescription
StringA string of the form file:<filepath> where filepath is the relative path (within the exams or questions folder) to a file containing content. This content can be localized by placing it in locale folders. e.g. file:examples/basic-explanation.html will search for files in folders with following form: questions/examples/locale-<localename>/basic-explanation.html If a file isn't found for a specific locale, questions/examples/basic-explanation.html will be used.
StringA literal string.

CustomPartTypeSetting

Internal tag named input_type.

One of the following items:

CustomPartTypeSettingCheckBox

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
default_valueBooleanThe initial value of the setting in the question editor.

CustomPartTypeSettingCode

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
default_value"none" or TranslationThe initial value of the setting in the question editor. If the setting has a sensible default value, set it here. If the value of the setting is likely to be different for each instance of this part type, set this to none.
evaluateBoolean

CustomPartTypeSettingMathematicalExpression

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
evaluate_enclosed_expressionsBooleanIf this is ticked, then JME expressions enclosed in curly braces will be evaluated and the results substituted back into the string.
default_value"none" or TranslationThe initial value of the setting in the question editor. If the setting has a sensible default value, set it here. If the value of the setting is likely to be different for each instance of this part type, set this to none.

CustomPartTypeSettingString

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
evaluate_enclosed_expressionsBooleanIf this is ticked, then JME expressions enclosed in curly braces will be evaluated and the results substituted back into the text when the question is run. Otherwise, the string will be untouched.
default_value"none" or StringThe initial value of the setting in the question editor. If the setting has a sensible default value, set it here. If the value of the setting is likely to be different for each instance of this part type, set this to none.

CustomPartTypeSettingDropDown

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
default_value"none" or TranslationThe initial value of the setting in the question editor. If the setting has a sensible default value, set it here. If the value of the setting is likely to be different for each instance of this part type, set this to none.
choicesArray of CustomPartTypeSettingDropDownChoice

CustomPartTypeSettingDropDownChoice

fieldtypedescription
valueTranslation
labelTranslation

CustomPartTypeSettingPercentage

fieldtypedescription
nameTranslationA short name for this setting, used to refer to it in the part type’s answer input or marking algorithm. The name should uniquely identify the setting.
numbas_labelTranslationThe label shown next to the setting in the numbas question editor. Try to make it as clear as possible what the setting is for. For example, a checkbox which dictates whether an input hint is shown should be labelled something like “Hide the input hint?” rather than “Input hint visibility” - the latter doesn’t tell the question author whether ticking the checkbox will result in the input hint appearing or not.
documentation_url"none" or TranslationThe address of documentation explaining this setting in further depth.
numbas_hintTranslationUse this field to give further guidance to question authors about this setting, if the label is not enough. For example, you might use this to say what data type a JME code setting should evaluate to.
default_value"none" or FloatThe initial value of the setting in the question editor. If the setting has a sensible default value, set it here. If the value of the setting is likely to be different for each instance of this part type, set this to none.

JMENote

fieldtypedescription
nameStringThe name of the note
description"none" or StringA description of the note
expressionTranslationThe jme expression representing the note

Extensions

fieldtypedescription
chemistryBoolean
download_text_fileBoolean
eukleidesBooleanThe Eukleides extension provides functions to embed diagrams created using the Eukleides language. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#eukleides
geogebraBooleanThe GeoGebra extension provides functions to embed GeoGebra worksheets in a question. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#geogebra
graphsBooleanThis extension provides some functions for working with and drawing graphs (networks of vertices joined by edges) in Numbas. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#graph-theory
jsx_graphBooleanThe JSXGraph extension provides functions to create and manipulate interactive diagrams with the JSXGraph library. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#eukleides
linear_algebraBoolean
linear_codesBooleanThis extension provides a new data type and some functions to deal with linear codes. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#linear-codes
optimisationBoolean
permutationsBoolean
polynomialsBooleanThis extension provides a new data type and some functions to deal with rational polynomials. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#polynomials
quantitiesBooleanThis extension wraps the js-quantities library to provide a “quantity with units” data type to Numbas. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#quantities
random_personBooleanThe “random person” extension provides a collection of functions to generate random people, for use in word problems. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#random-person
statsBooleanThe statistical functions extension provides many new functions for generating samples from random distributions, and calculating statistics. https://numbas-editor.readthedocs.io/en/latest/extensions/first-party.html#statistical-functions
sqliteBoolean
textBoolean
written_numberBoolean

CustomPartInputWidget

Internal tag named type.

One of the following items:

tag-valuedatatype of valuedescription
stringCustomPartStringInputOptionsThe student enters a single line of text.
numberCustomPartNumberInputOptionsThe student enters a number, using any of the allowed notation styles. If the student’s answer is not a valid number, they are shown a warning and can not submit the part.
radiogroupCustomPartRadioGroupInputOptionsThe student chooses one from a list of choices by selecting a radio button.

CustomPartStringInputOptions

fieldtypedescription
hintCustomPartInputOptionValueTranslatableStringA string displayed next to the input field, giving any necessary information about how to enter their answer.
correct_answerTranslationA JME expression which evaluates to the expected answer to the part.
allow_emptyCustomPartInputOptionValueBoolIf false, the part will only be marked if their answer is non-empty.

CustomPartInputOptionValueTranslatableString

fieldtypedescription
valueTranslationThe value
staticBooleanA static field takes the same value in every instance of the part type. A dynamic field is defined by a JME expression which is evaluated when the question is run.

CustomPartInputOptionValueBool

fieldtypedescription
valueBooleanThe value
staticBooleanA static field takes the same value in every instance of the part type. A dynamic field is defined by a JME expression which is evaluated when the question is run.

CustomPartNumberInputOptions

fieldtypedescription
hintCustomPartInputOptionValueTranslatableStringA string displayed next to the input field, giving any necessary information about how to enter their answer.
correct_answerTranslationA JME expression which evaluates to the expected answer to the part.
allow_fractionsCustomPartInputOptionValueBoolAllow the student to enter their answer as a fraction?
allowed_notation_stylesCustomPartInputOptionValueAnswerStyles

CustomPartInputOptionValueAnswerStyles

fieldtypedescription
valueArray of AnswerStyleThe value
staticBooleanA static field takes the same value in every instance of the part type. A dynamic field is defined by a JME expression which is evaluated when the question is run.

AnswerStyle

One of the following items:

namedescription
"english"English style - commas separate thousands, dot for decimal point
"english-plain"Plain English style - no thousands separator, dot for decimal point
"english-si"English SI style - spaces separate thousands, dot for decimal point
"european"Continental European style - dots separate thousands, comma for decimal poin
"european-plain"Plain French style - no thousands separator, comma for decimal point
"french-si"French SI style - spaces separate thousands, comma for decimal point
"indian"Indian style - commas separate groups, dot for decimal point. The rightmost group is three digits, other groups are two digits.
"scientific"Significand-exponent ("scientific") style
"swiss"Swiss style - apostrophes separate thousands, dot for decimal point

CustomPartRadioGroupInputOptions

fieldtypedescription
hintCustomPartInputOptionValueTranslatableStringA string displayed next to the input field, giving any necessary information about how to enter their answer.
correct_answerTranslationA JME expression which evaluates to the expected answer to the part.
choicesCustomPartInputOptionValueTranslatableStringsThe labels for the choices to offer to the student.

CustomPartInputOptionValueTranslatableStrings

fieldtypedescription
valueArray of TranslationThe value
staticBooleanA static field takes the same value in every instance of the part type. A dynamic field is defined by a JME expression which is evaluated when the question is run.