-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
4,741 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Result API | ||
|
||
|
||
Result API for IMS Assignment and Grade Services | ||
|
||
|
||
A Result object looks like: | ||
|
||
{ | ||
// The fully qualified URL for showing the Result | ||
"id": "http://institution.canvas.com/api/lti/courses/5/line_items/2/results/1", | ||
// The lti_user_id or the Canvas user_id | ||
"userId": "50 | 'abcasdf'", | ||
// The score of the result as defined by Canvas, scaled to the resultMaximum | ||
"resultScore": 50, | ||
// Maximum possible score for this result; 1 is the default value and will be | ||
// assumed if not specified otherwise. Minimum value of 0 required. | ||
"resultMaximum": 50, | ||
// Comment visible to the student about the result. | ||
"comment": null, | ||
// URL of the line item this belongs to | ||
"scoreOf": "http://institution.canvas.com/api/lti/courses/5/line_items/2" | ||
} | ||
|
||
|
||
Show a collection of ResultsLti::Ims::ResultsController#index | ||
|
||
|
||
|
||
GET /api/lti/courses/:course_id/line_items/:line_item_id/results | ||
|
||
Show existing Results of a line item. Can be used to retrieve a specific studentâs result by adding the user_id (defined as the lti_user_id or the Canvas user_id) as a query parameter (i.e. user_id=1000). If user_id is included, it will return only one Result in the collection if the result exists, otherwise it will be empty. May also limit number of results by adding the limit query param (i.e. limit=100) | ||
|
||
|
||
Show a ResultLti::Ims::ResultsController#show | ||
|
||
|
||
|
||
GET /api/lti/courses/:course_id/line_items/:line_item_id/results/:id | ||
|
||
Show existing Result of a line item. |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
Score API | ||
|
||
|
||
Score API for IMS Assignment and Grade Services | ||
|
||
|
||
A Score object looks like: | ||
|
||
{ | ||
// The lti_user_id or the Canvas user_id | ||
"userId": "50 | 'abcasdf'", | ||
// The Current score received in the tool for this line item and user, scaled to | ||
// the scoreMaximum | ||
"scoreGiven": 50, | ||
// Maximum possible score for this result; it must be present if scoreGiven is | ||
// present. | ||
"scoreMaximum": 50, | ||
// Comment visible to the student about this score. | ||
"comment": null, | ||
// Date and time when the score was modified in the tool. Should use subsecond | ||
// precision. | ||
"timestamp": "2017-04-16T18:54:36.736+00:00", | ||
// Indicate to Canvas the status of the user towards the activity's completion. | ||
// Must be one of Initialized, Started, InProgress, Submitted, Completed | ||
"activityProgress": "Completed", | ||
// Indicate to Canvas the status of the grading process. A value of | ||
// PendingManual will require intervention by a grader. Values of NotReady, | ||
// Failed, and Pending will cause the scoreGiven to be ignored. FullyGraded | ||
// values will require no action. Possible values are NotReady, Failed, Pending, | ||
// PendingManual, FullyGraded | ||
"gradingProgress": "FullyGraded" | ||
} | ||
|
||
|
||
Create a ScoreLti::Ims::ScoresController#create | ||
|
||
|
||
|
||
POST /api/lti/courses/:course_id/line_items/:line_item_id/scores | ||
|
||
Create a new Result from the score params. If this is for the first created line_item for a resourceLinkId, or it is a line item that is not attached to a resourceLinkId, then a submission record will be created for the associated assignment when gradingProgress is set to FullyGraded or PendingManual. | ||
The submission score will also be updated when a score object is sent with either of those two values for gradingProgress. If a score object is sent with either of FullyGraded or PendingManual as the value for gradingProgress and scoreGiven is missing, the assignment will not be graded. This also supposes the line_item meets the condition to create a submission. | ||
A submission comment with an unknown author will be created when the comment value is included. This also supposes the line_item meets the condition to create a submission. | ||
It is also possible to submit a file along with this score, which will attach the file to the submission that is created. Files should be formatted as Content Items, with the correct syntax below. | ||
Returns a url pointing to the Result. If any files were submitted, also returns the Content Items which were sent in the request, each with a url pointing to the Progress of the file upload. | ||
Parameter | | Type | Description | ||
userId | Required | string | The lti_user_id or the Canvas user_id. Returns a 422 if user not found in Canvas or is not a student. | ||
activityProgress | Required | string | Indicate to Canvas the status of the user towards the activityâs completion. Must be one of Initialized, Started, InProgress, Submitted, Completed. | ||
gradingProgress | Required | string | Indicate to Canvas the status of the grading process. A value of PendingManual will require intervention by a grader. Values of NotReady, Failed, and Pending will cause the scoreGiven to be ignored. FullyGraded values will require no action. Possible values are NotReady, Failed, Pending, PendingManual, FullyGraded. | ||
timestamp | Required | string | Date and time when the score was modified in the tool. Should use ISO8601-formatted date with subsecond precision. Returns a 400 if the timestamp is earlier than the updated_at time of the Result. | ||
scoreGiven | | number | The Current score received in the tool for this line item and user, scaled to the scoreMaximum | ||
scoreMaximum | | number | Maximum possible score for this result; it must be present if scoreGiven is present. Returns 412 if not present when scoreGiven is present. | ||
comment | | string | Comment visible to the student about this score. | ||
https://canvas.instructure.com/lti/submission | | Object | (EXTENSION) Optional submission type and data. Fields listed below. | ||
https://canvas.instructure.com/lti/submission[new_submission] | | boolean | (EXTENSION field) flag to indicate that this is a new submission. Defaults to true unless submission_type is none. | ||
https://canvas.instructure.com/lti/submission[preserve_score] | | boolean | (EXTENSION field) flag to prevent a request from clearing an existing grade for a submission. Defaults to false. | ||
https://canvas.instructure.com/lti/submission[prioritize_non_tool_grade] | | boolean | (EXTENSION field) flag to prevent a request from overwriting an existing grade for a submission. Defaults to false. | ||
https://canvas.instructure.com/lti/submission[submission_type] | | string | (EXTENSION field) permissible values are: none, basic_lti_launch, online_text_entry, external_tool, online_upload, or online_url. Defaults to external_tool. Ignored if content_items are provided. | ||
https://canvas.instructure.com/lti/submission[submission_data] | | string | (EXTENSION field) submission data (URL or body text). Only used for submission_types basic_lti_launch, online_text_entry, online_url. Ignored if content_items are provided. | ||
https://canvas.instructure.com/lti/submission[submitted_at] | | string | (EXTENSION field) Date and time that the submission was originally created. Should use ISO8601-formatted date with subsecond precision. This should match the data and time that the original submission happened in Canvas. | ||
https://canvas.instructure.com/lti/submission[content_items] | | Array | (EXTENSION field) Files that should be included with the submission. Each item should contain âtype: file`, and a url pointing to the file. It can also contain a title, and an explicit MIME type if needed (otherwise, MIME type will be inferred from the title or url). If any items are present, submission_type will be online_upload. | ||
|
||
The lti_user_id or the Canvas user_id. Returns a 422 if user not found in Canvas or is not a student. | ||
Indicate to Canvas the status of the user towards the activityâs completion. Must be one of Initialized, Started, InProgress, Submitted, Completed. | ||
Indicate to Canvas the status of the grading process. A value of PendingManual will require intervention by a grader. Values of NotReady, Failed, and Pending will cause the scoreGiven to be ignored. FullyGraded values will require no action. Possible values are NotReady, Failed, Pending, PendingManual, FullyGraded. | ||
Date and time when the score was modified in the tool. Should use ISO8601-formatted date with subsecond precision. Returns a 400 if the timestamp is earlier than the updated_at time of the Result. | ||
The Current score received in the tool for this line item and user, scaled to the scoreMaximum | ||
Maximum possible score for this result; it must be present if scoreGiven is present. Returns 412 if not present when scoreGiven is present. | ||
Comment visible to the student about this score. | ||
(EXTENSION) Optional submission type and data. Fields listed below. | ||
(EXTENSION field) flag to indicate that this is a new submission. Defaults to true unless submission_type is none. | ||
(EXTENSION field) flag to prevent a request from clearing an existing grade for a submission. Defaults to false. | ||
(EXTENSION field) flag to prevent a request from overwriting an existing grade for a submission. Defaults to false. | ||
(EXTENSION field) permissible values are: none, basic_lti_launch, online_text_entry, external_tool, online_upload, or online_url. Defaults to external_tool. Ignored if content_items are provided. | ||
(EXTENSION field) submission data (URL or body text). Only used for submission_types basic_lti_launch, online_text_entry, online_url. Ignored if content_items are provided. | ||
(EXTENSION field) Date and time that the submission was originally created. Should use ISO8601-formatted date with subsecond precision. This should match the data and time that the original submission happened in Canvas. | ||
(EXTENSION field) Files that should be included with the submission. Each item should contain âtype: file`, and a url pointing to the file. It can also contain a title, and an explicit MIME type if needed (otherwise, MIME type will be inferred from the title or url). If any items are present, submission_type will be online_upload. | ||
{ | ||
"timestamp": "2017-04-16T18:54:36.736+00:00", | ||
"scoreGiven": 83, | ||
"scoreMaximum": 100, | ||
"comment": "This is exceptional work.", | ||
"activityProgress": "Completed", | ||
"gradingProgress": "FullyGraded", | ||
"userId": "5323497", | ||
"https://canvas.instructure.com/lti/submission": { | ||
"new_submission": true, | ||
"preserve_score": false, | ||
"submission_type": "online_url", | ||
"submission_data": "https://instructure.com", | ||
"submitted_at": "2017-04-14T18:54:36.736+00:00", | ||
"content_items": [ | ||
{ | ||
"type": "file", | ||
"url": "https://instructure.com/test_file.txt", | ||
"title": "Submission File", | ||
"media_type": "text/plain" | ||
} | ||
] | ||
} | ||
} | ||
{ | ||
"resultUrl": "https://canvas.instructure.com/url/to/result", | ||
"https://canvas.instructure.com/lti/submission": { | ||
"content_items": [ | ||
{ | ||
"type": "file", | ||
"url": "https://instructure.com/test_file.txt", | ||
"title": "Submission File" | ||
"progress": "https://canvas.instructure.com/url/to/progress" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Search API | ||
|
||
|
||
|
||
|
||
Find recipientsSearchController#recipients | ||
|
||
|
||
|
||
GET /api/v1/conversations/find_recipients | ||
|
||
|
||
|
||
GET /api/v1/search/recipients | ||
|
||
Find valid recipients (users, courses and groups) that the current user can send messages to. The /api/v1/search/recipients path is the preferred endpoint, /api/v1/conversations/find_recipients is deprecated. | ||
Pagination is supported. | ||
Parameter | | Type | Description | ||
search | | string | Search terms used for matching users/courses/groups (e.g. âbob smithâ). If multiple terms are given (separated via whitespace), only results matching all terms will be returned. | ||
context | | string | Limit the search to a particular course/group (e.g. âcourse_3â or âgroup_4â). | ||
exclude[] | | string | Array of ids to exclude from the search. These may be user ids or course/group ids prefixed with âcourse_â or âgroup_â respectively, e.g.exclude[]=1&exclude=2&exclude[]=course_3 | ||
type | | string | Limit the search just to users or contexts (groups/courses).Allowed values:user,context | ||
user_id | | integer | Search for a specific user id. This ignores the other above parameters, and will never return more than one result. | ||
from_conversation_id | | integer | When searching by user_id, only users that could be normally messaged by this user will be returned. This parameter allows you to specify a conversation that will be referenced for a shared context â if both the current user and the searched user are in the conversation, the user will be returned. This is used to start new side conversations. | ||
permissions[] | | string | Array of permission strings to be checked for each matched context (e.g. âsend_messagesâ). This argument determines which permissions may be returned in the response; it wonât prevent contexts from being returned if they donât grant the permission(s). | ||
|
||
Search terms used for matching users/courses/groups (e.g. âbob smithâ). If multiple terms are given (separated via whitespace), only results matching all terms will be returned. | ||
Limit the search to a particular course/group (e.g. âcourse_3â or âgroup_4â). | ||
Array of ids to exclude from the search. These may be user ids or course/group ids prefixed with âcourse_â or âgroup_â respectively, e.g.exclude[]=1&exclude=2&exclude[]=course_3 | ||
Limit the search just to users or contexts (groups/courses). | ||
Allowed values:user,context | ||
Search for a specific user id. This ignores the other above parameters, and will never return more than one result. | ||
When searching by user_id, only users that could be normally messaged by this user will be returned. This parameter allows you to specify a conversation that will be referenced for a shared context â if both the current user and the searched user are in the conversation, the user will be returned. This is used to start new side conversations. | ||
Array of permission strings to be checked for each matched context (e.g. âsend_messagesâ). This argument determines which permissions may be returned in the response; it wonât prevent contexts from being returned if they donât grant the permission(s). | ||
The unique identifier for the user/context. For groups/courses, the id is prefixed by âgroup_â/âcourse_â respectively. | ||
The name of the context or short name of the user | ||
Only set for users. The full name of the user | ||
Avatar image url for the user/context | ||
Type of recipients to return, defaults to null (all). âcontextâ encompasses âcourseâ, âsectionâ and âgroupâ | ||
Array of recipient types to return (see type above), e.g.types[]=user&types=course | ||
Only set for contexts, indicates number of messageable users | ||
Only set for users. Hash of course ids and enrollment types for each course to show what they share with this user | ||
Only set for users. Hash of group ids and enrollment types for each group to show what they share with this user | ||
Only set for contexts. Mapping of requested permissions that the context grants the current user, e.g. { send_messages: true } | ||
[ | ||
{"id": "group_1", "name": "the group", "type": "context", "user_count": 3}, | ||
{"id": 2, "name": "greg", "full_name": "greg jones", "common_courses": {}, "common_groups": {"1": ["Member"]}} | ||
] | ||
|
||
|
||
List all coursesSearchController#all_courses | ||
|
||
|
||
|
||
GET /api/v1/search/all_courses | ||
|
||
A paginated list of all courses visible in the public index | ||
Parameter | | Type | Description | ||
search | | string | Search terms used for matching users/courses/groups (e.g. âbob smithâ). If multiple terms are given (separated via whitespace), only results matching all terms will be returned. | ||
public_only | | boolean | Only return courses with public content. Defaults to false. | ||
open_enrollment_only | | boolean | Only return courses that allow self enrollment. Defaults to false. | ||
|
||
Search terms used for matching users/courses/groups (e.g. âbob smithâ). If multiple terms are given (separated via whitespace), only results matching all terms will be returned. | ||
Only return courses with public content. Defaults to false. | ||
Only return courses that allow self enrollment. Defaults to false. |
Oops, something went wrong.