items - Initialization - Items API

Items API Initialization

items

Defines the Items to be used in the current assessment.

This option is essential because this is the main way to specify the Item content, where you are selecting Items and building the assessment according to your own requirements.

This can be defined as an array of unique Item references as strings, or an array of ItemObjects for advanced usage.

Note The items and activity_template_id initialization options are mutually-alternative. Therefore, instead of specifying the individual Items to be delivered via the items initialization option, you could instead use the activity_template_id initialization option and pass an Activity reference. The Activity reference is supported in most Learnosity products and allows you to group Items for use in assessments and reporting.

Values

Attribute path items

  • Type array[strings]

    An array of unique Item references as strings.

    var initializationOptions = {
        items: [
            "my_item_reference_1",
            "my_item_reference_2",
            "my_item_reference_3",
            // ...
        ]
        // ...
    };
    
  • Type array[ItemObject]

    An array of Item objects.

    var initializationOptions = {
        items: [
            {
                "id": "my_item_reference_id_1",
                "reference": "item_reference_1"
            },
            {
                "id": "my_item_reference_id_2",
                "reference": "my_item_reference_2"
            },
            {
                "id": "my_item_reference_id_3",
                "reference": "my_item_reference_3"
            },
            // additional Item object definitions below ...
        ]
    };
    
    • ItemObject object

      Item objects can be used in place of Item references when Items from multiple Item banks or Item pools need to be used within the same Activity.

      The following properties are supported.

      • id string

        A host-page supplied unique identifier (which can be the same as the Item reference).

        Note When using a different value than the reference, some data from Reports API might be affected.

      • reference string

        The Item reference to retrieve.

      • data_table_index integer

        A configuration parameter that will be used to specify the index of a single row in the dynamic content dataset to serve at runtime.

        Note It will override the data_table_index value in dynamic_items.

      • data_table_row string

        A configuration parameter that will be used to specify the key of a single row in the dynamic content dataset to serve at runtime.

        Important Must be a valid UUID.

        Note It has priority over data_table_index.

        Note It has priority over data_table_index value in the dynamic_items initialization option.

      • item_pool_id string

        Sets or override the Item Pool to retrieve Item from.

      • organisation_id string

        Sets or override the Item Bank to retrieve Item from.

      • scoring_type string

        The scoring type specified in the Item Bank can be overridden for each Item. If desired, it can also be overridden for the entire Activity. If both an Item-level and an Activity-level scoring type are specified, the Item-level configuration takes precedence.

      • is_extra_credit boolean

        Controls whether the Item is treated as extra credit.

        You would want to use this so that learners can earn additional points without increasing the maximum possible score for the session.

        When set to true, the Item's earned score contributes to the session score, but the Item's max_score is excluded from the session max_score. As a result, the session score can exceed the session max_score. If the learner answers the Item incorrectly or skips it, there is no penalty.

        Note All Questions within an extra credit Item are treated as extra credit. The flag applies at the Item level, not individual Questions.

        Note Extra credit Items are still counted in attempt statistics (num_questions, count_attempted, count_right_ans, count_wrong_ans).

        Note The is_extra_credit flag can also be set on Items within an Activity template.

        For more information about setting extra credit Items via the authoring UI, see Setting Items as extra credit in an Activity.

        Default: false

        Version added: v2026.3.LTS (now live in developer)

Caveats

Related articles

Was this article helpful?

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