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

퀴즈 솔루션 탭 #54

Merged
merged 9 commits into from
Dec 29, 2023
Merged

퀴즈 솔루션 탭 #54

merged 9 commits into from
Dec 29, 2023

Conversation

bbearcookie
Copy link
Member

@bbearcookie bbearcookie commented Dec 28, 2023

🧩 이슈 번호

✅ 작업 사항

퀴즈 관련 페이지 탭

  • 퀴즈, 질문, 솔루션 페이지에서 사용하는 탭을 동일하게 했어요.
    • 따라서, 기존에 임의로 구분했던 Route Group은 제거했어요.
  • Link 컴포넌트에 replace 속성을 추가해서 뒤로가기 페이지가 대체되도록 했어요.
    • (@hyoribogo 님이 제안해주신 내용 적용)

QuizSubmission 관련 Service 로직 분리

  • 기존에는 Quiz 디렉토리에 함께 존재했었는데요, 작업 하다 보니 특정 사용자의 모든 제출을 가져오거나, 특정 사용자의 특정 퀴즈의 제출 정보를 가져오는 등 퀴즈보다는 제출이 핵심이라는 생각이 들었어요.
  • 그래서 다른 디렉토리로 분리했는데, 내부에 존재하는 함수의 이름인 getSubmissionsOfUser, getSubmissionOfUser 라는 것에서 혼동이 올 수 있을 것 같긴 한데 좋은 이름이 아직 생각이 안나네요..

솔루션 페이지

솔루션 페이지에서 퀴즈 제출 정보를 가져온 뒤, 맞췄을 경우에만 정답을 보여주는 조건부 렌더링 로직을 추가했어요.

그런데.. 이 부분에서 분기 처리가 들어가다보니 Page 컴포넌트의 역할이 늘어나는 것 같기도 하고.. 선언적으로 관리할 좋은 방법이 있을지는 고민이 돼요.

👩‍💻 공유 포인트 및 논의 사항

GOMCAM.20231228_1905290472.mp4

@bbearcookie bbearcookie added 기능 기능을 추가합니다. 리팩토링 리팩토링을 진행합니다. labels Dec 28, 2023
@bbearcookie bbearcookie self-assigned this Dec 28, 2023
Copy link
Member

@jgjgill jgjgill left a comment

Choose a reason for hiding this comment

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

저도 작업하면서 quiz가 점점 방대해지는 느낌을 받았는데요.
쪼갤 필요성을 느꼈는데 먼저 해주셨네요..! 🙇‍♂️

솔루션 페이지같은 경우는 지금이 최선인 것 같군요.. 더 좋은 방법이 있을 수도 있을 저도 모르겠네요.. 😇
혹은 아예 접근 자체를 막아버리는 방법? 근데 지금도 괜찮은 것 같아요!

queryFn: () => quizSubmissionAPI.getSubmissionsOfUser(userId),
}),

detailByQuiz: (userId: string, quizId: number) => ({
Copy link
Member

Choose a reason for hiding this comment

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

p5: 여태까지 네이밍으로는 By 대신 Of를 많이 쓴 것 같아요..! detailOfQuiz

Comment on lines +7 to +11
all: (userId: string) =>
queryOptions({
queryKey: [...quizSubmissionOptions.default, userId],
queryFn: () => quizSubmissionAPI.getSubmissionsOfUser(userId),
}),
Copy link
Member

Choose a reason for hiding this comment

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

네넵..! 저도 이부분에서 네이밍에서 혼동이 올 수 있겠다는 생각이 드네요.. 항상 어려운 부분이죠.
getSubmissionsOfUser에서도 헷갈릴 수도 있고 저는 all이랑도 직관적으로 연결되지는 않는다는 느낌을 받네요.

그래서 저도 곰곰이 생각해봤는데 지금은 마땅히 떠오르지 않네요.. 😂 우선 이러한 형태로 사용해보죠..!
네이밍 부분에서 저희만의 규칙을 만들어서 기준을 세우면 괜찮을 것 같기도 합니다!

@bbearcookie bbearcookie merged commit 4be0479 into main Dec 29, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
기능 기능을 추가합니다. 리팩토링 리팩토링을 진행합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

퀴즈 솔루션 탭 추가 및 컨텐츠 접근 제한
2 participants