ui changes
This commit is contained in:
parent
dd5590d4c8
commit
b059d2afd6
|
|
@ -39,7 +39,7 @@ const page = ({ params }: IParams) => {
|
|||
: setQuizFinished(true)
|
||||
);
|
||||
} else if (res.data.steps && res.data.steps?.length > 0) {
|
||||
setStep(res.data.steps[0].tapgyr);
|
||||
setStep(res.data.steps[res.data.steps.length - 1].tapgyr);
|
||||
for (let i = 0; i < res.data.steps.length; i++) {
|
||||
res.data.steps[i].questions.map((question) =>
|
||||
question.status === "active" || question.status === "new"
|
||||
|
|
@ -59,7 +59,7 @@ const page = ({ params }: IParams) => {
|
|||
: setQuizFinished(true)
|
||||
);
|
||||
} else if (res.data.steps && res.data.steps?.length > 0) {
|
||||
setStep(res.data.steps[0].tapgyr);
|
||||
setStep(res.data.steps[res.data.steps.length - 1].tapgyr);
|
||||
for (let i = 0; i < res.data.steps.length; i++) {
|
||||
res.data.steps[i].questions.map((question) =>
|
||||
question.status === "active" || question.status === "new"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ const Page = ({ params }: IParams) => {
|
|||
Queries.getQuizById(params.quiz_id)
|
||||
.then((res) => {
|
||||
setData(res.data);
|
||||
if (res.data.steps?.length) {
|
||||
setTab(res.data?.steps[res.data?.steps.length - 1].tapgyr - 1);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
.catch(() => {
|
||||
|
|
@ -37,8 +40,6 @@ const Page = ({ params }: IParams) => {
|
|||
}
|
||||
}, [resultData, error]);
|
||||
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<section className="container py-[40px]">
|
||||
<div className="flex flex-col w-full py-[40px] gap-[80px]">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { getNextQuizWinnners, getQuizWinnersById } from "@/api/queries";
|
|||
import { Question } from "@/models/quizQuestions.model";
|
||||
import {
|
||||
Datum,
|
||||
IQuizQuestionsWinners,
|
||||
ISearchNetije,
|
||||
} from "@/models/quizQuestionsWinners.model";
|
||||
import { notFound } from "next/navigation";
|
||||
|
|
@ -188,11 +187,14 @@ const QuizTapgyrWinners = ({ id, tapgyr, questions }: IProps) => {
|
|||
: "text-textLight"
|
||||
}`}
|
||||
>
|
||||
{matchingAnswer && matchingAnswer.score !== 0
|
||||
? matchingAnswer.serial_number_for_correct
|
||||
: matchingAnswer && matchingAnswer?.score === 0
|
||||
? "X"
|
||||
: "-"}
|
||||
{matchingAnswer && matchingAnswer.score !== 0 ? (
|
||||
matchingAnswer.serial_number_for_correct
|
||||
) : matchingAnswer &&
|
||||
matchingAnswer?.score === 0 ? (
|
||||
"X"
|
||||
) : (
|
||||
<span className="text-[20px]">-</span>
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
Loading…
Reference in New Issue