analize
This commit is contained in:
@@ -10,6 +10,7 @@ export {
|
||||
CategoryInfo,
|
||||
DescriptiveGradingRecord,
|
||||
Question,
|
||||
StudyElementDB,
|
||||
TargetInfo,
|
||||
User
|
||||
} from "./models.js";
|
||||
|
||||
@@ -180,6 +180,43 @@ export class Question {
|
||||
}
|
||||
}
|
||||
|
||||
export class StudyElementDB {
|
||||
"questionId": number;
|
||||
"source": string;
|
||||
"questionText": string;
|
||||
"content": string;
|
||||
"category": string;
|
||||
|
||||
/** Creates a new StudyElementDB instance. */
|
||||
constructor($$source: Partial<StudyElementDB> = {}) {
|
||||
if (!("questionId" in $$source)) {
|
||||
this["questionId"] = 0;
|
||||
}
|
||||
if (!("source" in $$source)) {
|
||||
this["source"] = "";
|
||||
}
|
||||
if (!("questionText" in $$source)) {
|
||||
this["questionText"] = "";
|
||||
}
|
||||
if (!("content" in $$source)) {
|
||||
this["content"] = "";
|
||||
}
|
||||
if (!("category" in $$source)) {
|
||||
this["category"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new StudyElementDB instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): StudyElementDB {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new StudyElementDB($$parsedSource as Partial<StudyElementDB>);
|
||||
}
|
||||
}
|
||||
|
||||
export class TargetInfo {
|
||||
"name": string;
|
||||
"count": number;
|
||||
|
||||
@@ -59,6 +59,21 @@ export function DeleteUser(username: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(4061081732, username);
|
||||
}
|
||||
|
||||
/**
|
||||
* ExtractStudyElementsForCategory extracts study elements for all questions in the category.
|
||||
* It skips questions that already have an extracted study element.
|
||||
*/
|
||||
export function ExtractStudyElementsForCategory(category: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(3340623770, category);
|
||||
}
|
||||
|
||||
/**
|
||||
* GenerateGoPracticalExams creates new exam questions based on existing ones.
|
||||
*/
|
||||
export function GenerateGoPracticalExams(count: number): $CancellablePromise<string> {
|
||||
return $Call.ByID(4059537052, count);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedCategories retrieves categories that have bookmarked questions for a user
|
||||
*/
|
||||
@@ -138,6 +153,15 @@ export function GetQuestions(username: string, category: string, difficulty: str
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetStudyElements retrieves all extracted study elements for a category.
|
||||
*/
|
||||
export function GetStudyElements(category: string): $CancellablePromise<$models.StudyElementDB[]> {
|
||||
return $Call.ByID(1892893004, category).then(($result: any) => {
|
||||
return $$createType12($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetSubjects(category: string, difficulty: string): $CancellablePromise<string[]> {
|
||||
return $Call.ByID(1060436249, category, difficulty).then(($result: any) => {
|
||||
return $$createType8($result);
|
||||
@@ -170,7 +194,7 @@ export function GetUsers(): $CancellablePromise<$models.User[]> {
|
||||
|
||||
export function GradeDescriptiveAnswer(username: string, source: string, questionID: number, userAnswer: string, ocrImageBase64: string): $CancellablePromise<$models.DescriptiveGradingRecord | null> {
|
||||
return $Call.ByID(642001377, username, source, questionID, userAnswer, ocrImageBase64).then(($result: any) => {
|
||||
return $$createType11($result);
|
||||
return $$createType13($result);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -179,7 +203,7 @@ export function GradeDescriptiveAnswer(username: string, source: string, questio
|
||||
*/
|
||||
export function Login(username: string, password: string): $CancellablePromise<$models.User | null> {
|
||||
return $Call.ByID(3841810241, username, password).then(($result: any) => {
|
||||
return $$createType12($result);
|
||||
return $$createType14($result);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -263,5 +287,7 @@ const $$createType7 = $Create.Array($$createType6);
|
||||
const $$createType8 = $Create.Array($Create.Any);
|
||||
const $$createType9 = $models.User.createFrom;
|
||||
const $$createType10 = $Create.Array($$createType9);
|
||||
const $$createType11 = $Create.Nullable($$createType6);
|
||||
const $$createType12 = $Create.Nullable($$createType9);
|
||||
const $$createType11 = $models.StudyElementDB.createFrom;
|
||||
const $$createType12 = $Create.Array($$createType11);
|
||||
const $$createType13 = $Create.Nullable($$createType6);
|
||||
const $$createType14 = $Create.Nullable($$createType9);
|
||||
|
||||
Reference in New Issue
Block a user