Skip to content

Restore correctChoiceIndex to MCQ practice tests - #25

Merged
ehanahamed merged 1 commit into
mainfrom
restore-correct-choice-index-15426658880331694306
Jun 27, 2026
Merged

Restore correctChoiceIndex to MCQ practice tests#25
ehanahamed merged 1 commit into
mainfrom
restore-correct-choice-index-15426658880331694306

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

The user requested to restore the correctChoiceIndex field in the practice test MCQ records because its removal was premature and caused data loss potential.

Key changes:

  1. Database Migration: Edited db/migrations/202606252121_update_practice_test_questions.sql to stop removing correctChoiceIndex in the up step. Enhanced the down step to use correctChoiceIndex and answeredIndex to correctly rebuild the answeredTerm object from the distractors and the correct term.
  2. GraphQL Schema: Added correctChoiceIndex: Int! to both MCQ (query) and MCQInput (mutation) types in graph/query.graphqls and graph/mutation.graphqls.
  3. Go Code Generation: Ran go generate ./... to update graph/model/models_gen.go and other generated files.
  4. Tests: Updated tests/practice_test_test.go to include correctChoiceIndex in the test cases, ensuring the API correctly accepts and processes the new field.

The changes ensure that the MCQ structure correctly reflects the intended logic: the term is the correct answer, distractors are the wrong answers, and correctChoiceIndex specifies where to insert the correct answer into the array for display. answeredIndex remains as the user's selected index in that combined array.


PR created automatically by Jules for task 15426658880331694306 started by @ehanahamed

Modified the recent database migration and GraphQL schema to include
correctChoiceIndex for Multiple Choice Questions. This field was
previously removed, causing data loss potential. Updated the migration
down logic to correctly reconstruct answeredTerm using the preserved
index. Updated generated Go models and practice test lifecycle tests.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@ehanahamed
ehanahamed merged commit 36ed740 into main Jun 27, 2026
1 check passed
@ehanahamed
ehanahamed deleted the restore-correct-choice-index-15426658880331694306 branch June 29, 2026 21:33
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.

1 participant