Public Method Items API

getItems()

Returns the JSON object data for each Item of the Activity.

You would want to use this method so that you can loop through all the Items and check if a specific Item is in the Activity, for example.

Examples

var items = itemsApp.getItems();
console.log(items);

// Return data example for rendering_type: "assess"
{
    ccore_002_ReorderText: {
        active: false,
        attempt_status: true,
        content: "My Item content",
        feature_ids: [],
        metadata: {
            scoring_type: "per-question"
        },
        response_ids: [
            "ccore_widget21"
        ],
        source: {
            organisation_id: 1,
            reference: "ccore_002_ReorderText"
        },
        time: 317
        user_flagged: false,
        viewed: true
    }
}

// Return data example for rendering_type: "inline"
{
    ccore_002_ReorderText: {
        content: "My Item content",
        feature_ids: [],
        metadata: {
            scoring_type: "per-question"
        },
        reference: "ccore_002_ReorderText",
        response_ids: [
            "ccore_widget21"
        ],
        source: {
            organisation_id: 1,
            reference: "ccore_002_ReorderText"
        },
        workflow: []
    }
}

Arguments

None.

Return value

object

An object where each key is the Item reference and the values are the JSON data objects for each Item.

Related articles

  • The getQuestions() method, the method used to get the JSON object data for all Questions in the assessment.
  • The getFeatures() method, the method used to get the JSON object data for all Features in the assessment.
Was this article helpful?