init commit,

This commit is contained in:
louiscklaw
2025-04-26 10:08:01 +08:00
parent 7d70b5826b
commit d0ea7e5452
473 changed files with 29989 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
import { listLessonContent } from './listLessonContent';
function Helloworld(): Promise<any[]> {
return listLessonContent();
}

View File

@@ -0,0 +1,15 @@
import { retry } from '@lifeomic/attempt';
import axios from 'axios';
export async function listConectivesRevisionContent(): Promise<any[]> {
return new Promise((res, rej) => {
retry(async (context) => {
try {
const response = await axios.get('/data/Quiz/ConnectivesRevision/content.json');
res(response.data);
} catch (error) {
rej(error);
}
});
});
}

View File

@@ -0,0 +1,9 @@
import { listLessonContent } from './listLessonContent';
export function listLessonCategories(): Promise<any[]> {
return listLessonContent().then((res_json: any) => {
return res_json.map((lesson: any) => {
return { name: lesson.name, path: lesson.path, content: lesson.content };
});
});
}

View File

@@ -0,0 +1,18 @@
// http://localhost:8080/data/Lesson/getLessonContent
import { retry } from '@lifeomic/attempt';
import axios from 'axios';
import { API_URL } from '../constants';
export async function listLessonContent(): Promise<any[]> {
return new Promise((res, rej) => {
retry(async (context) => {
try {
const temp = await axios.get(API_URL + '/data/Lesson/getLessonContent');
res(temp.data);
} catch (error) {
rej(error);
}
});
});
}

View File

@@ -0,0 +1,21 @@
// export async function listMatchingFrenzyContent(): Promise<any[]> {
// return fetch('/data/Quiz/MatchingFrenzy/content.json').then((res) => {
// return res.json();
// });
// }
import { retry } from '@lifeomic/attempt';
import axios from 'axios';
import { API_URL } from '../constants';
export async function listMatchingFrenzyContent(): Promise<any[]> {
return new Promise((res, rej) => {
retry(async (context) => {
try {
const temp = await axios.get(API_URL + '/data/Quiz/MatchingFrenzy/getContent');
res(temp.data);
} catch (error) {
rej(error);
}
});
});
}

View File

@@ -0,0 +1,20 @@
// http://localhost:8080/data/Quiz/ListeningPractice/getContent
import { retry } from '@lifeomic/attempt';
import axios from 'axios';
import { API_URL } from '../constants';
export async function listQuizListeningPracticeContent(): Promise<any[]> {
return new Promise((res, rej) => {
retry(async (context) => {
try {
// const temp = await axios.get('/data/Quiz/ListeningPractice/content.json');
const temp = await axios.get(API_URL + '/data/Quiz/ListeningPractice/getContent');
res(temp.data);
} catch (error) {
rej(error);
}
});
});
}