Follow

Using Multiple Item Bank Sources

This article outlines how to initialise the Items API with items from multiple content sources – either different item banks and/or different item bank pools

The Items API by default will source items from the requesting clients default item bank, or, item bank pool if specified in the request.

However, if the requesting client wishes to combine items from multiple item bank sources, they can do so by setting the source information at an item level granularity.

Typically, an individual item is represented by its item reference string – the rest of the item information is implied in the request, i.e. the requesting clients default item bank, the item bank pool supplied in the request, and a unique item id derived from the fact that the item reference is unique per item bank.

When specifying an item source however, more information is required – i.e. an item bank reference (known as an organisation_id), and subsequently an additional unique id (since item reference uniqueness is no longer implied).

Items request examples

Common Items API usage – default item bank

Here the client (Organisation A) is retrieving content from the default item bank attached to their consumer credentials.

Common Items API usage

Advanced Items API usage #1 – alternate item bank

Here the client (Organisation A) is retrieving content from an alternate item bank that they have been given access to, Organisation B.

Common Items API usage

Advanced Items API usage #2 – multiple item banks

Here the client (Organisation A) is retrieving content from multiple item banks that they have been given access to.

Common Items API usage

Advanced Items API usage #3 – multiple item banks/pools

Here the client (Organisation A) is retrieving content from multiple item banks as well as pools.

Common Items API usage

To achieve the advanced usage as shown above, a support request needs to be made to Learnosity to enable a single consumer to have access to multiple item banks that they may have.

Sample Code

/*
|---------------------------------------------------------
| Common Items API usage
|---------------------------------------------------------
|
| array of item reference strings
|
*/

"items": [
    "ccore_video_260_classification",
    "ccore_parcc_tecr_grade3"
]


/*
|---------------------------------------------------------
| Advanced Items API usage #1 – alternate item bank
|---------------------------------------------------------
|
| Specifying an alternate `organisation_id` at the root
| of the configuration object
|
*/

{
    "organisation_id": 9356,
    "activity_id": "itemsassessdemo",
    "name": "Items API demo - assess activity",
    "items": [
        "ccore_video_260_classification",
        "ccore_parcc_tecr_grade3"
    ]
}


/*
|---------------------------------------------------------
| Advanced Items API usage #2 – multiple item banks
|---------------------------------------------------------
|
| Specify an array of item source objects in
| the `items` array
|
| Note that we can re-use the `reference` as the `id`
| if it remains unique within the request
|
*/

"items": [
    {
        // No `organisation_id` specified, so the default will be used
        "id": "ccore_video_260_classification",
        "reference": "ccore_video_260_classification"
    },
    {
        // An `organisation_id` is specified, so it will become the source
        "organisation_id": 1,
        "id": "ccore_parcc_tecr_grade3",
        "reference": "ccore_parcc_tecr_grade3"
    }
]


/*
|---------------------------------------------------------
| Advanced Items API usage #3 – multiple item banks/pools
|---------------------------------------------------------
|
| Specify an array of item source objects in the `items`
| array that includes an `item_pool_id`
|
| Note that we can re-use the `reference` as the `id`
| if it remains unique within the request
|
*/

"items": [
    {
        // No `organisation_id` specified, so the default will be used
        "id": "ccore_video_260_classification",
        "reference": "ccore_video_260_classification"
    },
    {
        // An `organisation_id` and `item_pool_id` are specified,
        // so they will become the source
        "organisation_id": 1,
        "item_pool_id": "january_snapshot",
        "reference": "ccore_parcc_tecr_grade3",
        "id": "ccore_parcc_tecr_grade3"
    }
],

For item level granularity of item sources, the following information is required per item.

Important: Once one item is defined with explicit source attributes, all items must be defined with an explicit source.

Attribute Required Description
id Required A request client supplied unique id for an item - must be unique across all items.
Note: in most cases, reference and idcan be the same. id is required to avoid conflicts in item uniqueness only.
reference Required Item reference
organisation_id Optional - only required when explicitly defining an item from a source that is different to the activity source The unique identifier for the item bank
Note: if an item_pool_id is supplied at the activity level of the request, it can be nullified at the item level by supplying an organisation_id
item_pool_id Optional - only used when requesting from an item bank pool Used to request items from an item bank pool.
Important: make sure the correct organisation_id for this pool is supplied, either at the activity level of the request, or explicitly at the item level of the request.

A demo of this functionality can be found in the multiple item bank/item bank pools advanced demo

The requested items in the demo take the following form:

(Note that item 1 and item 2 do not supply an organisation_id or an item_pool_id because they are already supplied at the activity level of the request).
(Note that item 3 and item 5 do supply an organisation_id, because they are coming from the item bank with organisation_id 1 but NOT an item bank pool).

"organisation_id": 1,
"item_pool_id": "MIBKIBKP_ITEM_POOL_1",
"items": [
   {
        "reference": "MIBKIBKP_Item_1",
        "id": "item_1"
    },
   {
        "reference": "MIBKIBKP_Item_2",
        "id": "item_2"
    },
   {
        "reference": "MIBKIBKP_Item_3",
        "organisation_id": 1,
        "id": "item_3"
    },
   {
        "reference": "MIBKIBKP_Item_4",
        "organisation_id": 1,
        "id": "item_4",
        "item_pool_id": "MIBKIBKP_ITEM_POOL_2"
    },
   {
        "reference": "MIBKIBKP_Item_5",
        "organisation_id": 1,
        "id": "item_5"
    }
],
"config": {
    "navigation": {
        "show_intro": true,
        "intro_item": {
            "reference": "MIBKIBKP_INTRO",
            "organisation_id": 1,
            "item_pool_id": "MIBKIBKP_INTRO_OUTRO",
            "id": "intro"
        },
        "show_outro": true,
        "outro_item": {
            "reference": "MIBKIBKP_OUTRO",
            "organisation_id": 1,
            "item_pool_id": "MIBKIBKP_INTRO_OUTRO",
            "id": "outro"
        }
    }
}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments