-
Notifications
You must be signed in to change notification settings - Fork 0
Homework
github-actions[bot] edited this page Jul 25, 2026
·
1 revision
The Homework module gives you access to the student's textbook. It allows you to fetch homework, session content, and mark tasks as done (even when offline!).
Let's read all assignments scheduled for the coming days:
import { getHomework } from "linkdirecte";
// Retrieve homework. Use withContent: true to automatically load the details for each task
const calendar = await getHomework({ withContent: true });
for (const [date, assignments] of Object.entries(calendar)) {
console.log(`\n📅 Assignments for ${date}:`);
assignments.forEach(task => {
const status = task.effectue ? "✅ DONE" : "❌ TO DO";
console.log(`- [${status}] [${task.matiere}] ${task.aFaire?.contenu}`);
});
}Fetches a calendar index of homework due over the next few weeks.
function getHomework(options?: {
withContent?: boolean;
}): Promise<HomeworkResult>-
options(optional):-
withContent(boolean): If set totrue, the SDK will make background queries to resolve detailed HTML descriptions and attachments for each date. Defaults tofalse.
-
A promise resolving to a HomeworkResult map where keys are date strings ("YYYY-MM-DD") and values are arrays of HomeworkEntry.
Loads detailed descriptions and resources for a specific day.
function getHomeworkForDate(
date: string | Date,
): Promise<HomeworkEntry[]>import { getHomeworkForDate } from "linkdirecte";
const assignments = await getHomeworkForDate("2025-09-15");
assignments.forEach(task => {
console.log(`Teacher: ${task.nomProf ?? "Unknown"}`);
console.log(`Content (HTML): ${task.aFaire?.contenu}`);
});Updates the state of one or more homework assignments to completed.
function markAsDone(
homeworkIds: number[],
): Promise<MarkAsDoneResult>Post a comment under a homework assignment or a session content.
function sendHomeworkComment(
idContenu: number,
message: string,
): Promise<{ id: number }>import { sendHomeworkComment } from "linkdirecte";
const result = await sendHomeworkComment(55442, "Here is my comment on the homework");
console.log(`Comment posted successfully with ID: ${result.id}`);interface HomeworkResult {
[dateString: string]: HomeworkEntry[]; // Date keys are formatted as YYYY-MM-DD
}| Property | Type | Description |
|---|---|---|
idDevoir |
number |
Unique identifier for the assignment. |
codeMatiere |
string |
Code identifier of the subject. |
matiere |
string |
Readable subject name. |
nomProf |
string (optional)
|
Name of the teacher who assigned the work. |
donneLe |
Date |
The date the homework was originally assigned. |
forDate |
Date |
The date when the homework is due. |
effectue |
boolean |
Indicates if marked by the student as complete. |
rendreEnLigne |
boolean (optional)
|
Indicates if the assignment must be submitted digitally. |
interface MarkAsDoneResult {
success: boolean;
}© 2026 typeof (Scolup) | Licensed under AGPL 3.0