Quiz Subject Discovery API
Use GET /api/v1/projects/{teamSlug}/{projectSlug}/quiz/{form}/subjects to build a subject picker for a subject-linked quiz. A subject is the collection entry or attendee the learner answers about. It is not a question bank, a bank slug or a list of quiz questions. This endpoint reads eligible subjects and the current attendee's attempt summaries; it does not start an attempt, submit an answer or prove the learner read documentation.
Configure the quiz and caller
Configure a quiz form with a supported subject provider and a container belonging to the same project. The reviewed built-in providers are collection entries and attendees of an attendee type. Use the form's slug in {form}, plus the owning team and project slugs. Subject IDs returned by the provider identify records, not display names or form slugs.
The route inherits project context and Sanctum authentication, but the controller additionally requires an attendee from portal authentication context or the portal guard. A reader login, administrator identity or project/page API key alone does not supply that attendee. Use the supported portal attendee authentication flow; an arbitrary attendee ID in the request does not select the learner. Do not place privileged credentials in a public documentation bundle.
The handler resolves the form within the project and verifies its quiz type and subject link. It then validates the provider/container and checks container access. These checks do not establish a new, universal form visibility policy: the reviewed handler does not explicitly filter the form by active status or project tags. Verify intended audience restrictions in the deployed portal before exposing the picker.
Retrieve subjects
A synthetic request, not executed here:
GET /api/v1/projects/example-team/example-project/quiz/product-review/subjects?per_page=25&page=1
Accept: application/json
per_page defaults to 50 and is integer-cast and clamped to 1–100. page selects the framework paginator page. The response uses subjects and meta, not the generic resource data envelope. No explicit stable sort, text search or request-level tag filter is added by this handler. Do not assume a page is the complete subject list or that its order remains stable while records change.
This synthetic response illustrates shape, not a real learner result:
{
"subjects": [
{
"subject_id": 123,
"display": "Example product",
"in_progress": false,
"attempts_used": 1,
"remaining_attempts": 2,
"completed": true,
"best_score": 8
}
],
"meta": {
"current_page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
}
}
Interpret eligibility and labels
For collections, the container must belong to the project, be active and allow the viewer. Eligible entries are scoped to that collection, optional configured subject tags and the viewer's tag visibility. Entry status is deliberately not filtered: draft entries can be subjects. Display text uses the configured field, then name, title or label, finally Entry #ID.
For attendee types, the container must belong to the project. The query selects attendees of that type, applies optional configured subject tags and can exclude the viewer when exclude_self is enabled. The reviewed provider does not add the collection provider's visibleThroughTags call. Display text uses the configured nonblank string field, then first/last name, then email or Attendee #ID. Choose a suitable public display field and review the returned labels before exposing this picker; a fallback label can contain an email address. Container access or tag filtering is not permission to expose arbitrary attendee fields.
Interpret attempt summaries
The summary uses this attendee's attempts for this form, grouped by subject model type and ID:
| Field | Meaning |
|---|---|
in_progress | At least one stored attempt has status in_progress; this is not a fresh timeout evaluation |
attempts_used | Count of completed, timed-out and abandoned attempts; in-progress attempts are excluded |
remaining_attempts | Configured nonzero maximum minus used attempts, floored at zero; null when the maximum is unset/zero |
completed | At least one completed or timed-out attempt; does not imply a pass or successful reading confirmation |
best_score | Configured counting score across completed/timed-out attempts, or null when none exist |
Despite its name, best_score is not always the maximum. The quiz's attempt scoring mode can select highest, latest by completion time, rounded average or first by attempt number. An abandoned attempt consumes a finished-attempt allowance but is excluded from scoring. An in-progress attempt can coexist with zero remaining attempts or a previous completion. Treat these fields as a stored summary, not an admission reservation: attempt-start rules and concurrent changes still need handling in the quiz workflow.
Diagnose and verify
| Result | Check |
|---|---|
| 401 | Missing attendee context, even if another authentication identity was supplied |
| 400 | The resolved form is not a quiz |
| 404 | Missing project/form, unlinked quiz, or inaccessible container; do not infer which protected record exists |
| 422 | Invalid provider or missing required subject container |
| 200 with no subjects | Container contents, provider configuration, configured tags, viewer visibility/self-exclusion and requested page |
| Unexpected score or completion | Attempt scoring mode and completed/timed-out/abandoned statuses, rather than the field name alone |
Verify a permitted and denied attendee, another project's container, empty/multiple pages, a draft collection entry, self-exclusion and display-label fallback. Compare stored attempts with each summary field, including abandonment and each scoring mode. These are deployment acceptance tasks; the documentation's structural example checks do not exercise authentication, database queries, tag privacy or scoring. Embedded documentation quizzes remain deferred, and the separate question-bank Markdown file does not call this endpoint.