sections.Overview
When initializing Items API with an array of Items or an activity_template_id, the whole Activity can be considered one section. The assessment workflow and any configuration will apply to the whole Activity.
Items API offers a way to group Items within an Activity via the sections configuration, thus enabling a multi-assessment workflow experience. Each section can be regarded as a "mini assessment" with localized customization.
The sections attribute is an array of objects containing two attributes, items and config that allow configuration of each section within the initialization request.
| Attributes | Types | Description |
|---|---|---|
| items | string | object | This works exactly like items in a normal Activity. Each Item can be set by passing an Item reference (string), or an Item object. See examples of each further below. |
| config | object |
You can override initial configuration by passing the following attributes:
|
The sections_options attribute is an array of objects that allow global configuration for a sectioned assessment. See the following table for the available attributes:
| Attributes | Types | Description |
|---|---|---|
| allow_backward_navigation | boolean |
This attribute if set to Default: |
| display_total_item_count | boolean |
This allows the full Activity Item count to display for each section. By default the total Items for each section is displayed as the sum of that section and all previous sections. e.g. With an assessment configured as 3 sections of 5 Items, in section one the counter will display x of 5 Items, in section two it will display x of 10, section 3 is x of 15. Setting this attribute Default: |
| reset_itemcount_per_section | boolean |
This attribute, when set as Note that this attribute will be ignored if Default: |
Example - initializing Item references
This example shows how to initialize Items API with sections using references.
"request": {
"activity_id": "itemsassessdemo",
"name": "Section Demo",
"rendering_type": "assess",
"type": "submit_practice",
"session_id": "60099-1516609454-8888-8864fd",
"user_id": "student1",
"config": {
"configuration": {
"section_options": {
"allow_backward_navigation": true
}
}
},
"sections": [
{
"items": [
"Demo3",
"Demo4"
],
"config": {
"title": "Vocabulary section",
"subtitle": "Timer per section - Section 1 (hard limit)",
"region_overrides": {
"top-right.timer_element": false
},
"time": {
"max_time": 10,
"limit_type": "hard",
"countdown_option": false,
"countdown": 10
},
"configuration": {
"shuffle_items": true
}
}
},
{
"items": [
"Demo6",
"Demo7",
"Demo8"
],
"config": {
"title": "Vocabulary section",
"subtitle": "Timer per section - Section 2 (soft limit)",
"time": {
"max_time": 10,
"limit_type": "soft",
"countdown_option": true,
"countdown": 10
},
"configuration": {
"shuffle_items": false
}
}
}
],
...
}
Example - initializing with Item objects
This example shows how to initialize Items API with sections using objects.
"request": {
"activity_id": "itemsassessdemo",
"name": "Section Demo",
"rendering_type": "assess",
"type": "submit_practice",
"session_id": "60099-1516609454-8888-8864fd",
"user_id": "student1",
"sections": [
{
"items": [
{
"id": "question-demoscience1",
"reference": "question-demoscience1"
},
{
"id": "question-demoscience2",
"reference": "question-demoscience2"
}
],
"config": {
"subtitle": "Vocabulary section"
}
},
{
"items": [
{
"id": "question-demowork1",
"reference": "question-demowork1"
},
{
"id": "question-demowork2",
"reference": "question-demowork2"
},
{
"id": "question-demowork3",
"reference": "question-demowork3"
}
],
"config": {
"subtitle": "Grammar section"
}
}
],
...
}
Example - initializing Items API in review
Note, if you want to render a session that uses sections in the review state of Items API, you need to consider 2 configuration options:
config.configuration.decouple_submit_from_reviewconfig.configuration.section_options.allow_backward_navigation
Without these options, learners will not be able to navigate between sections in the review state.
"request": {
"activity_id": "itemsassessdemo",
"name": "Section Demo",
"rendering_type": "assess",
"state": "review",
"type": "submit_practice",
"session_id": "60099-1516609454-8888-8864fd",
"user_id": "student1",
"config": {
"configuration": {
"decouple_submit_from_review": true,
"section_options": {
"allow_backward_navigation": true
}
}
},
"sections": [
{
"items": [
"question-demoscience1",
"question-demoscience2"
],
"config": {
"subtitle": "Vocabulary section"
}
},
{
"items": [
"question-demowork1",
"question-demowork2",
"question-demowork3"
],
"config": {
"subtitle": "Grammar section"
}
}
]
}
Live Demo
A demo of a multi-section assessment can be found in the sections demo.