Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as QuizService from "./quizservice.js";
|
||||
export {
|
||||
QuizService
|
||||
};
|
||||
|
||||
export {
|
||||
CategoryInfo,
|
||||
DescriptiveGradingRecord,
|
||||
Question,
|
||||
TargetInfo
|
||||
} from "./models.js";
|
||||
@@ -0,0 +1,202 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
export class CategoryInfo {
|
||||
"name": string;
|
||||
"count": number;
|
||||
|
||||
/** Creates a new CategoryInfo instance. */
|
||||
constructor($$source: Partial<CategoryInfo> = {}) {
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("count" in $$source)) {
|
||||
this["count"] = 0;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new CategoryInfo instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): CategoryInfo {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new CategoryInfo($$parsedSource as Partial<CategoryInfo>);
|
||||
}
|
||||
}
|
||||
|
||||
export class DescriptiveGradingRecord {
|
||||
"id": number;
|
||||
"questionId": number;
|
||||
"source": string;
|
||||
"userAnswer": string;
|
||||
"score": number;
|
||||
"evaluation": string;
|
||||
"username": string;
|
||||
"createdAt": string;
|
||||
|
||||
/** Creates a new DescriptiveGradingRecord instance. */
|
||||
constructor($$source: Partial<DescriptiveGradingRecord> = {}) {
|
||||
if (!("id" in $$source)) {
|
||||
this["id"] = 0;
|
||||
}
|
||||
if (!("questionId" in $$source)) {
|
||||
this["questionId"] = 0;
|
||||
}
|
||||
if (!("source" in $$source)) {
|
||||
this["source"] = "";
|
||||
}
|
||||
if (!("userAnswer" in $$source)) {
|
||||
this["userAnswer"] = "";
|
||||
}
|
||||
if (!("score" in $$source)) {
|
||||
this["score"] = 0;
|
||||
}
|
||||
if (!("evaluation" in $$source)) {
|
||||
this["evaluation"] = "";
|
||||
}
|
||||
if (!("username" in $$source)) {
|
||||
this["username"] = "";
|
||||
}
|
||||
if (!("createdAt" in $$source)) {
|
||||
this["createdAt"] = "";
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DescriptiveGradingRecord instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): DescriptiveGradingRecord {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new DescriptiveGradingRecord($$parsedSource as Partial<DescriptiveGradingRecord>);
|
||||
}
|
||||
}
|
||||
|
||||
export class Question {
|
||||
"id": number;
|
||||
"source": string;
|
||||
"category": string;
|
||||
"questionText": string;
|
||||
"choice1": string;
|
||||
"choice2": string;
|
||||
"choice3": string;
|
||||
"choice4": string;
|
||||
"choice5": string;
|
||||
"correctAnswer": number;
|
||||
"correctAnswerStr": string;
|
||||
"explanation": string;
|
||||
"difficulty": string;
|
||||
"passage": string;
|
||||
"imageUrl": string;
|
||||
"geminiExplanation": string;
|
||||
"isBookmarked": boolean;
|
||||
"subject": string;
|
||||
"correctAnswers": string;
|
||||
"oid": number;
|
||||
|
||||
/** Creates a new Question instance. */
|
||||
constructor($$source: Partial<Question> = {}) {
|
||||
if (!("id" in $$source)) {
|
||||
this["id"] = 0;
|
||||
}
|
||||
if (!("source" in $$source)) {
|
||||
this["source"] = "";
|
||||
}
|
||||
if (!("category" in $$source)) {
|
||||
this["category"] = "";
|
||||
}
|
||||
if (!("questionText" in $$source)) {
|
||||
this["questionText"] = "";
|
||||
}
|
||||
if (!("choice1" in $$source)) {
|
||||
this["choice1"] = "";
|
||||
}
|
||||
if (!("choice2" in $$source)) {
|
||||
this["choice2"] = "";
|
||||
}
|
||||
if (!("choice3" in $$source)) {
|
||||
this["choice3"] = "";
|
||||
}
|
||||
if (!("choice4" in $$source)) {
|
||||
this["choice4"] = "";
|
||||
}
|
||||
if (!("choice5" in $$source)) {
|
||||
this["choice5"] = "";
|
||||
}
|
||||
if (!("correctAnswer" in $$source)) {
|
||||
this["correctAnswer"] = 0;
|
||||
}
|
||||
if (!("correctAnswerStr" in $$source)) {
|
||||
this["correctAnswerStr"] = "";
|
||||
}
|
||||
if (!("explanation" in $$source)) {
|
||||
this["explanation"] = "";
|
||||
}
|
||||
if (!("difficulty" in $$source)) {
|
||||
this["difficulty"] = "";
|
||||
}
|
||||
if (!("passage" in $$source)) {
|
||||
this["passage"] = "";
|
||||
}
|
||||
if (!("imageUrl" in $$source)) {
|
||||
this["imageUrl"] = "";
|
||||
}
|
||||
if (!("geminiExplanation" in $$source)) {
|
||||
this["geminiExplanation"] = "";
|
||||
}
|
||||
if (!("isBookmarked" in $$source)) {
|
||||
this["isBookmarked"] = false;
|
||||
}
|
||||
if (!("subject" in $$source)) {
|
||||
this["subject"] = "";
|
||||
}
|
||||
if (!("correctAnswers" in $$source)) {
|
||||
this["correctAnswers"] = "";
|
||||
}
|
||||
if (!("oid" in $$source)) {
|
||||
this["oid"] = 0;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Question instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): Question {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new Question($$parsedSource as Partial<Question>);
|
||||
}
|
||||
}
|
||||
|
||||
export class TargetInfo {
|
||||
"name": string;
|
||||
"count": number;
|
||||
|
||||
/** Creates a new TargetInfo instance. */
|
||||
constructor($$source: Partial<TargetInfo> = {}) {
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("count" in $$source)) {
|
||||
this["count"] = 0;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TargetInfo instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): TargetInfo {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new TargetInfo($$parsedSource as Partial<TargetInfo>);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
/**
|
||||
* AddBookmark adds a source and question ID to the Bookmark table
|
||||
*/
|
||||
export function AddBookmark(source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(2172709195, source, questionID);
|
||||
}
|
||||
|
||||
export function AskGemini(source: string, id: number, prompt: string, base64Image: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(248984702, source, id, prompt, base64Image);
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedCategories retrieves categories that have bookmarked questions
|
||||
*/
|
||||
export function GetBookmarkedCategories(): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
return $Call.ByID(2614333737).then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedQuestions retrieves all bookmarked questions for a given category and difficulty
|
||||
*/
|
||||
export function GetBookmarkedQuestions(category: string, difficulty: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(1774610406, category, difficulty).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* GetBookmarkedTargets retrieves difficulties (targets) that have bookmarked questions within a category
|
||||
*/
|
||||
export function GetBookmarkedTargets(category: string): $CancellablePromise<$models.TargetInfo[]> {
|
||||
return $Call.ByID(859878861, category).then(($result: any) => {
|
||||
return $$createType5($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetCategories(): $CancellablePromise<$models.CategoryInfo[]> {
|
||||
return $Call.ByID(4276529076).then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetDescriptiveGradingHistory(source: string, questionID: number): $CancellablePromise<$models.DescriptiveGradingRecord[]> {
|
||||
return $Call.ByID(1670245718, source, questionID).then(($result: any) => {
|
||||
return $$createType7($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetQuestions(category: string, difficulty: string, subject: string): $CancellablePromise<$models.Question[]> {
|
||||
return $Call.ByID(2580577541, category, difficulty, subject).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetSubjects(category: string, difficulty: string): $CancellablePromise<string[]> {
|
||||
return $Call.ByID(1060436249, category, difficulty).then(($result: any) => {
|
||||
return $$createType8($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GetTargets(category: string): $CancellablePromise<$models.TargetInfo[]> {
|
||||
return $Call.ByID(371042150, category).then(($result: any) => {
|
||||
return $$createType5($result);
|
||||
});
|
||||
}
|
||||
|
||||
export function GradeDescriptiveAnswer(source: string, questionID: number, userAnswer: string): $CancellablePromise<$models.DescriptiveGradingRecord | null> {
|
||||
return $Call.ByID(642001377, source, questionID, userAnswer).then(($result: any) => {
|
||||
return $$createType9($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* RemoveBookmark removes a source and question ID from the Bookmark table
|
||||
*/
|
||||
export function RemoveBookmark(source: string, questionID: number): $CancellablePromise<void> {
|
||||
return $Call.ByID(189585076, source, questionID);
|
||||
}
|
||||
|
||||
export function SaveAiExplanation(source: string, id: number, explanation: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(71515486, source, id, explanation);
|
||||
}
|
||||
|
||||
/**
|
||||
* SetGeminiKey sets the API key for Gemini calls
|
||||
*/
|
||||
export function SetGeminiKey(key: string): $CancellablePromise<void> {
|
||||
return $Call.ByID(2865570266, key);
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = $models.CategoryInfo.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
const $$createType2 = $models.Question.createFrom;
|
||||
const $$createType3 = $Create.Array($$createType2);
|
||||
const $$createType4 = $models.TargetInfo.createFrom;
|
||||
const $$createType5 = $Create.Array($$createType4);
|
||||
const $$createType6 = $models.DescriptiveGradingRecord.createFrom;
|
||||
const $$createType7 = $Create.Array($$createType6);
|
||||
const $$createType8 = $Create.Array($Create.Any);
|
||||
const $$createType9 = $Create.Nullable($$createType6);
|
||||
@@ -0,0 +1,14 @@
|
||||
//@ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
function configure() {
|
||||
Object.freeze(Object.assign($Create.Events, {
|
||||
}));
|
||||
}
|
||||
|
||||
configure();
|
||||
@@ -0,0 +1,14 @@
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import type { Events } from "@wailsio/runtime";
|
||||
|
||||
declare module "@wailsio/runtime" {
|
||||
namespace Events {
|
||||
interface CustomEvents {
|
||||
"time": string;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user