aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 [];
+}