Checklist: Evaluations API (MVP)
This checklist outlines the step-by-step implementation of the MVP for the Evaluations API. Each step builds upon the last and includes the creation of a corresponding .sh file to test the new functionality.
Step 0: Preparation & Refactoring
- Task: Remove the
//go:build ignoretag frombackend/internal/http/handler/evaluation.goto enable the API. - Task: Refactor the existing
evaluation.gocode. Create a newservices/evaluation_service.goandrepositories/evaluation_repository.go, following the same clean architecture as the Questions feature. - Test: The backend server should compile and run without errors after this refactoring.
Step 1: Core Evaluation CRUD
- Task: Implement the basic Create, Read, Update, Delete endpoints for the parent
evaluationsobject.POST /api/v1/evaluationsGET /api/v1/evaluationsGET /api/v1/evaluations/\{id\}PATCH /api/v1/evaluations/\{id\}DELETE /api/v1/evaluations/\{id\}
- Test Script: Create
backend/evaluations_crud.shto test these core endpoints.
Step 2: Evaluation Versioning
- Task: Implement endpoints to manage versions of an evaluation. The evaluation's actual content will be tied to a version.
POST /api/v1/evaluations/\{id\}/versionsGET /api/v1/evaluations/\{id\}/versionsPOST /api/v1/evaluations/\{id\}/publish(to set the active version).
- Test Script: Extend
backend/evaluations_crud.shto test creating and publishing versions.
Step 3: Evaluation Sections
- Task: Implement endpoints to add, view, and manage ordered sections within an evaluation version.
POST /api/v1/evaluation-versions/\{versionId\}/sectionsGET /api/v1/evaluation-versions/\{versionId\}/sectionsPATCH /api/v1/sections/{sectionId}DELETE /api/v1/sections/{sectionId}
- Test Script: Create
backend/evaluations_sections.shto test section management.
Step 4: Adding Questions to Sections
- Task: Implement the ability to add specific questions to a section.
POST /api/v1/sections/{sectionId}/items(to add aquestion_version_idto a section).GET /api/v1/sections/{sectionId}/itemsPATCH /api/v1/items/\{itemId\}(to reorder).DELETE /api/v1/items/\{itemId\}.
- Test Script: Extend
backend/evaluations_sections.shto test adding and reordering questions.
Step 5: Smart Buckets
- Task: Implement the backend logic for creating and managing "smart buckets".
POST /api/v1/buckets(to create a bucket with tag filters, selection mode, etc.).GET /api/v1/buckets/{bucketId}PATCH /api/v1/buckets/{bucketId}- Update
POST /api/v1/sections/{sectionId}/itemsto also support adding abucket_id.
- Test Script: Create
backend/evaluations_buckets.shto test creating buckets and adding them to sections.
Step 6: Evaluation Preview Endpoint
- Task: Implement the
POST /api/v1/evaluations/\{id\}/previewendpoint. This is a crucial, read-only endpoint that will resolve all the smart buckets into a concrete list of questions, simulating what a candidate would see. - Test Script: Create
backend/tests/evaluations_preview.shto test that the preview logic correctly assembles an evaluation based on its rules.
Step 7: Passage Blocks & Bucket Dry Run
- Task: Expose passage CRUD plus
/passages/\{id\}/questionsso sections can add passage blocks that bring their ordered question list. - Task: Add
POST /api/v1/buckets/\{id\}/previewto dry-run a bucket draw (seeded, warnings/shortfall surfaced). - Test Script: Extend
backend/tests/evaluations_preview.shandevaluations_buckets.shto cover passage items and bucket dry-run responses.
Step 8: Evaluation Preflight Validation
- Task: Add
POST /api/v1/evaluations/\{id\}/validateto aggregate bucket/passage warnings before publish and return a structured report. - Task: Block
POST /publishunless validation returns zero warnings (422 with warning list). - Test Script: Create
backend/tests/evaluations_validate.shto exercise the validation endpoint end-to-end.