-
Notifications
You must be signed in to change notification settings - Fork 33
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: new simple multiple choice question type #543
feature: new simple multiple choice question type #543
Conversation
Logannford
commented
Mar 22, 2025
•
edited
Loading
edited

The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new question type, SIMPLE_MULTIPLE_CHOICE, to the QuestionType definition and updates component properties accordingly.
- Added the new SIMPLE_MULTIPLE_CHOICE option in the QuestionType union.
- Updated the question-carousel-list component to use the unified QuestionType instead of an inline type definition.
Reviewed Changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/types/Questions.ts | Added the new 'SIMPLE_MULTIPLE_CHOICE' option for question types. |
src/components/app/questions/layout/carousel/question-carousel-list.tsx | Replaced inline type definition with imported QuestionType for consistency. |
Files not reviewed (3)
- prisma/migrations/20250321214136_adds_simple_multiple_choice_question_type/migration.sql: Language not supported
- prisma/migrations/20250322150258_adds_after_question_info_field_to_question_type/migration.sql: Language not supported
- prisma/schema/questions.prisma: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces a new simple multiple choice question type, updating both the UI components and backend logic to support the new question type. Key changes include additions to Storybook for the new feedback banner and card components, updates in question form and admin pages for the new type, and adjustments in back‐end question/answer handling logic.
Reviewed Changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/components/app/questions/multiple-choice/feedback-banner.stories.tsx | Added Storybook stories for the feedback banner. |
src/components/app/questions/multiple-choice/footer.tsx | Created a footer component for multiple choice questions with conditional rendering. |
src/components/app/questions/multiple-choice/feedback-banner.tsx | Implemented a feedback banner with animations for correct/incorrect submissions. |
src/components/app/questions/multiple-choice/card.tsx | Developed a question card with animated feedback and selection logic. |
src/components/app/questions/multiple-choice/card.stories.tsx, layout.stories.tsx, layout.tsx, layout.client.tsx | Provided Storybook stories and layout components for rendering multiple choice questions. |
src/components/app/questions/admin/question-form.tsx | Updated the admin question form to support “afterQuestionInfo” and a new question type option. |
src/actions/answers/answer.ts | Adjusted answer submission logic by removing the userUid parameter and adding a mock answer for development. |
src/actions/questions/add.ts, update-question.ts | Updated question creation/updating to include “afterQuestionInfo” and new question type. |
src/app/(questions)/question/[slug]/page.tsx | Integrated the new SIMPLE_MULTIPLE_CHOICE layout and next/previous question navigation. |
src/components/app/onboarding/onboarding-initial-questions.tsx | Updated onboarding to utilize the new MultipleChoiceCard component. |
src/app/(questions)/question/[slug]/layout.tsx, src/app/(app)/admin/questions/page.tsx, src/components/app/questions/layout/carousel/question-carousel-list.tsx | Minor adjustments to support updated question types and navigation. |
Files not reviewed (3)
- prisma/migrations/20250321214136_adds_simple_multiple_choice_question_type/migration.sql: Language not supported
- prisma/migrations/20250322150258_adds_after_question_info_field_to_question_type/migration.sql: Language not supported
- prisma/schema/questions.prisma: Language not supported
Comments suppressed due to low confidence (2)
src/app/(questions)/question/[slug]/page.tsx:90
- [nitpick] Consider using a constant or enum value from the QuestionType instead of a hardcoded string ('SIMPLE_MULTIPLE_CHOICE') to improve consistency and reduce potential typos.
if (question.questionType === 'SIMPLE_MULTIPLE_CHOICE') {
src/actions/answers/answer.ts:18
- The removal of 'userUid' from the AnswerQuestionInput interface means user retrieval now relies on getUser(). Ensure that all code consuming answerQuestion is updated accordingly to avoid unexpected issues.
userUid: string,