Assess API Initialization
region_overrides
Directly override the assessment player interface regions, region elements, or region element options. In the assessment player, regions are configurable sections of the user interface. This option can be used to add, remove, or update elements within regions by directly targeting them and overriding their default settings.
You would want to specify this option so that you can, for example, keep the default settings for all regions and remove one specific element such as the itemcount_element
which displays the current position of the Item being attempted.
See Customizing the Assessment Player experience with User Interface Regions for more information.
To completely customize all regions with your own set of default settings, consider using the regions
initialization option.
Examples
// The following overrides the default settings to:
// 1. remove the top-left region,
// 2. set the bottom region to only use the horizontal table of contents element.
const initializationObject = {
"config": {
"region_overrides": {
"top-left": false,
"bottom": [
{ "type": "horizontaltoc_element" }
]
}
}
};
Values
Attribute path region_overrides
Type RegionsObject
Caveats
The "items"
region can only be customized using the regions
initialization option. The "items"
region cannot be overridden with region_overrides
or changed using customized regions for sections. This means that even if you define the "items"
region for a section or add it to the region_overrides
, it will be ignored by the assessment player.
Type definitions
-
RegionsObject object
An object containing settings for each available region in the assessment player.
-
[region_name] array[RegionElementObject] boolean
The
[region_name]
refers to the name of a particular region in the assessment player and can be one of the following:"top"
"top-left"
"top-right"
"items"
"right"
"bottom-left"
"bottom-right"
"bottom"
Multiple regions can be customized by adding the region names as the attributes in this object.
-
[region_name.element_type] boolean
This format is similar to the array[RegionElementObject] approach with a simplified notation for each element and uses default values.
The
region_name
refers to the name of a particular region in the assessment player and can be any of the following:"top"
"top-left"
"top-right"
"items"
"right"
"bottom-left"
"bottom-right"
"bottom"
The
element_type
refers to a specific region element or button. See Elements and buttons for a full list of region elements.// override particular region element settings: // 1. add timer element to the "top-right" region // 2. add calculator element to the "right" region // 3. remove the full screen element from the "right" region // 4. add horizontaltoc element to the "bottom" region var initializationOptions = { "config": { "region_overrides": { "top-right.timer_element": true, "right.calculator_button": true, "right.fullscreen_button": false, "bottom-right.horizontaltoc_element": true } } };
Possible values
-
true
add the element with default settings -
false
remove the element from the region
-
-
RegionElementObject object
Elements along with their common properties are available to add to the regions as a RegionElementObject. These are parts of the user interface you are intending to change or replace, such as the buttons, menus or table of contents.
See Elements and buttons for a full list of region elements.
Common properties for the RegionElementObject are listed below. Some elements may have additional settings that can be configured.
-
type string
The name of a specific element, e.g.
itemcount_element
. -
position string
The position of the element within the region.
Possible values
"left"
"right"
-
show_label_option boolean
Show the text label in the button, next to the icon.
Default:
true
-
hide_label_option boolean
Hide the text label in the button, leaving only the icon.
Default:
false
-
Related articles
- Customizing the Assessment Player experience with User Interface Regions
- The
regions
initialization option, which can be used to configure regions in the assessment player.