getActivityItems - Methods - Author API

Author API Methods

getActivityItems()

Returns the current list of Items associated with the Activity being edited.

You would want to use this method so that you can validate the number of Items in the Activity, for example.

Important This method can only be used when in the Activity editor view, when the mode initialization option is set to "activity_edit".

Examples

var items = authorApp.getActivityItems();
console.log(items);

/* When the current Activity has 3 Items, will return:
[
    {
        "reference": "Demo_1",
        "organisation_id": 1
    },
    {
        "reference": "Demo_2",
        "organisation_id": 1
    },
    {
        "reference": "Demo_3",
        "organisation_id": 2,
        "item_pool_id" "another_item_pool"
    }
]
*/

Arguments

None.

Return value

Type array[ItemObject]

Returns an array of ItemObjects for each Item in the Activity.

Returns false if not in the Activity editor view.

Related articles

Was this article helpful?

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