aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2026-09-28 16:00:50 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2026-09-28 16:01:22 +0200
commit03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926 (patch)
tree2d84e61716d049278b918ce78d87a25290ef6eb1
parent482c006782c8270801d82e82e113fa5fba6b774d (diff)
downloadbycs-sol-03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926.tar.gz
bycs-sol-03ba4caf8f59c90bc637f8ab0fc7ce232c6f4926.zip
add moodle mock code
-rw-r--r--src/moodle-mock.ts39
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 [];
+}