For Developers

Assignments

List Assignments

assignments.list(class_id, options);

Retrieves a list of Assignments in a Class.

Function Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
optionsobjectThis function supports standard paging options.

Example Usage

for await (const assignment of edlink.assignments.list(class_id)) {
    console.log(assignment.title);
}

Create Assignment

assignments.create(class_id, assignment);

Create an Assignment in a Class.

Function Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
assignmentAssignmentThe assignment to create.

Example Usage

const due_date = new Date();
due_date.setDate(due_date.getDate() + 7); // Due in one week

const new_assignment = await edlink.assignments.create(class_id, {
    title: 'New Assignment',
    description: 'This is a new assignment.',
    due_date,
    grading_type: 'points',
    points_possible: 100
});

console.log(new_assignment.id);

Fetch Assignment

assignments.fetch(class_id, assignment_id);

Retrieve an Assignment in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
assignment_idstringThe UUID of the assignment.

Example Usage

const assignment = await edlink.assignments.fetch(class_id, assignment_id);
console.log(assignment.title);

Update Assignment

assignments.update(class_id, assignment_id, patch);

Update an Assignment in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
assignment_idstringThe UUID of the assignment.
patchAssignmentA partial assignment object to patch the assignment with.

Example Usage

const updated_assignment = await edlink.assignments.update(class_id, assignment_id, {
    title: 'Updated Assignment Title',
    points_possible: 150
});
console.log(updated_assignment.title);

Delete Assignment

assignments.delete(class_id, assignment_id);

Delete an Assignment in a Class.

Arguments

ParameterTypeDescription
class_idstringThe UUID of the class.
assignment_idstringThe UUID of the assignment.

Example Usage

await edlink.assignments.delete(class_id, assignment_id);
console.log('Assignment deleted');