Navigation rework, added prompt edit to components that were missing
This commit is contained in:
@@ -15,7 +15,7 @@ import ProfileSummary from "@/components/ProfileSummary";
|
||||
import {ShuffleMap, Shuffles, Variant} from "@/interfaces/exam";
|
||||
import useSessions, {Session} from "@/hooks/useSessions";
|
||||
import SessionCard from "@/components/Medium/SessionCard";
|
||||
import useExamStore from "@/stores/examStore";
|
||||
import useExamStore from "@/stores/exam";
|
||||
import moment from "moment";
|
||||
|
||||
interface Props {
|
||||
@@ -32,7 +32,7 @@ export default function Selection({user, page, onStart}: Props) {
|
||||
const {data: stats} = useFilterRecordsByUser<Stat[]>(user?.id);
|
||||
const {sessions, isLoading, reload} = useSessions(user.id);
|
||||
|
||||
const state = useExamStore((state) => state);
|
||||
const dispatch = useExamStore((state) => state.dispatch);
|
||||
|
||||
const toggleModule = (module: Module) => {
|
||||
const modules = selectedModules.filter((x) => x !== module);
|
||||
@@ -44,19 +44,7 @@ export default function Selection({user, page, onStart}: Props) {
|
||||
)
|
||||
|
||||
const loadSession = async (session: Session) => {
|
||||
state.setShuffles(session.userSolutions.map((x) => ({exerciseID: x.exercise, shuffles: x.shuffleMaps ? x.shuffleMaps : []})));
|
||||
state.setSelectedModules(session.selectedModules);
|
||||
state.setExam(session.exam);
|
||||
state.setExams(session.exams);
|
||||
state.setSessionId(session.sessionId);
|
||||
state.setAssignment(session.assignment);
|
||||
state.setExerciseIndex(session.exerciseIndex);
|
||||
state.setPartIndex(session.partIndex);
|
||||
state.setModuleIndex(session.moduleIndex);
|
||||
state.setTimeSpent(session.timeSpent);
|
||||
state.setUserSolutions(session.userSolutions);
|
||||
state.setShowSolutions(false);
|
||||
state.setQuestionIndex(session.questionIndex);
|
||||
dispatch({type: "SET_SESSION", payload: { session }})
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user