Finished implementing a Solutions version for each exercise

This commit is contained in:
Tiago Ribeiro
2023-04-11 21:35:44 +01:00
parent 45a5cb0f5c
commit 49c515b02a
20 changed files with 610 additions and 333 deletions

View File

@@ -1,3 +1,5 @@
import {Module} from ".";
export type Exam = ReadingExam | ListeningExam | WritingExam;
export interface ReadingExam {
@@ -5,6 +7,7 @@ export interface ReadingExam {
title: string;
content: string;
};
id: string;
exercises: Exercise[];
module: "reading";
minTimer: number;
@@ -12,24 +15,35 @@ export interface ReadingExam {
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
};
id: string;
exercises: Exercise[];
module: "listening";
minTimer: number;
}
export interface UserSolution {
solutions: any[];
module?: Module;
score: {
correct: number;
total: number;
};
id: string;
}
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[];
}
interface WordCounter {
@@ -42,6 +56,7 @@ export type Exercise = FillBlanksExercise | MatchSentencesExercise | MultipleCho
export interface FillBlanksExercise {
prompt: string; // *EXAMPLE: "Complete the summary below. Click a blank to select the corresponding word for it."
type: "fillBlanks";
id: string;
words: string[]; // *EXAMPLE: ["preserve", "unaware"]
text: string; // *EXAMPLE: "They tried to {{1}} burning"
allowRepetition: boolean;
@@ -49,12 +64,17 @@ export interface FillBlanksExercise {
id: string; // *EXAMPLE: "1"
solution: string; // *EXAMPLE: "preserve"
}[];
userSolutions: {
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";
id: string;
text: string; // *EXAMPLE: "The Government plans to give ${{14}}"
solutions: {
id: string; // *EXAMPLE: "14"
@@ -68,6 +88,7 @@ export interface WriteBlanksExercise {
export interface MatchSentencesExercise {
type: "matchSentences";
id: string;
prompt: string;
userSolutions: {question: string; option: string}[];
sentences: {
@@ -85,6 +106,7 @@ export interface MatchSentencesExercise {
export interface MultipleChoiceExercise {
type: "multipleChoice";
id: string;
prompt: string; // *EXAMPLE: "Select the appropriate option."
questions: MultipleChoiceQuestion[];
userSolutions: {question: string; option: string}[];