Submit a request
Submit a request

Customizing the Tile View With Author API

You have the ability to customize the Question types shown in the tile view through the question_type_groups init option.

Note: It is not currently possible to customize the features view.

The question_type_groups init option can be used to change the default groups, such as the title, icon, or modify the order of the groups or templates, and also to create new groups.

This article describes how to use this property in order to do the following:

  1. Override default group properties
  2. Reordering groups and templates
  3. Hiding a group or template
  4. Defining new groups
Note that this property can behave different depending on some of the other init options, so to understand how it may be affected, see:

 

This section shows some examples of the use cases of the question_type_groups init option.

In order to modify any default groups, the group reference must be known. Group references are as below:

Table of group references
Default Label Bundle Group Value Reference
Multiple Choice mcq
Fill in the Blanks (Cloze) cloze
Classify, Match & Order match
Written & Recorded writespeak
Highlight highlight
Math math
Graphing graph
Charts chart
Chemistry chemistry
Other other

 

The code block below shows how to modify the name and the icon of two default groups:

question_type_groups: [
    {
        "reference" : "graph",
        "name" : "Overridden Graphing",
        "group_icon": "https://www.learnosity.com/static/img/features/features_proven.png"
    },
    {
        "reference" : "cloze",
        "name" : "Overridden Cloze"
    }
]
        

In order to reorder the groups, pass an array of objects, each of which contains a group reference, in the new desired order. Group references can be found here.

question_type_groups: [
    { "reference" : "math" },
    { "reference" : "chart" },
    { "reference" : "graph" },
    { "reference" : "chemistry" },
    { "reference" : "cloze" },
    { "reference" : "match" },
    { "reference" : "mcq" },
    { "reference" : "highlight" },
    { "reference" : "writespeak" },
    { "reference" : "other" }
]
        

In order to reorder the templates within default groups, the group reference must be passed with an array of references in the desired group. This is very similar to how to hide templates, whereby the default references must be extracted and then provided in a new order.

In order to hide a groups, pass an empty array for template_references for that specific group. 
For example, to hide the Match group:

question_type_groups: [
    {
        "reference" : "match",
        "template_references": []
    }
]
        

In order to hide specific templates within a default group, the group reference must be passed with an array of references to show within that group, i.e. rather than explicitly hiding a specific template, the templates you want to show must be specified.
As an example, for the default group "Classify, Match & Order", there are four widgets displayed: "Classification", "Match List", "Order List" and Sort List".
Therefore, in order to hide "Classification", provide the references for the other three, as per the code below:

question_type_groups: [
    {
        "reference" : "match",
        "template_references": [
            "1fa22aac-1f88-47f7-941b-3c77759549e6",
            "0c7f68f7-2be6-4ae0-8492-0ab78c8d0010",
            "63891006-450a-4ffe-9876-74d62efa0152"
        ]
    }
]
        

The code block below shows how to create a new group with a custom icon. The template_references must be provided, otherwise the group will not show (this is actually how to hide a group, as described here in this article).

These can be the reference of default templates (See this knowledge base article to get references), or the reference of a custom template, provided via question_type_templates.

question_type_groups: [
    {
        "reference" : "newGroup",
        "name" : "New group with icon",
        "group_icon": "https://www.learnosity.com/static/img/logos/learnosity-logo.png",
        "template_references": [
            "e3a30485-ab2d-4ee8-9d0c-5749e96816c1",
            "cb9cb540-05b2-44e0-bef3-1b31727c1c37"
            ]
    }
]
        

The behavior of this property may not be as expected as it can be affected by other init options. To check, please refer to the table below:

Question Type Templates Template Defaults Group Defaults Question Type Groups Behaviour
not set false false not set No groups are displayed, only Question types are listed
not set false false set No groups are displayed, only Question types are listed
not set false true not set No groups are displayed, only Question types are listed
not set false true set No groups are displayed, only Question types are listed
not set true false not set No groups are displayed, Question types and default templates are listed
not set true false set If Question_type_groups matches any default templates (via template_references or its references), then the groups with content are shown. Otherwise no groups are shown and Question types and default templates are listed
not set true true not set Default templates are grouped according to default groups
not set true true set Default templates are grouped according to default groups. If any default templates match question_type_groups, these groups are displayed at the beginning.

If question_type_groups matches any default template groups, then these default groups are extended, e.g. changed text, or logo, or which templates are shown in the group.
set false false not set No groups, custom template types and Question types are listed
set false false set If custom templates are found in question_type_groups, display the groups, otherwise no groups are displayed
set false true not set Since no default templates are found, no groups are displayed, but the custom template tiles are shown
set false true set If custom templates are found in question_type_groups, display the groups, otherwise no groups are displayed, but the custom template tiles are shown
set true false not set No groups are displayed, default and custom templates and Question types are listed
set true false set If custom or default templates are found in question_type_groups display the groups, otherwise no groups are displayed
set true true not set Templates are grouped by default groups
set true true set Templates are grouped by default groups, and if any templates are found in question_type_groups, these groups are displayed at the top of the group list.

If question_type_groups matches any default template groups, then these default groups are overridden, e.g. changed text, or logo, or which templates are shown in the group.
Was this article helpful?
0 out of 0 found this helpful

Did you arrive here by accident? If so, learn more about Learnosity by clicking here.