Skip to content

Commit

Permalink
fix: fresh the logical
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowballXueQiu committed Aug 15, 2024
1 parent 1f2dfbf commit 99a15ef
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/survey/components/generateQuestion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { Title, Text } from '@mantine/core';
import { SingleChoice } from '@/app/survey/components/SingleChoice';
import { MultipleChoice } from '@/app/survey/components/MultipleChoice';
import { FileUpload } from '@/app/survey/components/FileUpload';
Expand All @@ -19,36 +20,40 @@ export function generateQuestion(data: QuestionData) {
case 1:
return (
<div key={data.id}>
<h3>{data.title}</h3>
<Title order={3}>{`${data.id}. ${data.title}`}</Title>
<p>{data.description}</p>
<FillBlank />
</div>
);
case 2:
return (
<div key={data.id}>
<h3>{data.title}</h3>
<Title order={3}>{`${data.id}. ${data.title}`}</Title>
<p>{data.description}</p>
<SingleChoice data={parsedValues} />
</div>
);
case 3:
return (
<div key={data.id}>
<h3>{data.title}</h3>
<Title order={3}>{`${data.id}. ${data.title}`}</Title>
<p>{data.description}</p>
<MultipleChoice data={parsedValues} />
</div>
);
case 4:
return (
<div key={data.id}>
<h3>{data.title}</h3>
<Title order={3}>{`${data.id}. ${data.title}`}</Title>
<p>{data.description}</p>
<FileUpload />
</div>
);
default:
return null;
return (
<div>
<Text>Failed to fetch questions!</Text>
</div>
);
}
}

0 comments on commit 99a15ef

Please sign in to comment.