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);
|
||||
}}
|
||||
title={
|
||||
!answers[question.questionId]
|
||||
? "Pilih jawaban terlebih dahulu"
|
||||
: "Tandai"
|
||||
}
|
||||
title="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"}`}
|
||||
disabled={!answers[question.questionId]}
|
||||
>
|
||||
<TbFlagFilled
|
||||
size={25}
|
||||
|
|
@ -815,7 +810,9 @@ export default function AssessmentPage() {
|
|||
<div key={questionId} className="flex justify-center relative">
|
||||
<button
|
||||
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" : ""}`}
|
||||
onClick={() => scrollToQuestion(questionId)}
|
||||
>
|
||||
|
|
@ -823,7 +820,7 @@ export default function AssessmentPage() {
|
|||
</button>
|
||||
|
||||
{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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user