Updated the writing exam to work based on exercises instead of just a single one

This commit is contained in:
Tiago Ribeiro
2023-04-17 13:03:48 +01:00
parent 5df816c73c
commit 207328dade
9 changed files with 359 additions and 74 deletions

View File

@@ -27,6 +27,7 @@ export interface ListeningExam {
export interface UserSolution {
solutions: any[];
module?: Module;
exam?: string;
score: {
correct: number;
total: number;
@@ -37,13 +38,8 @@ export interface UserSolution {
export interface WritingExam {
module: "writing";
id: string;
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
};
minTimer: number;
exercises: Exercise[];
minTimer: number;
}
interface WordCounter {
@@ -51,7 +47,15 @@ interface WordCounter {
limit: number;
}
export type Exercise = FillBlanksExercise | MatchSentencesExercise | MultipleChoiceExercise | WriteBlanksExercise;
export type Exercise = FillBlanksExercise | MatchSentencesExercise | MultipleChoiceExercise | WriteBlanksExercise | WritingExercise;
export interface WritingExercise {
id: string;
type: "writing";
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
}
export interface FillBlanksExercise {
prompt: string; // *EXAMPLE: "Complete the summary below. Click a blank to select the corresponding word for it."