Skip to content

Conversation

@ShanaLMoore
Copy link
Contributor

@ShanaLMoore ShanaLMoore commented Jan 20, 2026

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

  • Scenario (order 0)
  • Multiple Choice (order 1)
  • Select All That Apply with chest-xray.jpg (order 2)
  • Scenario (order 3)
  • Drag and Drop (order 4)
  • Matching (order 5)

Case Study 2 (IMPORT_ID 8): Neurological Assessment

  • Scenario (order 0)
  • Bow Tie (order 1)
  • Scenario (order 2)
  • Multiple Choice with brain-ct.jpg (order 3)
  • Categorization (order 4)
  • Essay (order 5)

run rails db:seed for the following results: (imports 2)

image

Replace hardcoded Stimulus Case Study questions in seeds.rb with CSV import from stimulus_case_study_questions.csv
Copy link

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 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.csv containing 14 rows of question data for two case studies
  • Modified the seeding approach to use zip_files helper 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.

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

Test Results

139 tests  ±0   139 ✅ ±0   0s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 94c236f. ± Comparison against base commit 580e1d5.

♻️ This comment has been updated with latest results.

- 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
@ShanaLMoore ShanaLMoore requested a review from Copilot January 20, 2026 19:41
@ShanaLMoore ShanaLMoore marked this pull request as draft January 20, 2026 19:42
@ShanaLMoore ShanaLMoore force-pushed the update-seeds-stimilus-case-study-csv branch from 4f53c6b to 3f1b087 Compare January 20, 2026 19:51
Copy link

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

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.

Copy link

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

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
Copy link
Member

@laritakr laritakr left a 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.

@ShanaLMoore ShanaLMoore marked this pull request as ready for review January 20, 2026 21:34
@ShanaLMoore ShanaLMoore merged commit ffb1578 into main Jan 20, 2026
11 checks passed
@ShanaLMoore ShanaLMoore deleted the update-seeds-stimilus-case-study-csv branch January 20, 2026 21:34
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.

3 participants