|
|
|
@ -1,4 +1,10 @@
|
|
|
|
|
import {Account, Course, Exercise, ExerciseQuestion, Ui} from "./eduapi"
|
|
|
|
|
/**
|
|
|
|
|
* https://github.com/jinke18/educoder_weapp
|
|
|
|
|
* @licence GPL-3.0
|
|
|
|
|
* @author jinke18
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import {Account, Course, Exercise, ExerciseQuestion, School, Ui} from "./eduapi"
|
|
|
|
|
import {Session} from "./requests";
|
|
|
|
|
import {Cookie} from "./cookie";
|
|
|
|
|
|
|
|
|
@ -507,7 +513,25 @@ export class Client{
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
search_schools({search = "", success, fail, complete} = {}){
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
School.search({
|
|
|
|
|
session: this.session, search: search, complete: complete,
|
|
|
|
|
success: res => {
|
|
|
|
|
if (typeof success == "function") {
|
|
|
|
|
success(res);
|
|
|
|
|
}
|
|
|
|
|
resolve(res);
|
|
|
|
|
},
|
|
|
|
|
fail: error => {
|
|
|
|
|
if (typeof fail == "function") {
|
|
|
|
|
fail(error);
|
|
|
|
|
}
|
|
|
|
|
reject(error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
get_home_page({success, fail, complete}={}){
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
Ui.get_home_page({
|
|
|
|
|