update: delete disable flagged question before choose option, and add condition for flagged question on navigation number of question
This commit is contained in:
parent
90f1802611
commit
54e754ac9d
|
|
@ -657,13 +657,8 @@ export default function AssessmentPage() {
|
||||||
});
|
});
|
||||||
toggleFlagMutation.mutate(questionId);
|
toggleFlagMutation.mutate(questionId);
|
||||||
}}
|
}}
|
||||||
title={
|
title="Tandai"
|
||||||
!answers[question.questionId]
|
|
||||||
? "Pilih jawaban terlebih dahulu"
|
|
||||||
: "Tandai"
|
|
||||||
}
|
|
||||||
className={`m-2 rounded-md border-1 flex items-center justify-center h-7 w-7 ${flaggedQuestions[questionId] ? "border-white bg-red-500" : "border-gray-100 bg-white"}`}
|
className={`m-2 rounded-md border-1 flex items-center justify-center h-7 w-7 ${flaggedQuestions[questionId] ? "border-white bg-red-500" : "border-gray-100 bg-white"}`}
|
||||||
disabled={!answers[question.questionId]}
|
|
||||||
>
|
>
|
||||||
<TbFlagFilled
|
<TbFlagFilled
|
||||||
size={25}
|
size={25}
|
||||||
|
|
@ -815,7 +810,9 @@ export default function AssessmentPage() {
|
||||||
<div key={questionId} className="flex justify-center relative">
|
<div key={questionId} className="flex justify-center relative">
|
||||||
<button
|
<button
|
||||||
className={`w-9 h-9 border rounded-sm flex items-center justify-center relative text-md
|
className={`w-9 h-9 border rounded-sm flex items-center justify-center relative text-md
|
||||||
${answers[questionId] ? "bg-blue-500 text-white" : "bg-transparent text-black"}
|
${answers[questionId] && flaggedQuestions[questionId] ? "bg-white text-black" : ""}
|
||||||
|
${answers[questionId] && !flaggedQuestions[questionId] ? "bg-blue-500 text-white" : ""}
|
||||||
|
${!answers[questionId] && !flaggedQuestions[questionId] ? "bg-transparent text-black" : ""}
|
||||||
${flaggedQuestions[questionId] ? "border-gray-50" : ""}`}
|
${flaggedQuestions[questionId] ? "border-gray-50" : ""}`}
|
||||||
onClick={() => scrollToQuestion(questionId)}
|
onClick={() => scrollToQuestion(questionId)}
|
||||||
>
|
>
|
||||||
|
|
@ -823,7 +820,7 @@ export default function AssessmentPage() {
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{flaggedQuestions[questionId] && (
|
{flaggedQuestions[questionId] && (
|
||||||
<div className="absolute top-0 right-0 w-0 h-0 border-b-[20px] border-b-transparent border-r-[20px] border-r-red-600 rounded-e-md" />
|
<div className="absolute top-0 right-0 w-0 h-0 border-b-[20px] border-b-transparent border-r-[20px] border-r-red-600 rounded-tr-sm" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user