DEV: add expert assignment analytics and evaluation drilldown - #724
Merged
Merged
Conversation
TThanos3000
marked this pull request as ready for review
September 5, 2026 10:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
evaluation_status.assignments.total/pending/evaluatedand the invarianttotal = pending + evaluated. Distributed project status now counts completed assignments; open project evaluation keeps its existing any-score behavior.API
GET /programs/<program_id>/manager-overview/assignments/?scope=all|completed|pendingGET /programs/<program_id>/manager-overview/assignments/<assignment_id>/scores/attention.delayed_expertswithout removing existing fields.can_manage_programaccess as overview: manager/staff/superuser only. Anonymous 401, other authenticated users (including expert-only) 403; foreign-program assignment 404. Invalid/empty scope 400; write methods 405.not_ready,pending,in_progress,completed. All current-program criteria count, including the existing automatically created Comment criterion.is_scored.Audit / implementation
The previous
_get_assignment_metricsusedExists(ProjectScore); one score completed an assignment. Now a shared read-only service uses DISTINCT current-program criteria for the assigned expert user and project. No model, signal, score writing or project submission changes.Waiting is
max(project submission timestamp, assignment creation timestamp). Missing legacy submission timestamps produce null waiting and no invented SLA delay. Completed/not-ready assignments have null waiting.One assignment SELECT with JOINs and subqueries supplies user/project data and progress. Overview reuses it for project metrics and SLA. Query regression from 1 to 31 assignments: list 3 SQL, overview 10 SQL, scores 5 SQL (pre-authenticated manager; auth may add its own queries).
Verification
checkandcheck --tag models: passed.makemigrations --check --dry-run: no changes detected.git diff --check: passed.feed.tests.test_feed_api.FeedAPITests.test_feed_returns_project_news_as_news_content; the same intermittent failure was reproduced in a clean detached worktree at base SHA95009d41731c740b12e6839199cfb9de2338655c(single run passed, repeated run failed). No feed changes were made. SQLite teardown also encountered Windows file locking. Both authoritative Linux full-suite runs above are green.Local Windows caveat: native Pango is unavailable, so local Django tests/checks use the pre-existing external WeasyPrint import stub; no application or test-runner code changed. Linux CI uses real WeasyPrint. Repository-wide local flake8 5 on Python 3.12 reports pre-existing f-string tokenization errors in unchanged files; the standard GitHub lint job uses Python 3.11.
Scope
Backend analytics only, based on dev
95009d41731c740b12e6839199cfb9de2338655c.No migrations/models, Angular, React, auth/profile/region/vacancy behavior, notifications, API scoring changes, workflows, Docker or deploy changes.
Draft. Do not merge or deploy.