getQuestions - Methods - Items API

Items API Methods

getQuestions()

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

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

Examples

var questions = itemsApp.getQuestions();
console.log(questions);

// Returns
{
  10000: {
    is_math: false,
    metadata: {
        valid_response_count: 1,
        sheet_reference: "Demo4",
        widget_reference: "00000000-0000-4000-0000-000000129905",
        source: {
            organisation_id: 6
        }
    },
    options: [
        {
            label: "Pennsylvania to New England.",
            value: "0"
        },
        {
            label: "Georgia to New England.",
            value: "1"
        },
        {
            label: "Pennsylvania to New York.",
            value: "2"
        }
    ],
    response_id: "10000"
    stimulus: "<p>The Great Wagon Road ran from</p>",
    type: "mcq",
    validation: {
        scoring_type: "exactMatch",
        valid_response: {
            score: 1,
            value: [ "3" ]
        }
    }
}

Arguments

None.

Return value

Type object

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

Related articles

  • The getItems() method, the method used to get the JSON object data for all Items 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?

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