{{warning}}

Score

This call allows the load of a score from an Item Session.

Load Score for an Item Session

Suppose there is an item session that has a correct saved response of "ChoiceA" for a multiple-choice component named "question-1", the following request will load the score for the Item Session:


    $ curl http://platform.corespring.org/api/v2/sessions/:sessionId/score.json?access_token={token} -H 'Content-Type: application/json' --compressed

Score Result format

The score result contains a summary and components.

Example Response:


    {
      "summary": {
          "maxPoints": 1,
          "points": 1,
          "percentage": 100
      },
      "components": {
          "question-1": {
              "weight": 1,
              "score": 1,
              "weightedScore": 1
          }
      }
    }

summary

A summary of the overall score for the item--the sum of the weightedScore and weight defined components section.

components

Components contain the individual scores for each interaction that is contained within the item. The author will define a weight for the given interaction. The score will be a value between 0.0 and 1.0. The weightedScore is the result of multiplying score * weight.

Note: The term component is roughly synonymous with interaction. Components are a superset of interactions which include non-scorable widgets such as videos and layout configurations.

Custom Response Processing

Custom response processing can be achieved using the scoring tab in the 'dev editor'. The form of the custom scoring function should be:

exports.process = function(item, session, outcomes) {
  var score = 1; // whatever the score should be
  return {
    summary: {
      score: score
    }
  };
};

The parameters to the process function are described below:

item

The item parameter contains the JSON representation of the item. You can find JSON schemas and examples for the item's components format on the items page.

session

The session parameter contains the un-scored item session provided by the student.

outcomes

Detailed information about how the individual components were scored by the CoreSpring platform is maintained in the outcomes parameter. This represents a javascript object whose keys are the component identifiers and whose values are objects representing the response processed by the CoreSpring platform. JSON schemas and examples for the response format on the items page.