Skip to content

Commit

Permalink
hotfix: 선지 순서 정렬 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-byeong committed Dec 5, 2024
1 parent 5eded95 commit fa3d705
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions packages/client/src/pages/quiz-session/ui/QuizBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,20 +131,22 @@ export default function QuizBox({
</div>
{/* 선택지 */}
<div className="space-y-4">
{quiz?.choices.map((choice, idx) => (
<button
key={choice.id}
onClick={() => handleSelectAnswer(idx)}
className={`w-full p-4 text-left rounded-xl border transition-all ${
selectedAnswer.includes(idx)
? 'border-blue-500 bg-blue-50'
: 'border-gray-200 hover:border-blue-200'
}`}
>
<span className="font-medium mr-3">{String.fromCharCode(65 + idx)}.</span>
{choice.content}
</button>
))}
{quiz?.choices
.sort((a, b) => a.position - b.position)
.map((choice, idx) => (
<button
key={choice.id}
onClick={() => handleSelectAnswer(idx)}
className={`w-full p-4 text-left rounded-xl border transition-all ${
selectedAnswer.includes(idx)
? 'border-blue-500 bg-blue-50'
: 'border-gray-200 hover:border-blue-200'
}`}
>
<span className="font-medium mr-3">{String.fromCharCode(65 + idx)}.</span>
{choice.content}
</button>
))}
</div>
</div>

Expand Down

0 comments on commit fa3d705

Please sign in to comment.