Skip to content

Commit 1801ec1

Browse files
seangaaabASPactores
authored andcommitted
fix: fix question display
1 parent c5f45cb commit 1801ec1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

frontend/src/pages/admin/event/evaluations/EvaluationInfoModal.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Button from '@/components/Button';
33
import { FormItemContainer } from '@/components/Form';
44
import Modal from '@/components/Modal';
55
import { EvaluationResponse } from '@/model/evaluations';
6-
import { QUESTIONS } from '@/pages/client/evaluate/questionBuilder/questionsConfig';
6+
import { QUESTIONS } from '@/pages/client/pycon/evaluate/questionBuilder/questionsConfig';
77

88
const DisplayAnswerSwitch = (evaluation: EvaluationResponse) => {
99
const { questionType } = evaluation;
@@ -14,6 +14,8 @@ const DisplayAnswerSwitch = (evaluation: EvaluationResponse) => {
1414
return <span>{evaluation.answerScale}</span>;
1515
case 'boolean':
1616
return <span>{evaluation.booleanAnswer ? 'Yes' : 'No'}</span>;
17+
default:
18+
return <span>{evaluation.answer || evaluation.answerScale || evaluation.booleanAnswer || evaluation.multipleAnswers}</span>;
1719
}
1820
};
1921

@@ -29,22 +31,20 @@ const EvaluationInfoModal: FC<Props> = ({ fullName, evaluationList }) => {
2931
modalTitle={fullName + ' Evaluation Answers'}
3032
visible={showModal}
3133
onOpenChange={setShowModal}
32-
className="md:max-w-[80%] max-h-[80%] overflow-scroll overflow-x-hidden"
34+
className="md:max-w-[80%] max-h-[80%]"
3335
trigger={<Button variant="ghost" size="icon" icon="Ellipsis" />}
3436
modalFooter={
3537
<Button onClick={() => setShowModal(false)} variant="ghost">
3638
Close
3739
</Button>
3840
}
3941
>
40-
<div className="w-full flex flex-col flex-wrap gap-y-6 items-center justify-center">
42+
<div className="w-full h-full overflow-auto flex flex-col flex-wrap gap-y-6 items-center justify-center">
4143
{evaluationList.map((evaluation) => {
4244
return (
4345
<FormItemContainer key={evaluation.question} halfSpace>
44-
<div className="flex flex-col gap-y-2">
45-
<p className="font-bold">{evaluation.question?.split('_').join(' ')}?</p>
46-
<p className="p-2 rounded-sm bg-input">{DisplayAnswerSwitch(evaluation)}</p>
47-
</div>
46+
<p className="font-bold">{QUESTIONS.get(evaluation.question!)}</p>
47+
<p className="p-2 rounded-sm bg-input">{DisplayAnswerSwitch(evaluation)}</p>
4848
</FormItemContainer>
4949
);
5050
})}

0 commit comments

Comments
 (0)