Get Scores from Line Item
The LTI® protocol allows you to retrieves scores from the LMS grade book through the Assignment and Grades - Results service. LTIAAS gives you access to this service through the /api/lineitems/:lineItemID/scores
API endpoint.
Please check our Manipulating grades guide and its Retrieving grades section to learn more about using this endpoint.
API Authentication Method | Supported |
---|---|
LTIK-AUTH-V2 | ✅ |
SERVICE-AUTH-V1 | ✅ |
Bearer |
Path Parameters
The URL encoded line item ID.
Query Parameters
Used to to filter the results to a single user. The results MUST contain at most 1 result. An empty array MAY be returned if the user does not have any result recorded.
Possible values: >= 1
Used to to restrict the number of results returned; the platform MAY further reduce the number of results returned at its own discretion.
Retrieves scores from a specific URL
- 200
- 401
Schema
- Array [
- ]
scores object[] required
The platform must return a result record for each user that has a non empty 'resultScore' for the queried upon line item. The platform MAY skip empty results.
URL uniquely identifying the result record.
The userId contains the LTI® user ID identifying the recipient of the Result (usually a learner). The userId MUST be present.
URL identifying the Line Item to which this result belongs. Must be the same as the line item id and the value of the lineitem claim when included in the LTI® message.
The timestamp MUST be present and indicate when the score was changed; it is intended to be used by the platform as a way to guard against out of order score updates. Score timestamp represents the server time when the Score state was modified.
The current score for this user. The value must be a numeric value. If no value exists, this attribute may be omitted, or have an explicit null value.
Possible values: > 0
The 'resultMaximum' value MUST be a positive number (with 0 considered a negative number); if no value is specified, then a default maximum value of 1 must be used.
The current value for the comment. The value must be a string. If no value exists, this attribute may be omitted, blank or have an explicit null value.
A URL pointing to the next page of line items.
A URL pointing to the previous page of line items.
A URL pointing to the first page of line items.
A URL pointing to the last page of line items.
{
"scores": [
{
"id": "https://lms.example.com/course/1/lineitems/1/scores/2",
"userId": "2",
"scoreOf": "https://lms.example.com/course/1/lineitems/1",
"timestamp": "2020-06-02T10:51:08-03:00",
"resultScore": 95,
"resultMaximum": 100,
"comment": "string"
}
],
"next": "https://lms.example.com/course/1/lineitems/1/scores?page=3",
"prev": "https://lms.example.com/course/1/lineitems/1/scores?page=1",
"first": "https://lms.example.com/course/1/lineitems/1/scores?page=1",
"last": "https://lms.example.com/course/1/lineitems/1/scores?page=3"
}
Unauthorized. Please check our guide on Authenticating API requests to learn about how authentication works in the LTIAAS API.
Schema
Default value: 401
Default value: Unauthorized
details object required
{
"status": 401,
"error": "Unauthorized",
"details": {
"message": "INVALID_LTIK_AUTH_AUTHORIZATION_HEADER",
"description": "Invalid or expired ltik."
}
}