diff --git a/apps/frontend/src/routes/_verifyingLayout/verifying/index.lazy.tsx b/apps/frontend/src/routes/_verifyingLayout/verifying/index.lazy.tsx
index b9cae42..7a4a73b 100644
--- a/apps/frontend/src/routes/_verifyingLayout/verifying/index.lazy.tsx
+++ b/apps/frontend/src/routes/_verifyingLayout/verifying/index.lazy.tsx
@@ -21,6 +21,15 @@ import { ScrollArea } from "@/shadcn/components/ui/scroll-area";
import {
Pagination,
} from "@/shadcn/components/ui/pagination-assessment";
+import {
+ Sheet,
+ SheetContent,
+ SheetTitle,
+} from "@/shadcn/components/ui/sheet";
+import {
+ LeftSheet,
+ LeftSheetContent,
+} from "@/shadcn/components/ui/leftsheet";
import { useQuery, useMutation } from "@tanstack/react-query";
import {
submitAssessmentMutationOptions,
@@ -38,11 +47,12 @@ import {
import {
getAllVerifiedAspectsAverageScore,
} from "@/modules/assessmentResult/queries/assessmentResultQueries";
-import { TbFlagFilled, TbUpload, TbChevronRight, TbChevronDown } from "react-icons/tb";
+import { TbLayoutSidebarLeftCollapseFilled, TbChevronRight, TbChevronDown } from "react-icons/tb";
import FinishAssessmentModal from "@/modules/assessmentManagement/modals/ConfirmModal";
import ValidationModal from "@/modules/assessmentManagement/modals/ValidationModal";
import FileSizeValidationModal from "@/modules/assessmentManagement/modals/FileSizeValidationModal";
import { useState, useRef, useEffect } from "react";
+import AppHeader from "@/components/AppHeader";
const getQueryParam = (param: string) => {
const urlParams = new URLSearchParams(window.location.search);
@@ -98,6 +108,21 @@ export default function AssessmentPage() {
const [currentPagePerSubAspect, setCurrentPagePerSubAspect] = useState<{ [subAspectId: string]: number }>({});
const currentPage = currentPagePerSubAspect[selectedSubAspectId || ""] || 1;
const questionsPerPage = 10;
+ const [isMobile, setIsMobile] = useState(window.innerWidth <= 768); // Check for mobile screen
+ const [isSidebarOpen, setIsSidebarOpen] = useState(false);
+ const [openNavbar, setOpenNavbar] = useState(false);
+ const [isLeftSidebarOpen, setIsLeftSidebarOpen] = useState(false);
+
+ const toggleLeftSidebar = () => setIsLeftSidebarOpen(!isLeftSidebarOpen);
+
+ const toggle = () => {
+ setOpenNavbar((prevState) => !prevState);
+ };
+
+ // Adjust layout on screen resize
+ window.addEventListener('resize', () => {
+ setIsMobile(window.innerWidth <= 768);
+ });
// Fetch aspects and sub-aspects
const aspectsQuery = useQuery({
@@ -587,62 +612,123 @@ console.log("unanswered questions:", unanswered.length);
{/* LEFT-SIDE */}
{/* Aspek dan Sub-Aspek */}
-
-
-
- {/* Aspek */}
- {aspectsQuery.data?.data
- .filter((aspect) =>
- aspect.subAspects.some((subAspect) =>
- data?.data.some((question) => question.subAspectId === subAspect.id)
- )
- )
- .map((aspect) => (
-
-
toggleAspect(aspect.id)}
- >
-
{aspect.name}
-
- {openAspects[aspect.id] ? (
-
- ) : (
-
+
+
+ {/* Sidebar for Mobile */}
+ {isMobile && (
+
setIsLeftSidebarOpen(open)}>
+
+
+
+
+ {/* Aspek */}
+ {aspectsQuery.data?.data
+ .filter((aspect) =>
+ aspect.subAspects.some((subAspect) =>
+ data?.data.some((question) => question.subAspectId === subAspect.id)
+ )
+ )
+ .map((aspect) => (
+
+
toggleAspect(aspect.id)}
+ >
+
{aspect.name}
+
+ {openAspects[aspect.id] ? (
+
+ ) : (
+
+ )}
+
+
+
+ {/* Sub-Aspek */}
+ {openAspects[aspect.id] && (
+
+ {aspect.subAspects
+ .filter((subAspect) =>
+ data?.data.some((question) => question.subAspectId === subAspect.id)
+ )
+ .map((subAspect) => (
+
setSelectedSubAspectId(subAspect.id)}
+ >
+
{subAspect.name}
+
+ ))}
+
)}
-
+ ))}
+
+
+
+
+ )}
- {/* Sub-Aspek */}
- {openAspects[aspect.id] && (
-
- {aspect.subAspects
- .filter((subAspect) =>
- data?.data.some((question) => question.subAspectId === subAspect.id)
- )
- .map((subAspect) => (
-
setSelectedSubAspectId(subAspect.id)}
- >
-
{subAspect.name}
-
- ))}
+ {/* Sidebar for Desktop (Always Visible) */}
+
+
+
+
+ {/* Aspek */}
+ {aspectsQuery.data?.data
+ .filter((aspect) =>
+ aspect.subAspects.some((subAspect) =>
+ data?.data.some((question) => question.subAspectId === subAspect.id)
+ )
+ )
+ .map((aspect) => (
+
+
toggleAspect(aspect.id)}
+ >
+
{aspect.name}
+
+ {openAspects[aspect.id] ? (
+
+ ) : (
+
+ )}
+
- )}
-
- ))}
-
-
-
+
+ {/* Sub-Aspek */}
+ {openAspects[aspect.id] && (
+
+ {aspect.subAspects
+ .filter((subAspect) =>
+ data?.data.some((question) => question.subAspectId === subAspect.id)
+ )
+ .map((subAspect) => (
+
setSelectedSubAspectId(subAspect.id)}
+ >
+
{subAspect.name}
+
+ ))}
+
+ )}
+
+ ))}
+
+
+
{/* MIDDLE */}
{/* Pertanyaan */}
-
+
Harap menjawab semua pertanyaan yang tersedia
@@ -664,39 +750,35 @@ console.log("unanswered questions:", unanswered.length);
className="space-y-4"
>
-
- {/* Question */}
- {startIndex + index + 1}.
-
-
- {question.questionText}
-
-
-
+
+ {/* Question Number */}
+ {startIndex + index + 1}.
- {/* Opsi Radio Button */}
+ {/* Question Text */}
+ {question.questionText}
+
+
+ {/* Radio Button Options */}
{question.options?.length > 0 ? (
-
handleAnswerChange(questionId, value)}
+ value={answers[question.questionId] || ""}
+ onValueChange={(value) => handleAnswerChange(question.questionId, value)}
className="flex flex-col gap-2"
>
{question.options.map((option: any) => (
handleAnswerChange(questionId, option.optionId)}
+ className={`cursor-pointer transition-transform transform hover:scale-105 shadow-md hover:shadow-lg flex items-center border-4 rounded-lg p-3 text-sm ${answers[question.questionId] === option.optionId
+ ? "bg-[--primary-color] text-white border-[--primary-color]"
+ : "bg-gray-200 text-black border-gray-200"
+ }`}
+ onClick={() => handleAnswerChange(question.questionId, option.optionId)}
>
{/* RIGHT-SIDE */}
{/* Navigasi dan Pagination */}
-
+ {isMobile && (
+
+ )}
+
+ {/* Sidebar for mobile (only when toggled) */}
+
+
setIsSidebarOpen(open)}>
+
+
+ Nomor Soal
+
+
+ {/* Navigasi (Number of Questions) */}
+
+ {Array.from({ length: totalQuestionsInSubAspect }).map((_, i) => {
+ const questionNumber = startIndex + i + 1;
+ const questionId = filteredQuestions[i]?.questionId;
+
+ return questionId ? (
+
+
+ {flaggedQuestions[questionId] && (
+
+ )}
+
+ ) : null;
+ })}
+
+
+ {/* Divider */}
+
+
+ {/* Skor Aspek dan Sub-Aspek */}
+
+
Nilai Sementara
+
+
+ {filteredAspects.length > 0 ? (
+ filteredAspects.map((aspect) => {
+ const aspectScore = parseFloat(aspect.averageScore).toFixed(2);
+ const aspectScoreValue = parseFloat(aspectScore);
+
+ return (
+
+ {aspect.aspectName}
+ = 4.5
+ ? "text-green-700"
+ : aspectScoreValue >= 3.5
+ ? "text-green-400"
+ : aspectScoreValue >= 2.5
+ ? "text-yellow-400"
+ : aspectScoreValue >= 1.5
+ ? "text-orange-500"
+ : "text-red-500"
+ }`}
+ >
+ {aspectScore}
+
+
+ );
+ })
+ ) : (
+
Data aspek ini kosong
+ )}
+
+
+ {/* Divider */}
+
+
+ {/* Skor Sub-Aspek */}
+
+ {filteredSubAspects.length > 0 ? (
+ filteredSubAspects.map((subAspect) => {
+ const subAspectScore = parseFloat(subAspect.averageScore).toFixed(2);
+ const subAspectScoreValue = parseFloat(subAspectScore);
+
+ return (
+
+ {subAspect.subAspectName}
+ = 4.5
+ ? "text-green-700"
+ : subAspectScoreValue >= 3.5
+ ? "text-green-400"
+ : subAspectScoreValue >= 2.5
+ ? "text-yellow-400"
+ : subAspectScoreValue >= 1.5
+ ? "text-orange-500"
+ : "text-red-500"
+ }`}
+ >
+ {subAspectScore}
+
+
+ );
+ })
+ ) : (
+
Data sub-aspek ini kosong
+ )}
+
+
+ {/* Finish Button */}
+
+
+
+
+ {/* Finish Assessment Modal */}
+
setModalOpen(false)}
+ onConfirm={handleConfirmFinish}
+ assessmentId={assessmentId}
+ />
+
+ {/* Validation Modal */}
+ setValidationModalOpen(false)}
+ unansweredQuestions={unansweredQuestions}
+ />
+
+
+
+
+
+ {/* Sidebar for desktop (always visible) */}
+
Nomor Soal