init commit,
This commit is contained in:
5
002_source/ionic_mobile/src/public_data/Helloworld.ts
Normal file
5
002_source/ionic_mobile/src/public_data/Helloworld.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { listLessonContent } from './listLessonContent';
|
||||
|
||||
function Helloworld(): Promise<any[]> {
|
||||
return listLessonContent();
|
||||
}
|
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@@ -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 };
|
||||
});
|
||||
});
|
||||
}
|
18
002_source/ionic_mobile/src/public_data/listLessonContent.ts
Normal file
18
002_source/ionic_mobile/src/public_data/listLessonContent.ts
Normal 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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user