Quiz record. Served by FreeLearningController::submitQuiz(). Same scoring mechanics as docs/api/diver/courses/POST_quiz_submit.md with one difference: no course_version check (free_learnings carries no such column) - see Notes for the {module}/course match check, which this endpoint does have.App\Http\Controllers\Api\V1\Diver\FreeLearningController::submitQuiz()api.v1.diver.free-learnings.quiz.submitAuthorization: Bearer {token}POST/api/v1/diver/free-learnings/{log_code}/modules/{module}/quizapplication/json| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Opaque free learning log code, owned by the authenticated diver |
{module} | integer | Module id, route-model-bound. Checked against the free learning's course_id (not its version, which this model has no column for) - see Notes |
docs/api/diver/courses/POST_quiz_submit.md's body: answers ({questionId: answerId}), start, end. Validated by the same SubmitQuizRequest - full envelope 422.201 Created{
"success": true,
"status": "success",
"message": "Quiz submitted successfully",
"data": {
"id": 1582847,
"log_code": "9be9084934f36b03bbbb70c38acb9d50",
"module_id": 548,
"total": 5,
"correct": 2,
"wrong": 3,
"score": 40,
"passed": false,
"date": "2026-09-17",
"start": "2026-09-17 14:00:00",
"end": "2026-09-17 14:05:00",
"questions": [
{
"id": 7954,
"text": "Why does ice float?",
"missing": false,
"answers": [
{ "id": 30829, "text": "Because water cannot be displaced.", "is_correct": false, "selected": false },
{ "id": 30830, "text": "Because it expands during the freezing process and changes its physical characteristics and traps some air in the ice.", "is_correct": true, "selected": false }
]
}
]
}
}QuizResultResource shape - see _resources.md → "Quiz result".401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}403 Forbidden - module/free learning mismatch{module} does not belong to the same course as the free learning ($module->course_id !== $log->course_id).{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Found - free learning not found{log_code} does not resolve to a free learning owned by the authenticated user. Resolved manually, so only reached after route-model binding for {module} has already succeeded.{
"message": "No query results for model [App\\Models\\CourseLog\\FreeLearning]."
}404 Not Found - module not found{module} is route-model-bound and 404s before the controller body runs, with the id included - same mechanism as docs/api/diver/courses/POST_quiz_submit.md.{
"message": "No query results for model [App\\Models\\Courses\\Module] 999999999"
}409 Conflict - attempt already submittedstart was already submitted for this log and module: the same attempt sent twice, for example a retry. Nothing is written. Another attempt, with a different start, is always accepted: there is no limit on the number of attempts.{
"success": false,
"status": "error",
"message": "Attempt already submitted."
}422 Unprocessable Entity - validationdocs/api/diver/courses/POST_quiz_submit.md's 422 - same SubmitQuizRequest class, not re-captured separately.Quiz row. No mail is queued (unlike the courses equivalent, which emails on full completion).{module} is checked against the free learning's course_id, not its version (app/Http/Controllers/Api/V1/Diver/FreeLearningController.php:90-94): if ($module->course_id !== $log->course_id) return $this->forbidden();, with a comment recording that the version half of the courses-controller check is intentionally absent because free_learnings has no course_version column. This 403 Forbidden is documented in the Errors section of this file and declared for this operation in docs/api/raid-api-v1.json.403 as docs/api/diver/courses/POST_quiz_submit.md.docs/api/diver/free-learnings/POST_quiz_submit.mdcurl --location 'https://test.diveraid.com/api/v1/diver/free-learnings//modules//quiz' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"answers": {
"property1": 0,
"property2": 0
},
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z"
}'{
"status": "success",
"message": "string",
"data": {
"id": 0,
"log_code": "string",
"module_id": 0,
"total": 0,
"correct": 0,
"wrong": 0,
"score": 0,
"passed": true,
"date": "2019-08-24",
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"questions": [
{
"id": 0,
"text": "string",
"missing": true,
"answers": [
{
"id": 0,
"text": "string",
"is_correct": true,
"selected": true
}
]
}
]
}
}