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

Polymorphic Exercises #372

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open

Polymorphic Exercises #372

wants to merge 22 commits into from

Conversation

LeonWehrhahn
Copy link
Contributor

@LeonWehrhahn LeonWehrhahn commented Dec 6, 2024

Motivation and Context

This PR refactors the database structure to resolve a limitation with referencing different exercise types from general tables. While not a past problem, the addition of general tables like structured_grading_instructions introduces following issue: Without a general exercises table, referencing exercises from such tables would be cumbersome. Potential solutions, such as using separate foreign keys for each exercise type (e.g., exercise_modeling_id, exercise_programming_id), creating multiple structured grading tables, or relying solely on hashing without direct database references, are not ideal and lead to redundancy and maintenance challenges.

Description

The exercise database structure is refactored to utilize SQLAlchemy's polymorphic inheritance. A general exercises table now serves as the base, storing common attributes and establishing a parent-child relationship with type-specific tables (e.g., modeling_exercises). This change allows the creation of general tables, such as structured_grading_instructions, that can now reference exercises generically.

Steps for Testing

Verify that exercise persisting for all types is still working.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.


Screenshots

LeonWehrhahn and others added 19 commits November 16, 2024 19:30
…tionships; fix foreign key references and ensure proper inheritance structure.
…remove debug prints, update caching logic, and change serialization method for structured grading instructions
@LeonWehrhahn LeonWehrhahn changed the title Polymorphic Exercises and Persistent Grading Instructions Polymorphic Exercises Dec 7, 2024
@LeonWehrhahn LeonWehrhahn added the deploy:athena-test1 Athena Test Server 1 label Jan 11, 2025
@LeonWehrhahn LeonWehrhahn temporarily deployed to athena-test1.ase.cit.tum.de January 11, 2025 14:36 — with GitHub Actions Inactive
@github-actions github-actions bot added lock:athena-test1 Is currently deployed to Athena Test Server 1 and removed deploy:athena-test1 Athena Test Server 1 labels Jan 11, 2025
@LeonWehrhahn LeonWehrhahn removed the lock:athena-test1 Is currently deployed to Athena Test Server 1 label Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

1 participant