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: new simple multiple choice question type #543

Merged
merged 15 commits into from
Mar 23, 2025

Conversation

Logannford
Copy link
Collaborator

@Logannford Logannford commented Mar 22, 2025

Screenshot 2025-03-23 at 13 30 54

@Logannford Logannford added App This feature is related to the app medium this feature is a medium sized feature Feature branch labels Mar 22, 2025
@Logannford Logannford requested a review from Copilot March 22, 2025 15:11
@Logannford Logannford self-assigned this Mar 22, 2025
@Logannford Logannford linked an issue Mar 22, 2025 that may be closed by this pull request
Copy link

vercel bot commented Mar 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
techblitz ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 23, 2025 3:41pm

Copy link
Contributor

@Copilot Copilot AI left a 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

@Logannford Logannford changed the title chore(questions): migrations, schema & type changes for new question … feature: new simple multiple choice question type Mar 23, 2025
@Logannford Logannford marked this pull request as ready for review March 23, 2025 15:41
@Logannford Logannford requested a review from Copilot March 23, 2025 15:41
Copy link
Contributor

@Copilot Copilot AI left a 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,

@Logannford Logannford merged commit 7495f20 into main Mar 23, 2025
2 checks passed
@Logannford Logannford deleted the feature/new-question-type---simple-multiple-choice branch March 23, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App This feature is related to the app Feature branch medium this feature is a medium sized feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] New question type - simple multiple choice
1 participant