From c6f252744936c8d044dc332825102e9582f11753 Mon Sep 17 00:00:00 2001 From: jainiksha Date: Thu, 13 Aug 2026 15:01:04 +0530 Subject: [PATCH] feat: add AI adaptive review mode --- ...InterviewPreparationAdaptiveReviewMode.jsx | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 frontend/src/pages/AIInterviewPreparationAdaptiveReviewMode.jsx diff --git a/frontend/src/pages/AIInterviewPreparationAdaptiveReviewMode.jsx b/frontend/src/pages/AIInterviewPreparationAdaptiveReviewMode.jsx new file mode 100644 index 00000000..a31dfcf8 --- /dev/null +++ b/frontend/src/pages/AIInterviewPreparationAdaptiveReviewMode.jsx @@ -0,0 +1,189 @@ +import React, { useState } from "react"; +import { + Brain, + RefreshCw, + Target, + CheckCircle2, +} from "lucide-react"; + +const questions = [ + { + question: "What is the time complexity of Binary Search?", + answer: "O(log n)", + }, + { + question: "What condition is required for Binary Search?", + answer: "The data must be sorted.", + }, + { + question: "What is the space complexity of iterative Binary Search?", + answer: "O(1)", + }, +]; + +export default function AIInterviewPreparationAdaptiveReviewMode() { + const [current, setCurrent] = useState(0); + const [answer, setAnswer] = useState(""); + const [score, setScore] = useState(0); + const [completed, setCompleted] = useState(false); + + const submitAnswer = () => { + const correct = answer + .toLowerCase() + .includes(questions[current].answer.toLowerCase()); + + if (correct) setScore((prev) => prev + 1); + + if (current < questions.length - 1) { + setCurrent((prev) => prev + 1); + setAnswer(""); + } else { + setCompleted(true); + } + }; + + return ( +
+ + {/* Header */} +
+
+ +
+ +
+

+ AI Adaptive Review Mode +

+ +

+ Revision content adapts to your performance in real time. +

+
+
+ + {!completed ? ( + <> + {/* Progress */} +
+ +
+ + Binary Search Revision + + + + {current + 1} / {questions.length} + +
+ +
+
+
+ +
+ + {/* Question */} +
+ +
+ + + + Adaptive Question + +
+ +

+ {questions[current].question} +

+ +