log_code. Served by CertificationController::historyQuiz(). Same QuizResultResource shape as the quizzes entries of GET /api/v1/professional/certifications/{log_code}/history.{log_code} is a plain string, not route-model-bound; {quiz} stays route-model-bound by primary key. A log_code no certification carries returns 404. 403 if none of the certifications with that log_code was issued by auth()->id(), or if {quiz}'s log_code does not match the route's.App\Http\Controllers\Api\V1\Professional\CertificationController::historyQuiz()api.v1.professional.certifications.history.quizAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.GET/api/v1/professional/certifications/{log_code}/quiz/{quiz}| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Certification log code, as returned by GET /api/v1/professional/certifications |
{quiz} | integer | Quiz attempt id, as returned in quizzes[].id by the history route |
200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": {
"id": 700001,
"log_code": "5b0c7e2a91d34f6e8a1c2d3e4f506172",
"module_id": 274,
"total": 10,
"correct": 9,
"wrong": 1,
"score": 90,
"passed": true,
"date": "2020-07-25",
"start": "2020-07-25 05:50:14",
"end": "2020-07-25 05:54:10",
"questions": [
{
"id": 4567,
"text": "Example quiz question",
"missing": false,
"answers": [
{ "id": 17537, "text": "Example wrong answer", "is_correct": false, "selected": true },
{ "id": 17538, "text": "Example right answer", "is_correct": true, "selected": false }
]
}
]
}
}docs/api/diver/_resources.md -> "Quiz result".401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}message is Token expired or Invalid token when a bearer token was sent but is expired or unknown.403 Forbiddenprofessional role (role:professional middleware, body not captured), or no certification carrying that log_code was issued by the caller, or {quiz}'s log_code does not match the route's. The last two use the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Found{log_code} does not resolve to any certification, with the standard envelope:{
"success": false,
"status": "error",
"message": "Resource not found"
}{quiz} id that does not exist also returns 404, from route-model binding rather than from the controller; its body was not captured for this route.429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.is_correct flag alongside selected.log_code, not on the quiz: any quiz of a log_code the caller issued at least one certification for is readable, whoever the student is.docs/api/professional/certifications/GET_history_quiz.mdcurl --location 'https://test.diveraid.com/api/v1/professional/certifications//quiz/' \
--header 'Authorization: Bearer <token>'{
"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
}
]
}
]
}
}