feat(targeted): add targeted practice functionality
feat(analytics); add analytics page
This commit is contained in:
@ -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 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user