Skip to content

test#1

Closed
richardebeling wants to merge 13 commits intorichardebeling:mainfrom
Kakadus:combined-questions
Closed

test#1
richardebeling wants to merge 13 commits intorichardebeling:mainfrom
Kakadus:combined-questions

Conversation

@richardebeling
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

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 performs a significant database schema refactoring to enable Question reuse across multiple Questionnaires. Previously, Questions had a direct ForeignKey relationship to a single Questionnaire. Now, Questions are related to Questionnaires through a many-to-many relationship implemented via a new QuestionAssignment model. This allows the same Question to be used in multiple Questionnaires while maintaining separate ordering and assignment metadata per questionnaire.

Changes:

  • Introduced QuestionAssignment model as a through table for Question-Questionnaire many-to-many relationship
  • Updated Answer models (TextAnswer, RatingAnswerCounter) to reference QuestionAssignment instead of Question directly
  • Modified all forms, views, templates, and tests to work with the new structure
  • Added two-step Django migrations to transition from the old to new schema
  • Updated prefetch_related queries throughout the codebase for the new relationship structure

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
evap/evaluation/models.py Added QuestionAssignment model, converted Question to use many-to-many relationship, updated Answer models to reference assignment
evap/evaluation/migrations/0160_*.py Forward migration creating QuestionAssignment and deduplicating questions
evap/evaluation/migrations/0161_*.py Completes migration by removing old Question model
evap/student/views.py Updated vote view to iterate over question_assignments instead of questions
evap/staff/views.py Updated questionnaire management views to use QuestionAssignmentForm
evap/staff/forms.py Added QuestionAssignmentForm with nested QuestionForm, implemented copy-on-write for shared questions
evap/staff/templates/staff_questionnaire_form.html Updated template to render nested question_form fields
evap/results/tools.py Updated result calculation to work with assignments
evap/student/tests/test_views.py Updated tests to use QuestionAssignment instead of Question
evap/staff/tests/test_views.py Updated tests to create QuestionAssignments, added tests for question editing behavior
evap/staff/tests/test_forms.py Updated form tests to use QuestionAssignment
evap/results/tests/*.py Updated all result tests to use QuestionAssignment
evap/evaluation/tests/*.py Updated model and command tests
evap/evaluation/management/commands/anonymize.py Updated to work with assignments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread evap/evaluation/models.py Outdated
Comment thread evap/student/views.py
Comment thread evap/evaluation/models.py
Comment thread evap/staff/tests/test_views.py
Comment thread evap/staff/templates/staff_questionnaire_form.html
Comment thread evap/staff/forms.py
Comment thread evap/evaluation/migrations/0160_temporary_newquestion_relation.py
Comment thread evap/results/tools.py
Comment thread evap/staff/views.py
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