diff --git a/src/components/Exercises/FillBlanks/index.tsx b/src/components/Exercises/FillBlanks/index.tsx index 9bca1c9d..aed260b0 100644 --- a/src/components/Exercises/FillBlanks/index.tsx +++ b/src/components/Exercises/FillBlanks/index.tsx @@ -173,23 +173,11 @@ const FillBlanks: React.FC = ({ className={clsx( "flex border p-4 rounded-xl gap-2 cursor-pointer bg-white text-base", !!answers.find((x) => x.solution.toLocaleLowerCase() === value.toLocaleLowerCase() && x.id === currentMCSelection.id) && - "border-mti-purple-light", + "!bg-mti-purple-light !text-white", )}> {key}. {value} - - /*;*/ })} diff --git a/src/components/Exercises/MultipleChoice.tsx b/src/components/Exercises/MultipleChoice.tsx index 55816e07..0de7dd17 100644 --- a/src/components/Exercises/MultipleChoice.tsx +++ b/src/components/Exercises/MultipleChoice.tsx @@ -60,7 +60,7 @@ function Question({ onClick={() => (onSelectOption ? onSelectOption(option.id.toString()) : null)} className={clsx( "flex border p-4 rounded-xl gap-2 cursor-pointer bg-white text-base select-none", - userSolution === option.id.toString() && "border-mti-purple-light", + userSolution === option.id.toString() && "!bg-mti-purple-light !text-white", )}> {option.id.toString()}. {option.text} diff --git a/src/components/Medium/ModuleTitle.tsx b/src/components/Medium/ModuleTitle.tsx index 4b7b24b2..bd849f72 100644 --- a/src/components/Medium/ModuleTitle.tsx +++ b/src/components/Medium/ModuleTitle.tsx @@ -1,15 +1,13 @@ import { Module } from "@/interfaces"; import { moduleLabels } from "@/utils/moduleUtils"; import clsx from "clsx"; -import { Fragment, ReactNode, useCallback, useState } from "react"; +import { ReactNode, useState } from "react"; import { BsBook, BsClipboard, BsHeadphones, BsMegaphone, BsPen, BsStopwatch } from "react-icons/bs"; import ProgressBar from "../Low/ProgressBar"; import Timer from "./Timer"; -import { Exam, Exercise, LevelExam, MultipleChoiceExercise, ShuffleMap, UserSolution } from "@/interfaces/exam"; +import { Exercise, LevelExam, MultipleChoiceExercise, ShuffleMap, UserSolution } from "@/interfaces/exam"; import { BsFillGrid3X3GapFill } from "react-icons/bs"; -import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import Button from "../Low/Button"; -import { Dialog, Transition } from "@headlessui/react"; import useExamStore from "@/stores/examStore"; import Modal from "../Modal"; import React from "react"; @@ -145,7 +143,7 @@ export default function ModuleTitle({ return (
{partInstructions.split("\\n").map((line, lineIndex) => ( - {line} + not correct')}}> ))}
); diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 0bd0e46e..a7f3c7fb 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -7,10 +7,11 @@ interface Props { onClose: () => void; title?: string; className?: string; + titleClassName?: string; children?: ReactElement; } -export default function Modal({isOpen, title, className, onClose, children}: Props) { +export default function Modal({isOpen, title, className, titleClassName, onClose, children}: Props) { return ( @@ -41,7 +42,7 @@ export default function Modal({isOpen, title, className, onClose, children}: Pro className, )}> {title && ( - + {title} )} diff --git a/src/exams/Level/PartDivider.tsx b/src/exams/Level/PartDivider.tsx index f075f8c5..4f7cdd96 100644 --- a/src/exams/Level/PartDivider.tsx +++ b/src/exams/Level/PartDivider.tsx @@ -25,7 +25,7 @@ const PartDivider: React.FC = ({ partIndex, part, onNext }) => {
{/** only level for now */}
{moduleIcon["level"]}

{part.intro ? `Part ${partIndex + 1}` : "Placement Test"}

- {part.intro && part.intro.split('\\n\\n').map((x, index) =>

{x}

)} + {part.intro && part.intro.split('\\n\\n').map((x, index) =>

not correct')}}>

)}
+ +
+ + { !(partIndex === 0 && questionIndex === 0 && (showPartDivider || startNow)) && @@ -438,20 +438,27 @@ export default function Level({ exam, showSolutions = false, onFinish, editing = {exam.parts.map((_, index) => { - if (!seenParts.includes(index)) { - e.preventDefault(); - } else { - setExerciseIndex(0); - setQuestionIndex(0); + /* + // If client wants to revert uncomment and remove the added if statement + if (!seenParts.has(index)) { + e.preventDefault(); + } else { + */ + setExerciseIndex(0); + setQuestionIndex(0); + if (!seenParts.has(index)) { + setShowPartDivider(true); + setBgColor(levelBgColor); + setSeenParts(prev => new Set(prev).add(index)); } }} className={({ selected }) => clsx( "w-full rounded-lg py-2.5 text-sm font-medium leading-5 text-ielts-level/80", "ring-white ring-opacity-60 focus:outline-none", - "transition duration-300 ease-in-out", + "transition duration-300 ease-in-out hover:bg-white/70", selected && "bg-white shadow", - seenParts.includes(index) ? "hover:bg-white/70" : "cursor-not-allowed" + // seenParts.includes(index) ? "hover:bg-white/70" : "cursor-not-allowed" ) } >{`Part ${index + 1}`} diff --git a/src/interfaces/exam.ts b/src/interfaces/exam.ts index fa2a7384..4e65ec22 100644 --- a/src/interfaces/exam.ts +++ b/src/interfaces/exam.ts @@ -39,6 +39,7 @@ export interface LevelExam extends ExamBase { export interface LevelPart { context?: string; intro?: string; + category?: string; exercises: Exercise[]; }