Files
encoach_ui_odoo19/src/interfaces/exam.ts
2023-04-06 12:02:07 +01:00

95 lines
2.7 KiB
TypeScript

export type Exam = ReadingExam | ListeningExam | WritingExam;
export interface ReadingExam {
text: {
title: string;
content: string;
};
exercises: Exercise[];
module: "reading";
}
export interface ListeningExam {
audio: {
title: string;
source: string;
transcript: string;
repeatableTimes: number; // *The amount of times the user is allowed to repeat the audio, 0 for unlimited
};
exercises: Exercise[];
module: "listening";
}
export interface WritingExam {
module: "writing";
text: {
info: string; //* The information about the task, like the amount of time they should spend on it
prompt: string; //* The context given to the user containing what they should write about
wordCounter: WordCounter; //* The minimum or maximum amount of words that should be written
};
}
interface WordCounter {
type: "min" | "max";
limit: number;
}
export type Exercise = FillBlanksExercise | MatchSentencesExercise | MultipleChoiceExercise | WriteBlanksExercise;
export interface FillBlanksExercise {
prompt: string; // *EXAMPLE: "Complete the summary below. Click a blank to select the corresponding word for it."
type: "fillBlanks";
words: string[]; // *EXAMPLE: ["preserve", "unaware"]
text: string; // *EXAMPLE: "They tried to {{1}} burning"
allowRepetition: boolean;
solutions: {
id: string; // *EXAMPLE: "1"
solution: string; // *EXAMPLE: "preserve"
}[];
}
export interface WriteBlanksExercise {
prompt: string; // *EXAMPLE: "Complete the notes below by writing NO MORE THAN THREE WORDS in the spaces provided."
maxWords: number; // *EXAMPLE: 3 - The maximum amount of words allowed per blank, 0 for unlimited
type: "writeBlanks";
text: string; // *EXAMPLE: "The Government plans to give ${{14}}"
solutions: {
id: string; // *EXAMPLE: "14"
solution: string[]; // *EXAMPLE: ["Prescott"] - All possible solutions (case sensitive)
}[];
}
export interface MatchSentencesExercise {
type: "matchSentences";
prompt: string;
sentences: {
id: string;
sentence: string;
solution: string;
color: string;
}[];
allowRepetition: boolean;
options: {
id: string;
sentence: string;
}[];
}
export interface MultipleChoiceExercise {
type: "multipleChoice";
prompt: string; // *EXAMPLE: "Select the appropriate option."
questions: MultipleChoiceQuestion[];
}
export interface MultipleChoiceQuestion {
variant: "image" | "text";
id: string; // *EXAMPLE: "1"
prompt: string; // *EXAMPLE: "What does her briefcase look like?"
solution: string; // *EXAMPLE: "A"
options: {
id: string; // *EXAMPLE: "A"
src?: string; // *EXAMPLE: "https://i.imgur.com/rEbrSqA.png" (only used if the variant is "image")
text?: string; // *EXAMPLE: "wallet, pens and novel" (only used if the variant is "text")
}[];
}