Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: QuizVisualization 컴포넌트 grid 생성 및 캐릭터 움직임 조작, QuizEditor 컴포넌트 #14

Merged
merged 9 commits into from
Feb 7, 2025

Conversation

nemo0824
Copy link
Collaborator

feature: QuizVisualization 컴포넌트 문제생성(grid), 캐릭터 움직임 조작, QuizEditor컴포넌트 return없는 함수 배열에 리스트저장, useQuiz useAnswer상태관리저장.

… return없는 함수 배열에 리스트저장, useQuiz useAnswer상태관리저장.
@new-deni
Copy link

new-deni commented Feb 1, 2025

p1) ; 통일하세요.

Comment on lines 16 to 22
let executedList: string[] = []
currentQuiz.commands.forEach((cmd) => {
(window as any)[cmd.name] = () => {
executedList.push(cmd.name);
return cmd.function();
};
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분을 읽어선 뭘 하고자 하는지 잘 모르겠는데 순수했던 executeCode랑 꼭 엮였어야 하나요?

Comment on lines 21 to 22
userAnswer: string[] | string;
setUserAnswer: (answer: string[] | string) => void;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기는 왜 string일 수도 있고 string[]일 수도 있나요? 타입이 나뉘면 힘들어질 텐데요.


useEffect(() => {
if (!userAnswer || !Array.isArray(userAnswer) || userAnswer.length === 0) return;
let newPos = { ...startPosition };
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기처럼 let으로 변수를 선언하고 특정 조건일 때 변수는 바꾸는 코드가 여기저기 있는데 무슨 뜻인지 잘 모르겠어요. let을 사용할 일이 보통 잘 없는데 꼭 이런 흐름을 따라야 하나요?

let newPos = { ...startPosition };
userAnswer.map((command, index) => {
setTimeout(() => {
if (command === "forward") {
if (command === 'forward') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forward, shoot 상수로 관리하시면 좋을 것 같아요.

@@ -19,8 +19,10 @@ export const Header = () => {
const parsedQuizId = parseInt(quizId || '', 10);
if (isNaN(parsedQuizId) || parsedQuizId < FIRST_QUIZ_ID) {
navigate(`/quizzes/${FIRST_QUIZ_ID}`, { replace: true });
fetchQuizData(FIRST_QUIZ_ID.toString());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이럴수가.. 데이터의 아이디를 uuid 같은 걸로 바꿔서 아이디 타입 자체를 스트링으로 관리하라는 말이었어요.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 .. 넵 확인했습니다 수정하겠습니다!

Copy link

sonarqubecloud bot commented Feb 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@nemo0824 nemo0824 merged commit 00bd6dc into main Feb 7, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants