Skip to content

Commit

Permalink
Merge pull request #852 from bounswe/FRONTEND-851
Browse files Browse the repository at this point in the history
fix(frontend): fixed quiz view and end
  • Loading branch information
alitariksahin authored Dec 15, 2024
2 parents 70a7e53 + 61ddce0 commit 126b4e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/quiz/question-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default function QuestionCard({
answers[cur_question - 1] === Answer.C ||
correct == 1 ||
previous_answer == 1
? "text-white"
? ""
: ""
}`}
>
Expand Down Expand Up @@ -159,7 +159,7 @@ export default function QuestionCard({
answers[cur_question - 1] === Answer.C ||
correct == 2 ||
previous_answer == 2
? "text-white"
? ""
: ""
}`}
>
Expand Down Expand Up @@ -189,7 +189,7 @@ export default function QuestionCard({
answers[cur_question - 1] === Answer.C ||
correct == 3 ||
previous_answer == 3
? "text-white"
? ""
: ""
}`}
>
Expand Down Expand Up @@ -219,7 +219,7 @@ export default function QuestionCard({
answers[cur_question - 1] === Answer.C ||
correct == 4 ||
previous_answer == 4
? "text-white"
? ""
: ""
}`}
>
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/pages/quiz-end.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export default function QuizEnd() {
})
.then((response) => {
console.log(response.data);
setQuizData(response.data);
setScorePercentage((response.data.score / response.data.question_count) * 100);
setIsLiked(response.data.is_liked);
setLikes(response.data.like_count);
setIsBookmarked(response.data.is_bookmarked);
setquiz_id(response.data.quiz.id);
setQuizData(response.data.quiz_result);
setScorePercentage((response.data.quiz_result.score / response.data.quiz_result.question_count) * 100);
setIsLiked(response.data.quiz_result.is_liked);
setLikes(response.data.quiz_result.like_count);
setIsBookmarked(response.data.quiz_result.is_bookmarked);
setquiz_id(response.data.quiz_result.id);
})
.catch((error) => {
console.error("Error fetching quiz data:", error);
Expand Down Expand Up @@ -223,7 +223,7 @@ export default function QuizEnd() {
</CardFooter>
</Card>
</div>
<div className="w-min overflow-hidden items-center mb-1">
<div className=" p-4 w-min overflow-hidden items-center mb-1">
{
quizRecommend ?
<div className="flex flex-col justify-center gap-2 items-center w-min">
Expand Down

0 comments on commit 126b4e7

Please sign in to comment.