chore: Secure routes with auth middleware, update text and fix minor bugs
This commit is contained in:
@@ -461,7 +461,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="prose prose-neutral dark:prose-invert max-w-none text-lg leading-relaxed text-foreground font-medium">
|
||||
<div className="prose prose-neutral dark:prose-invert max-w-none text-xl md:text-2xl leading-relaxed text-foreground font-black">
|
||||
<ReactMarkdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex, rehypeRaw]}>
|
||||
{currentQuestion.text_en}
|
||||
</ReactMarkdown>
|
||||
@@ -478,14 +478,14 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
{currentQuestion.type === 'Numerical' ? (
|
||||
<input
|
||||
type="text"
|
||||
className="w-full p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent text-base"
|
||||
className="w-full p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent text-lg md:text-xl font-bold"
|
||||
placeholder="Type your numerical answer here..."
|
||||
value={currentState?.selected_answer || ""}
|
||||
onChange={(e) => selectAnswer(currentQuestion.id, e.target.value)}
|
||||
/>
|
||||
) : currentQuestion.type === 'Subjective' ? (
|
||||
<textarea
|
||||
className="w-full min-h-[150px] p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent resize-y text-base"
|
||||
className="w-full min-h-[150px] p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent resize-y text-lg md:text-xl font-bold"
|
||||
placeholder="Type your answer or explanation here..."
|
||||
value={currentState?.selected_answer || ""}
|
||||
onChange={(e) => selectAnswer(currentQuestion.id, e.target.value)}
|
||||
@@ -502,16 +502,16 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
<button
|
||||
key={idx}
|
||||
onClick={() => handleOptionSelect(currentQuestion.id, letter, currentQuestion.type)}
|
||||
className={`w-full text-left p-4 rounded-xl border transition-all duration-200 flex items-center gap-4 group focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent
|
||||
className={`w-full text-left p-4.5 rounded-xl border transition-all duration-200 flex items-center gap-4 group focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent
|
||||
${isSelected ? 'border-primary bg-primary/5 shadow-[0_0_15px_-5px_var(--color-primary)]' : 'border-border bg-background hover:border-primary/50 hover:bg-secondary/20'}
|
||||
`}
|
||||
>
|
||||
<div className={`flex-shrink-0 size-8 ${isMultiple ? 'rounded-md' : 'rounded-full'} border flex items-center justify-center font-medium transition-colors
|
||||
<div className={`flex-shrink-0 size-10 ${isMultiple ? 'rounded-md' : 'rounded-full'} border flex items-center justify-center font-black text-base transition-colors
|
||||
${isSelected ? 'border-primary bg-primary text-primary-foreground' : 'border-border text-muted-foreground group-hover:border-primary/50 group-hover:text-primary group-hover:bg-primary/5'}
|
||||
`}>
|
||||
{letter}
|
||||
</div>
|
||||
<span className={`text-base font-semibold flex-1 ${isSelected ? 'text-primary' : ''}`}>
|
||||
<span className={`text-lg md:text-xl font-bold flex-1 ${isSelected ? 'text-primary' : ''}`}>
|
||||
<ReactMarkdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex, rehypeRaw]}>
|
||||
{renderLatex(option)}
|
||||
</ReactMarkdown>
|
||||
@@ -544,7 +544,7 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="prose prose-neutral dark:prose-invert max-w-none text-lg leading-relaxed text-foreground font-medium">
|
||||
<div className="prose prose-neutral dark:prose-invert max-w-none text-xl md:text-2xl leading-relaxed text-foreground font-black">
|
||||
<ReactMarkdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex, rehypeRaw]}>
|
||||
{currentQuestion.text_hi}
|
||||
</ReactMarkdown>
|
||||
@@ -561,14 +561,14 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
{currentQuestion.type === 'Numerical' ? (
|
||||
<input
|
||||
type="text"
|
||||
className="w-full p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent text-base"
|
||||
className="w-full p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent text-lg md:text-xl font-bold"
|
||||
placeholder="अपना संख्यात्मक उत्तर यहाँ टाइप करें..."
|
||||
value={currentState?.selected_answer || ""}
|
||||
onChange={(e) => selectAnswer(currentQuestion.id, e.target.value)}
|
||||
/>
|
||||
) : currentQuestion.type === 'Subjective' ? (
|
||||
<textarea
|
||||
className="w-full min-h-[150px] p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent resize-y text-base"
|
||||
className="w-full min-h-[150px] p-4 rounded-xl border border-border bg-background focus:ring-2 focus:ring-primary focus:border-transparent resize-y text-lg md:text-xl font-bold"
|
||||
placeholder="अपना उत्तर या स्पष्टीकरण यहाँ टाइप करें..."
|
||||
value={currentState?.selected_answer || ""}
|
||||
onChange={(e) => selectAnswer(currentQuestion.id, e.target.value)}
|
||||
@@ -585,16 +585,16 @@ export default function CBTExamPage({ params }: { params: Promise<{ examId: stri
|
||||
<button
|
||||
key={idx}
|
||||
onClick={() => handleOptionSelect(currentQuestion.id, letter, currentQuestion.type)}
|
||||
className={`w-full text-left p-4 rounded-xl border transition-all duration-200 flex items-center gap-4 group focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent
|
||||
className={`w-full text-left p-4.5 rounded-xl border transition-all duration-200 flex items-center gap-4 group focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent
|
||||
${isSelected ? 'border-primary bg-primary/5 shadow-[0_0_15px_-5px_var(--color-primary)]' : 'border-border bg-background hover:border-primary/50 hover:bg-secondary/20'}
|
||||
`}
|
||||
>
|
||||
<div className={`flex-shrink-0 size-8 ${isMultiple ? 'rounded-md' : 'rounded-full'} border flex items-center justify-center font-medium transition-colors
|
||||
<div className={`flex-shrink-0 size-10 ${isMultiple ? 'rounded-md' : 'rounded-full'} border flex items-center justify-center font-black text-base transition-colors
|
||||
${isSelected ? 'border-primary bg-primary text-primary-foreground' : 'border-border text-muted-foreground group-hover:border-primary/50 group-hover:text-primary group-hover:bg-primary/5'}
|
||||
`}>
|
||||
{letter}
|
||||
</div>
|
||||
<span className={`text-base font-semibold flex-1 ${isSelected ? 'text-primary' : ''}`}>
|
||||
<span className={`text-lg md:text-xl font-bold flex-1 ${isSelected ? 'text-primary' : ''}`}>
|
||||
<ReactMarkdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex, rehypeRaw]}>
|
||||
{renderLatex(option)}
|
||||
</ReactMarkdown>
|
||||
|
||||
Reference in New Issue
Block a user