feat(targeted): add targeted practice functionality

feat(analytics); add analytics page
This commit is contained in:
shafin-r
2026-02-05 15:07:24 +06:00
parent 2ac88835f9
commit 903653a212
20 changed files with 2018 additions and 35 deletions

View File

@ -1,16 +1,9 @@
import { useEffect, useState } from "react";
import { Outlet, replace, useParams } from "react-router-dom";
import { useParams } from "react-router-dom";
import { api } from "../../../utils/api";
import { useAuthStore } from "../../../stores/authStore";
import type { PracticeSheet } from "../../../types/sheet";
import {
CircleQuestionMark,
Clock,
Layers,
Loader,
Loader2,
Tag,
} from "lucide-react";
import { CircleQuestionMark, Clock, Layers, Loader, Tag } from "lucide-react";
import {
Carousel,
CarouselContent,
@ -19,8 +12,12 @@ import {
} from "../../../components/ui/carousel";
import { Button } from "../../../components/ui/button";
import { useNavigate } from "react-router-dom";
import { useExamConfigStore } from "../../../stores/useExamConfigStore";
export const Pretest = () => {
const { setSheetId, setMode, storeDuration, setQuestionCount } =
useExamConfigStore();
const user = useAuthStore((state) => state.user);
const { sheetId } = useParams<{ sheetId: string }>();
const [carouselApi, setCarouselApi] = useState<CarouselApi>();
@ -37,6 +34,12 @@ export const Pretest = () => {
console.error("Sheet ID is required to start the test.");
return;
}
setSheetId(sheetId);
setMode("MODULE");
storeDuration(practiceSheet?.time_limit ?? 0);
setQuestionCount(2);
navigate(`/student/practice/${sheetId}/test`, { replace: true });
}