Skip to content

Commit

Permalink
[Test]/#82- 누구테스트 응시자, 소유자 답비교 콘솔 test
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaem03 authored Nov 15, 2024
2 parents ca69bbd + 28db100 commit c29e29b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pages/nuguTest/ChallengerTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@ export const ChallengerTest = () => {
try {
const reponse = await getUserTestAnswer(uuid);
setRank(reponse);
console.log("누구테스트 정답", rank);
} catch (error) {
console.error("getUserTestAnswer 못받아옴:", error);
}
};

fetchRank();
}, []);
const userInfo = rank?.find((user) => user.id === challengerId);
const ResulthighlightIndex = rank?.findIndex(

const userInfo = result?.find((user) => user.id === challengerId);
console.log(userInfo);
const ResulthighlightIndex = result?.findIndex(
(user) => user.id === challengerId
);
console.log(ResulthighlightIndex);
//정답 비교
const isAnswerinCorrect = rank
? rank[currentQuestion] !== selectedAnswer[currentQuestion]
? rank[currentQuestion] === selectedAnswer[currentQuestion]
: false;
const isAnswerSelected = selectedAnswer[currentQuestion] !== null;
return (
Expand Down
1 change: 1 addition & 0 deletions src/pages/nuguTest/NuguChallenge.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const NuguChallenge = () => {
const setTestUser = useSetRecoilState(testUser);
const navigate = useNavigate();
const isTestMake = true;

const moveOnTest = () => {
navigate(`/challenge/test/${Cookies.get("uuid")}`);
};
Expand Down

0 comments on commit c29e29b

Please sign in to comment.