Lti_1p3.Tool.Services.AGS (Lti 1p3 v0.6.0)

Implementation of LTI Assignment and Grading Services (AGS) version 2.0.

For information on the standard, see: https://www.imsglobal.org/spec/lti-ags/v2p0/

Link to this section Summary

Functions

Creates a line item for a resource id. This function returns a line item struct wrapped in a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.

Creates a line item for a resource id, if one does not exist. Whether or not the line item is created or already exists, this function returns a line item struct wrapped in a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.

Returns the line items URL from LTI launch params. If not present returns nil. If a registration is present, uses the auth server domain + the line items path.

Returns true if grade pass back service is enabled with the necessary scopes. The necessary scopes are the line item scope to read all line items and create new ones and the scores scope, to be able to post new scores. Also verifies that the line items endpoint is present.

Returns true if the LTI AGS claim has a particular scope url, false if it does not.

Post a score to an existing line item, using an already acquired access token.

Returns the required scopes for the AGS service.

Updates an existing line item. On success returns a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.

Link to this section Functions

Link to this function

create_line_item(line_items_service_url, resource_id, score_maximum, label, access_token)

Creates a line item for a resource id. This function returns a line item struct wrapped in a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.

Link to this function

fetch_line_items(line_items_service_url, access_token)

Link to this function

fetch_or_create_line_item(line_items_service_url, resource_id, maximum_score_provider, label, access_token)

Creates a line item for a resource id, if one does not exist. Whether or not the line item is created or already exists, this function returns a line item struct wrapped in a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.

Link to this function

get_line_items_url(lti_launch_params, registration \\ %{})

Returns the line items URL from LTI launch params. If not present returns nil. If a registration is present, uses the auth server domain + the line items path.

Link to this function

grade_passback_enabled?(lti_launch_params)

Returns true if grade pass back service is enabled with the necessary scopes. The necessary scopes are the line item scope to read all line items and create new ones and the scores scope, to be able to post new scores. Also verifies that the line items endpoint is present.

Link to this function

has_scope?(lti_ags_claim, scope_url)

Returns true if the LTI AGS claim has a particular scope url, false if it does not.

Link to this function

post_score(score, line_item, access_token)

Post a score to an existing line item, using an already acquired access token.

Link to this function

required_scopes()

Returns the required scopes for the AGS service.

Link to this function

update_line_item(line_item, changes, access_token)

Updates an existing line item. On success returns a {:ok, line_item} tuple. On error, returns a {:error, error} tuple.