Skip to content

Commit

Permalink
[Fix]- 소유자 여부에 따라 answerBox 비활성화 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaem03 committed Nov 16, 2024
1 parent bc17d52 commit c37a7d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/testQuestion/TestQuestion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ export const TestQuestion = ({
TEST_QUESTION,
isAnswerCorrect, //정답이 맞는지-접속자
isAnswerSelected, //선택되었는지 - 소유자
isUser,
}) => {
const handleSelect = (index) => {
if (selectedAnswer[currentQuestion] === null) {
if (isUser) {
handleAnswerSelect(index);
} else {
if (selectedAnswer[currentQuestion] === null) {
handleAnswerSelect(index);
}
}
};
console.log("isAnswerinCorrect:", isAnswerCorrect);
Expand Down
1 change: 1 addition & 0 deletions src/pages/nuguTest/ChallengerTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const ChallengerTest = () => {
TEST_QUESTION={TEST_QUESTION}
isAnswerCorrect={isAnswerCorrect}
isAnswerSelected={isAnswerSelected}
isUser={false}
/>
)}
</S.ChallengeContainer>
Expand Down
1 change: 1 addition & 0 deletions src/pages/nuguTest/MakeNuguTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const MakeNuguTest = () => {
TEST_QUESTION={TEST_QUESTION}
isAnswerCorrect={true}
isAnswerSelected={isAnswerSelected}
isUser={true}
/>
</>
);
Expand Down

0 comments on commit c37a7d6

Please sign in to comment.