update: fix option and textarea to submit on backend
This commit is contained in:
parent
bbc3eb464d
commit
0cad4e7ce9
|
|
@ -200,7 +200,7 @@ const formattedResult = answersData?.data.reduce((acc, item) => {
|
|||
// Effect untuk mengatur answers dari data yang diambil
|
||||
useEffect(() => {
|
||||
if (!assessmentId) {
|
||||
console.error("Assessment ID tidak ditemukan");
|
||||
console.error();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -762,8 +762,8 @@ console.log("unanswered questions:", unanswered.length);
|
|||
{question.options?.length > 0 ? (
|
||||
<div className="mx-11">
|
||||
<RadioGroup
|
||||
value={answers[question.questionId] || ""}
|
||||
onValueChange={(value) => handleAnswerChange(question.questionId, value)}
|
||||
value={answers[questionId] || ""}
|
||||
onValueChange={(value) => handleAnswerChange(questionId, value)}
|
||||
className="flex flex-col gap-2"
|
||||
>
|
||||
{question.options.map((option: any) => (
|
||||
|
|
@ -773,12 +773,12 @@ console.log("unanswered questions:", unanswered.length);
|
|||
? "bg-[--primary-color] text-white border-[--primary-color]"
|
||||
: "bg-gray-200 text-black border-gray-200"
|
||||
}`}
|
||||
onClick={() => handleAnswerChange(question.questionId, option.optionId)}
|
||||
onClick={() => handleAnswerChange(questionId, option.optionId)}
|
||||
>
|
||||
<RadioGroupItem
|
||||
value={option.optionId}
|
||||
id={option.optionId}
|
||||
checked={answers[question.questionId] === option.optionId}
|
||||
checked={answers[questionId] === option.optionId}
|
||||
className="bg-white checked:bg-white checked:border-[--primary-color] pointer-events-none rounded-full"
|
||||
/>
|
||||
<Label
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user