Submissions
List Submissions
submissions.list(class_id, assignment_id, options);
Retrieve a list of Submissions for an Assignment in a Class.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
options | object | This function supports standard paging options. |
Example Usage
for await (const submission of edlink.submissions.list(class_id, assignment_id)) {
console.log(submission.person_id, submission.state, submission.grade);
}
Fetch Submission
submissions.fetch(class_id, assignment_id, submission_id);
Retrieve a Submission for an Assignment in a Class.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
submission_id | string | The UUID of the submission. |
Example Usage
const submission = await edlink.submissions.fetch(class_id, assignment_id, submission_id);
console.log(submission.person_id, submission.state, submission.grade);
Update Submission Metadata
submissions.update(class_id, assignment_id, submission_id, patch);
Update metadata for a specific Submission. This includes submitting grades, comments, returning the submission back to the student.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
submission_id | string | The UUID of the submission. |
patch | Submission | A partial submission object to patch the submission with. |
Example Usage
const updated_submission = await edlink.submissions.update(class_id, assignment_id, submission_id, {
grade_points: 85,
grade: 'B',
grade_comment: 'Great work! Consider expanding your analysis in the conclusion.',
state: 'returned'
});
console.log(updated_submission.grade_points); // 85
console.log(updated_submission.state); // 'returned'
Submit Submission
submissions.submit(class_id, assignment_id, attempt);
As a student, submit an attempt for your Submission. This will add it to the attempts
array seen when retrieving a submission. It will also update the state
of the submission to submitted
.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
attempt | Attempt | The attempt to submit. |
Example Usage
const submitted_submission = await edlink.submissions.submit(class_id, assignment_id, {
attachments: [
{
type: 'link',
title: 'My Research Paper',
description: 'Final draft of my research paper on climate change.',
url: 'https://example.com/my-research-paper',
thumbnail_url: 'https://example.com/thumbnail.jpg'
}
]
});
console.log(submitted_submission.state); // 'submitted'
Reclaim Submission
submissions.reclaim(class_id, assignment_id);
As a student, reclaim your Submission.
This will update the state
of the submission to reclaimed
. In order to reclaim the submission, it must be in the submitted
state.
Not all providers support reclaiming submissions. Calling this endpoint on unsupported providers can be treated as a no-op.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
Example Usage
const reclaimed_submission = await edlink.submissions.reclaim(class_id, assignment_id);
console.log(reclaimed_submission.state); // 'reclaimed'
Return Submission
submissions.return(class_id, assignment_id, submission_id);
As a teacher, finalize the grade for a Submission and send it back to the assignee.
The user must be enrolled as a teacher
, ta
, designer
, administrator
, or district-administrator
in the class to use this endpoint.
Not all providers support returning submissions. It's best practice to always call this endpoint after grading a submission to ensure consistency across providers.
You can treat calling this endpoint on unsupported providers as a no-op and just silence the 504
/NOT_IMPLEMENTED
error returned.
Arguments
Parameter | Type | Description |
---|---|---|
class_id | string | The UUID of the class. |
assignment_id | string | The UUID of the assignment. |
submission_id | string | The UUID of the submission. |
Example Usage
const returned_submission = await edlink.submissions.return(class_id, assignment_id, submission_id);
console.log(returned_submission.state); // 'returned'