+
+ {!isTextMinimized && (
+ <>
+
+
+ Please read the following excerpt attentively, you will then be asked questions about the text you've read.
+
+ You will be allowed to read the text while doing the exercises
+
+
+ >
+ )}
+ {isTextMinimized &&
Reading Passage}
);
@@ -266,7 +302,12 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
disableTimer={showSolutions}
label={exerciseIndex === -1 ? undefined : convertCamelCaseToReadable(exam.parts[partIndex].exercises[exerciseIndex].type)}
/>
-
-1 && "grid grid-cols-2 gap-4")}>
+
-1 && !isTextMinimized && "grid grid-cols-2 gap-4",
+ exerciseIndex > -1 && isTextMinimized && "flex flex-col gap-2",
+ )}>
{partIndex > -1 && renderText()}
{exerciseIndex > -1 &&
diff --git a/src/interfaces/exam.ts b/src/interfaces/exam.ts
index b42675ca..c219ef19 100644
--- a/src/interfaces/exam.ts
+++ b/src/interfaces/exam.ts
@@ -233,17 +233,21 @@ export interface MatchSentencesExercise {
id: string;
prompt: string;
userSolutions: {question: string; option: string}[];
- sentences: {
- id: string;
- sentence: string;
- solution: string;
- color: string;
- }[];
+ sentences: MatchSentenceExerciseSentence[];
allowRepetition: boolean;
- options: {
- id: string;
- sentence: string;
- }[];
+ options: MatchSentenceExerciseOption[];
+}
+
+export interface MatchSentenceExerciseSentence {
+ id: string;
+ sentence: string;
+ solution: string;
+ color: string;
+}
+
+export interface MatchSentenceExerciseOption {
+ id: string;
+ sentence: string;
}
export interface MultipleChoiceExercise {
diff --git a/src/pages/(generation)/ReadingGeneration.tsx b/src/pages/(generation)/ReadingGeneration.tsx
index 84196f6f..a49d9676 100644
--- a/src/pages/(generation)/ReadingGeneration.tsx
+++ b/src/pages/(generation)/ReadingGeneration.tsx
@@ -124,7 +124,6 @@ const ReadingGeneration = () => {
const availableTypes = [
{type: "fillBlanks", label: "Fill the Blanks"},
- {type: "multipleChoice", label: "Multiple Choice"},
{type: "trueFalse", label: "True or False"},
{type: "writeBlanks", label: "Write the Blanks"},
{type: "matchSentences", label: "Match Sentences"},
diff --git a/src/pages/api/exam/[module]/generate/[...endpoint].ts b/src/pages/api/exam/[module]/generate/[...endpoint].ts
index 3cb7c052..f1fa416f 100644
--- a/src/pages/api/exam/[module]/generate/[...endpoint].ts
+++ b/src/pages/api/exam/[module]/generate/[...endpoint].ts
@@ -29,14 +29,14 @@ async function get(req: NextApiRequest, res: NextApiResponse) {
module: Module;
endpoint: string;
topic?: string;
- exercises?: string[];
+ exercises?: string[] | string;
difficulty?: Difficulty;
};
const url = `${process.env.BACKEND_URL}/${endpoint}`;
const params = new URLSearchParams();
if (topic) params.append("topic", topic);
- if (exercises) exercises.forEach((exercise) => params.append("exercises", exercise));
+ if (exercises) (typeof exercises === "string" ? [exercises] : exercises).forEach((exercise) => params.append("exercises", exercise));
if (difficulty) params.append("difficulty", difficulty);
const result = await axios.get(`${url}${params.toString().length > 0 ? `?${params.toString()}` : ""}`, {
diff --git a/src/pages/record.tsx b/src/pages/record.tsx
index d56cc63b..558da5a8 100644
--- a/src/pages/record.tsx
+++ b/src/pages/record.tsx
@@ -74,7 +74,11 @@ export default function History({user}: {user: User}) {
setGroupedStats(
groupByDate(
stats.filter((x) => {
- if ((x.module === "writing" || x.module === "speaking") && !x.isDisabled && !x.solutions.every((y) => "evaluation" in y))
+ if (
+ (x.module === "writing" || x.module === "speaking") &&
+ !x.isDisabled &&
+ !x.solutions.every((y) => Object.keys(y).includes("evaluation"))
+ )
return false;
return true;
}),
diff --git a/yarn.lock b/yarn.lock
index f262d9df..cfab02ba 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -88,6 +88,29 @@
dotenv-expand "^5.1.0"
minimist "^1.2.0"
+"@dnd-kit/accessibility@^3.1.0":
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/@dnd-kit/accessibility/-/accessibility-3.1.0.tgz#1054e19be276b5f1154ced7947fc0cb5d99192e0"
+ integrity sha512-ea7IkhKvlJUv9iSHJOnxinBcoOI3ppGnnL+VDJ75O45Nss6HtZd8IdN8touXPDtASfeI2T2LImb8VOZcL47wjQ==
+ dependencies:
+ tslib "^2.0.0"
+
+"@dnd-kit/core@^6.1.0":
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/@dnd-kit/core/-/core-6.1.0.tgz#e81a3d10d9eca5d3b01cbf054171273a3fe01def"
+ integrity sha512-J3cQBClB4TVxwGo3KEjssGEXNJqGVWx17aRTZ1ob0FliR5IjYgTxl5YJbKTzA6IzrtelotH19v6y7uoIRUZPSg==
+ dependencies:
+ "@dnd-kit/accessibility" "^3.1.0"
+ "@dnd-kit/utilities" "^3.2.2"
+ tslib "^2.0.0"
+
+"@dnd-kit/utilities@^3.2.2":
+ version "3.2.2"
+ resolved "https://registry.yarnpkg.com/@dnd-kit/utilities/-/utilities-3.2.2.tgz#5a32b6af356dc5f74d61b37d6f7129a4040ced7b"
+ integrity sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg==
+ dependencies:
+ tslib "^2.0.0"
+
"@emotion/babel-plugin@^11.11.0":
version "11.11.0"
resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz#c2d872b6a7767a9d176d007f5b31f7d504bb5d6c"