β¨ Feature Description
Allow admins to edit an existing coding quest via a PUT /api/quests/<quest_id> endpoint. All mutable fields can be updated while immutable metadata (id, created_at, quest_author) is preserved.
π§© Problem Statement
There is currently no way to update a quest once it has been created. Admins need the ability to fix errors in quest content, adjust difficulty, or update test inputs/outputs without having to delete and recreate the quest.
π‘ Proposed Solution
Add a PUT /api/quests/<quest_id> endpoint accessible only by the admins. The route validates the payload and persists the changes. Only fields present in the request body are updated (partial update support).
Mutable Fields
language = db.Column(db.String(50), nullable=False)
difficulty = db.Column(db.String(50), nullable=False)
quest_name = db.Column(db.String(255), nullable=False)
condition = db.Column(db.Text, nullable=False)
function_template = db.Column(db.Text, nullable=False)
# Inputs (input_0 is the null/edge-case test)
input_0 β¦ input_9 = db.Column(db.Text, nullable=True)
# Outputs (output_0 is the null/edge-case test)
output_0 β¦ output_9 = db.Column(db.Text, nullable=True)
example_solution = db.Column(db.Text, nullable=True)
Immutable Fields
id # Primary key β never editable
created_at # Set on creation β never editable
quest_author # Original quest author β never editable
Error Responses
| Status |
Scenario |
400 |
Validation failure β missing/invalid required field |
403 |
Requester is not an admin |
404 |
No quest found for the given quest_id |
π Alternatives Considered
π Acceptance Criteria
π Related Issues / Links
π Additional Context
solved_times is intentionally excluded from the edit endpoint β it is managed by the quest-solve flow, not manual edits.
β¨ Feature Description
Allow admins to edit an existing coding quest via a
PUT /api/quests/<quest_id>endpoint. All mutable fields can be updated while immutable metadata (id,created_at,quest_author) is preserved.π§© Problem Statement
There is currently no way to update a quest once it has been created. Admins need the ability to fix errors in quest content, adjust difficulty, or update test inputs/outputs without having to delete and recreate the quest.
π‘ Proposed Solution
Add a
PUT /api/quests/<quest_id>endpoint accessible only by the admins. The route validates the payload and persists the changes. Only fields present in the request body are updated (partial update support).Mutable Fields
Immutable Fields
Error Responses
400403404quest_idπ Alternatives Considered
PUT /api/quests/<quest_id>endpoint exists and is accessible only to adminsid,created_at, andquest_authorare immutable and cannot be modifiedupdated_atis automatically refreshed on every successful edit400 Bad Requestwith descriptive errors404 Not Found403 Forbiddenπ Acceptance Criteria
π Related Issues / Links
π Additional Context
solved_timesis intentionally excluded from the edit endpoint β it is managed by the quest-solve flow, not manual edits.