Question Editor API Initialization
my_custom_attribute_name
The definition of your custom attribute. You can define as many custom attributes as required.
Note Replace the my_custom_attribute_name
with the name of the attribute you want to define. This can be any unique string and it is recommended to use snake_case for attribute names.
Examples
"stimulus": {
"type": "string",
"required": false,
"name": "Compose question",
"description": "The question stimulus. This can include text, tables, images, resources and LaTeX entered via the Math Editor.",
"element": "editor",
"asset": {
"mediaType": "image",
"returnType": "HTML"
}
}
Values
Attribute path custom_question_types.editor_schema.attributes.my_custom_attribute_name
Type object
Properties
-
name string
Define the display name of the input.
-
type string
Define the type of input.
-
element string
Define what type of element the input should render as (if not a regular input field).
-
description string
Explain the purpose of the input.
-
required boolean
If set to
false
then this attribute will be removed from generated JSON if its current value matches its default value. -
default *
Define the default value of the current input.
-
items object
If the type property is set to
"array"
, then this option is used to configure what type of element each array entry is. -
count object
If the type property is set to
"array"
, then this option is used to configure the maximum and minimum count of array elements. -
options object
If the type property is set to
"select"
, then this option is used to configure what the drop-down menu options are. -
white_list array[string]
If the element property set to
"question"
, then this option is used to configure the white list of attributes that will be passed into Question / Feature renderer. -
min integer
If the type property is set to
"number"
, this property can be set to specify the minimum allowed value. -
max integer
If the type property is set to
"number"
, this property can be set to specify the maximum allowed value. -
asset object
If the type property is set to
"string"
, you can specify this property to allow media upload. -
canUploadResource boolean
Whether the "resource" icon appears on the Rich Text Editor bar to allow uploading of a resource.