diff --git a/src/components/Exercises/FillBlanks/index.tsx b/src/components/Exercises/FillBlanks/index.tsx index d138f66e..906d3634 100644 --- a/src/components/Exercises/FillBlanks/index.tsx +++ b/src/components/Exercises/FillBlanks/index.tsx @@ -7,6 +7,7 @@ import { CommonProps } from ".."; import Button from "../../Low/Button"; import { v4 } from "uuid"; import MCDropdown from "./MCDropdown"; +import PracticeBadge from "@/components/Low/PracticeBadge"; const FillBlanks: React.FC = ({ id, @@ -196,7 +197,7 @@ const FillBlanks: React.FC = ({
{!disableProgressButtons && progressButtons()} -
+
{variant !== "mc" && ( {prompt.split("\\n").map((line, index) => ( @@ -207,6 +208,7 @@ const FillBlanks: React.FC = ({ ))} )} + {isPractice && } {memoizedLines} {variant !== "mc" && (
@@ -234,6 +236,7 @@ const FillBlanks: React.FC = ({
)} +
{!disableProgressButtons && progressButtons()} diff --git a/src/components/Exercises/MatchSentences.tsx b/src/components/Exercises/MatchSentences.tsx index 0e00a90c..3709ef82 100644 --- a/src/components/Exercises/MatchSentences.tsx +++ b/src/components/Exercises/MatchSentences.tsx @@ -10,6 +10,7 @@ import Button from "../Low/Button"; import Xarrow from "react-xarrows"; import useExamStore from "@/stores/examStore"; import { DndContext, DragEndEvent, useDraggable, useDroppable } from "@dnd-kit/core"; +import PracticeBadge from "../Low/PracticeBadge"; function DroppableQuestionArea({ question, answer }: { question: MatchSentenceExerciseSentence; answer?: string }) { const { isOver, setNodeRef } = useDroppable({ id: `droppable_sentence_${question.id}` }); @@ -148,6 +149,8 @@ export default function MatchSentences({ ))} + {isPractice && } +
diff --git a/src/components/Exercises/MultipleChoice.tsx b/src/components/Exercises/MultipleChoice.tsx index bed48996..e4a5048c 100644 --- a/src/components/Exercises/MultipleChoice.tsx +++ b/src/components/Exercises/MultipleChoice.tsx @@ -7,6 +7,7 @@ import reactStringReplace from "react-string-replace"; import { CommonProps } from "."; import Button from "../Low/Button"; import { v4 } from "uuid"; +import PracticeBadge from "../Low/PracticeBadge"; function Question({ id, @@ -15,10 +16,12 @@ function Question({ options, userSolution, onSelectOption, + isPractice = false }: MultipleChoiceQuestion & { userSolution: string | undefined; onSelectOption?: (option: string) => void; showSolution?: boolean; + isPractice?: boolean }) { const renderPrompt = (prompt: string) => { return reactStringReplace(prompt, /(.*?<\/u>)/g, (match) => { @@ -28,7 +31,8 @@ function Question({ }; return ( -
+
+ {isPractice && } {isNaN(Number(id)) ? ( {renderPrompt(prompt).filter((x) => x?.toString() !== "")} ) : ( @@ -194,6 +198,7 @@ export default function MultipleChoice({ key={question.id} className="flex flex-col gap-8 h-fit w-full bg-mti-gray-smoke rounded-xl px-16 py-8"> question.id === x.question)?.option} onSelectOption={(option) => onSelectOption(option, question)} /> @@ -206,6 +211,7 @@ export default function MultipleChoice({ {questionIndex < questions.length && ( questions[questionIndex].id === x.question)?.option} onSelectOption={(option) => onSelectOption(option, questions[questionIndex])} /> @@ -216,6 +222,7 @@ export default function MultipleChoice({
questions[questionIndex + 1].id === x.question)?.option} onSelectOption={(option) => onSelectOption(option, questions[questionIndex + 1])} /> diff --git a/src/components/Exercises/Speaking.tsx b/src/components/Exercises/Speaking.tsx index 2614aca6..e6a4472b 100644 --- a/src/components/Exercises/Speaking.tsx +++ b/src/components/Exercises/Speaking.tsx @@ -8,6 +8,7 @@ import useExamStore from "@/stores/examStore"; import { downloadBlob } from "@/utils/evaluation"; import axios from "axios"; import Modal from "../Modal"; +import PracticeBadge from "../Low/PracticeBadge"; const Waveform = dynamic(() => import("../Waveform"), { ssr: false }); const ReactMediaRecorder = dynamic(() => import("react-media-recorder").then((mod) => mod.ReactMediaRecorder), { @@ -172,6 +173,8 @@ export default function Speaking({ id, title, text, video_url, type, prompts, su
+ {isPractice && } + {prompts && prompts.length > 0 && (