feat(assessment): define corrective and training attempt contracts
This commit is contained in:
1 parent
fade4e76e4
commit
20c03288d6
71 files changed
+14786
-1743
No files matched your search
@@ -1,12 +1,12 @@
|
||||
post:
|
||||
operationId: CreateMyAssessmentAttempt
|
||||
summary: Start an assessment attempt for a category of the current candidate.
|
||||
summary: Start a real, corrective, or training assessment attempt.
|
||||
description: |-
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The body names the category, a specialization of the questionnaire and a target grade, and the task language. The server picks the mode from the published bank, `demo_basic` or `adaptive`, and fixes the policy, bank, and algorithm versions, the time and session limits, and the item variants in one transaction; the client never sends a mode, a seed, or a version. Creation starts session 1. The self-assessed grade only chooses where the test starts and adds no points. An adaptive retest starts from the previous ability estimate of the specialization, adjusted for the time passed, so a new attempt adds evidence instead of starting the measurement over.
|
||||
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, an allowed Origin, and an Idempotency-Key. The request is one of three disjoint shapes. A real assessment names a specialization, target grade, and task language; the server picks `demo_basic` or `adaptive` and fixes the policy, bank, and algorithm versions, limits, and item variants. A corrective real assessment also names `root_attempt_id`; the server verifies the lower-grade chain and reuses its fixed quota and deadline. The client never sends a real mode, a seed, a version, or a chain deadline. Explicit `demo_express` starts a separate interactive training run that lasts 3 to 5 minutes, has no category or target grade, and creates no qualification evidence or percentile. Creation starts session 1. The self-assessed grade only chooses where a real test starts and adds no points. An adaptive retest starts from the previous ability estimate of the specialization, adjusted for the time passed, so a new attempt adds evidence instead of starting the measurement over.
|
||||
|
||||
A specialization has at most one active attempt. A new attempt cannot start while one is active, during a retry or promotion interval or past the attempt limit of the policy, or when the bank is insufficient; each answers 409 state_conflict and creates nothing, not even a placeholder attempt. GetMyAssessmentAvailability tells which case applies and when a blocked attempt opens. After a failure, including the first test, a lower grade can be tested at once. An attempt that ends as `expired` or with the reason `practice_incomplete` counts toward the attempt limit and starts the same-grade retry interval; one that ends as `insufficient_bank` or with the reason `sandbox_unavailable` counts toward neither.
|
||||
A specialization has at most one active real attempt. A new root attempt cannot start while one is active, during a retry or promotion interval, past the root quota, or when the bank is insufficient; each such preflight refusal answers 409 state_conflict and creates nothing or consumes no root slot. Starting a root attempt reserves one slot in the root quota. A corrective attempt must reference its root, target a strictly lower grade not already attempted in that chain, and remain inside the root's fixed quota and deadline (72 hours from the root start in the current policy). It gets its own item, practice, and session limits, but spends no additional root slot and cannot reset the chain deadline or any 30/90-day timer. After a failure, including the first test, a lower grade can be tested at once. An expired or incomplete attempt does not create a free new chain; an insufficient bank or sandbox failure does not grant another root slot. `demo_express` is outside real-assessment availability, quotas, retry intervals, and qualification history.
|
||||
|
||||
The limits are server-side: `expires_at` and `sessions` come from the policy version, the client clock never extends them, and after them the attempt accepts no command. Within them the attempt is also bounded by the item limit of the policy.
|
||||
The limits are server-side: `expires_at` and `sessions` come from the policy version, the client clock never extends them, and after them the attempt accepts no work command. For a corrective attempt, `expires_at` is no later than the root's immutable `chain_deadline`. Within these limits the attempt is also bounded by the item limit of its policy.
|
||||
|
||||
Idempotency: a retry with the same key and body within 24 hours replays the stored 201 or 409 state_conflict response and creates nothing, so a lost response never creates a second attempt. A different body with the same key answers 422 idempotency_key_reused. 400 is never stored, so a corrected retry is evaluated again.
|
||||
|
||||
@@ -27,6 +27,18 @@ post:
|
||||
examples:
|
||||
backend_junior_go:
|
||||
$ref: ../components/examples.yml#/AssessmentAttemptCreateBackendJunior
|
||||
corrective_backend_junior_go:
|
||||
summary: Start a lower-grade assessment inside an existing correction chain
|
||||
value:
|
||||
kind: corrective
|
||||
specialization: backend
|
||||
target_grade: junior
|
||||
task_language: go
|
||||
root_attempt_id: 01928f7b-1111-7a2b-8c3d-4e5f6a7b8c9d
|
||||
demo_express:
|
||||
summary: Start a short educational training run
|
||||
value:
|
||||
kind: demo_express
|
||||
responses:
|
||||
"201":
|
||||
description: >-
|
||||
@@ -42,6 +54,10 @@ post:
|
||||
examples:
|
||||
demo_basic_created:
|
||||
$ref: ../components/examples.yml#/AssessmentAttemptCreated
|
||||
corrective_created:
|
||||
$ref: ../components/examples.yml#/AssessmentCorrectiveAttemptCreated
|
||||
demo_express_created:
|
||||
$ref: ../components/examples.yml#/AssessmentExpressAttemptCreated
|
||||
"400":
|
||||
$ref: ../components/responses.yml#/AssessmentAttemptCreateValidationFailed
|
||||
"401":
|
||||
|
||||
Reference in new issue
Block a user