feat: Sprint 3 — test editing with versioning
Backend:
- migration 003: add parent_id to tests table
- PUT /api/tests/{id}: edit in place if no attempts, create new version otherwise
- GET /api/tests: show only latest versions (no successor)
Frontend:
- TestForm: extracted reusable form component
- TestCreate: refactored to use TestForm
- TestEdit: full edit mode with pre-populated form, version redirect on new version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -65,12 +65,18 @@ class TestOut(BaseModel):
|
||||
allow_navigation_back: bool
|
||||
is_active: bool
|
||||
version: int
|
||||
parent_id: Optional[int]
|
||||
created_at: datetime
|
||||
questions: list[QuestionOut] = []
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class TestUpdateResponse(BaseModel):
|
||||
test: TestOut
|
||||
is_new_version: bool
|
||||
|
||||
|
||||
class TestListItem(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
|
||||
Reference in New Issue
Block a user