setActivityItems()
Sets the Items to be used in the Activity being edited. This overwrites the current Items in the Activity.
You would want to use this method so that you can programatically add default Items when a new Activity is created, for example.
If using Items from multiple Item banks for an Activity, you can set up an array of ItemBankDefinition
as an entry in Activity edit's item_banks
.
Examples
authorApp.setActivityItems(
[
{
reference: "test1",
organisation_id: 1
},
{
reference: "test3",
organisation_id: 1,
item_pool_id: "pool_1"
}
]
);
Arguments
-
items array[ItemObject]
An array of Item references. Any reference that do not correspond to an existing Item in the Item bank is ignored.
Return value
booleanReturns true
if successful.
Returns false
if unable to to set the Activity Items, for example, when not in the Activity editor view.
Type definitions
ItemBankDefinition object
An ItemBankDefinition describes from which sources Items can be loaded for an Activity. It is used as an entry in Activity edit's item_banks
.
-
organisation_id numberSpecifies the organisation from which the Items are loaded.
-
item_bank_name stringThe name of the Item bank displayed by Author API.
-
item_pool_id stringThe ID of the Item pool from which Items are loaded.
-
filter objectA specific filter for the Item bank. The object structure of the filter is the same as the Item search filter.