diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-09-28 16:00:50 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-09-28 16:01:22 +0200 |
| commit | 03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926 (patch) | |
| tree | 2d84e61716d049278b918ce78d87a25290ef6eb1 /src | |
| parent | 482c006782c8270801d82e82e113fa5fba6b774d (diff) | |
| download | bycs-sol-03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926.tar.gz bycs-sol-03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926.zip | |
add moodle mock code
Diffstat (limited to 'src')
| -rw-r--r-- | src/moodle-mock.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/moodle-mock.ts b/src/moodle-mock.ts new file mode 100644 index 0000000..e1554b4 --- /dev/null +++ b/src/moodle-mock.ts @@ -0,0 +1,39 @@ +import { getCourseId } from "./utils-ENV.js"; + +export class Activity { + id: number; + title: string; + + constructor(id: number, title: string) { + this.id = id; + this.title = title; + } + + async update(_text: string) {} +} + +export class Course { + id: Number; + title: string; + + constructor(id: number, title: string) { + this.id = id; + this.title = title; + } + + async getActivity(_name: string) { + return null; + } +} + +export async function fetchCourse(courseId?: number) { + if (typeof courseId === "undefined") { + courseId = Number(getCourseId()); + } + + return new Course(courseId, "Mock Course"); +} + +export async function fetchCourses(_pattern: string) { + return []; +} |
