This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.
Initialization Option Question Editor API


Use this config option to modify the behaviour and appearance of Learnosity's question types. For example, if you wanted to change the name of the MCQ question type in the tile view, you can use this config option. Settings in question_types override or extend settings in base_question_type.


Request object key question_types

Type object

This object has the following properties which can be configured.

Type definitions

QuestionType object

  • defaults object

    Change the default values that will be populated when you load the Question Types. (e.g. you could set the default Stimulus for MCQ using this config option). In order to set a default value for new array elements, keys with empty brackets "[]" can be used. Extends anything that is defined in base_question_type.defaults.

    • [key] *
  • dependency array

    Turns provided array items to become dependent items.

    To use, specify the "parent" as the first (odd) array value, then the "dependent" (child) as the next (even) array value. To set up multi-dependency, specify the parent again, with the second dependent after.

    For example: if we create an array like ["options", "metadata.distractor_rationale_response_level"] then "metadata.distractor_rationale_response_level" is now a dependant node of "options". So, if an "options" item is added or removed, a corresponding "metadata.distractor_rationale_response_level" item will be added or removed as well.

    Note The dependent array item should either have no default values set, or have the same number of array entries as the parent (use the defaults object to do this).

  • description string

    Overwrites the default description for the Question Type.

  • exclude_options object

    Combination of object key and array value to remove unwanted option(s) from dropdown input (eg. you could remove "large", "xlarge" fontsizes from mcq question type by adding ui_style.fontsize: ["large", "xlarge"]) or Math question type's custom action group. Overrides base_question_type.exclude_options.

    • [optionKey] *
  • group_reference string

    Changes the tile view group in which this question type will appear. E.g. if you created a new question type group (see the question_type_groups config option) called "Spoken", you could move the Audio question type to that group.

  • hidden array

    Define which attributes should be hidden in all question types.

    For array type fields like options, you can either define a selector for a specific entry, e.g. options[0], or you can specify a selector targeting the whole array, e.g. options[*]. Also use this for children of array type fields, e.g. validation.valid_response.value[*].aria_label

    Extends base_question_type.hidden.

  • hidden_search_terms array

    Additional terms which can be used to search for the template in the tile view.

    E.g. to get the hotspot question type to filter when searching for "map" or "world", set this to ["map","world"].

  • hidden_sections array

    This property will extend the setting from base_question_type in the specified widget type.

  • image string

    URI - Changes the image that will appear in the tile view for this question type. If no image is defined a default image for the according question_type will be displayed.

  • image_preview_placeholder string

    Define the URL of an image which is displayed as a placeholder in questions which show an image preview. The specified image is shown, if the image source of the question is empty or points to an incorrect url. Overrides base_question_type.image_preview_placeholder.

  • name string

    Changes the display name of the question type in the tile view

  • reference string

    A unique reference that identifies the Question Type Template. This attribute is only applicable to question_type_templates.

  • shown array

    Define which previously hidden attributes should be shown. This is useful, if you define hidden attributes in base_question_type.hidden, but want to show them for a certain question type only.

  • shown_sections array

    This property will extend the setting from base_question_type in the specified widget type.

Related articles