-
Notifications
You must be signed in to change notification settings - Fork 0
🧹 Convert Stimulus Case Study questions to CSV format #537
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
Conversation
Replace hardcoded Stimulus Case Study questions in seeds.rb with CSV import from stimulus_case_study_questions.csv
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 converts hardcoded Stimulus Case Study questions in seeds.rb to a CSV-based import format. The intention is to improve maintainability by externalizing question data from Ruby code to a CSV file that can be imported along with associated images via a ZIP file.
Changes:
- Replaced ~290 lines of hardcoded Ruby objects for two stimulus case studies with a 9-line CSV import implementation
- Created new CSV file
stimulus_case_study_questions.csvcontaining 14 rows of question data for two case studies - Modified the seeding approach to use
zip_fileshelper with two image files (chest-xray.jpg and brain-ct.jpg)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| db/seeds.rb | Replaced hardcoded stimulus case study question creation with CSV import using zip_files helper |
| db/seed_csvs/stimulus_case_study_questions.csv | New CSV file containing question data for two case studies (Respiratory Distress and Neurological Assessment) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use block form for all File.open calls to ensure proper file handle closure - Replace File.delete with FileUtils.rm_f for safer cleanup - Add documentation to zip_files helper method - Addresses Copilot review concerns about resource leaks
4f53c6b to
3f1b087
Compare
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
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Restore complete scenario texts and answer details from original seed script - Fix column count from 45 to 42 columns to match export format - Resolve CORRECT_ANSWERS parsing errors by ensuring proper column alignment - Add missing 'Normal findings' option to Select All That Apply question
laritakr
left a comment
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.
This looks great and worked for me.
Replace hardcoded Stimulus Case Study questions in seeds.rb with CSV import from stimulus_case_study_questions.csv
The structure is:
Case Study 1 (IMPORT_ID 1): Respiratory Distress
Case Study 2 (IMPORT_ID 8): Neurological Assessment
run
rails db:seedfor the following results: (imports 2)