is_correct flag and whether the student selected it. Served by ClassroomController::studentExam().App\Http\Controllers\Api\V1\Professional\ClassroomController::studentExam()api.v1.professional.classroom.student.examAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.GET/api/v1/professional/classroom/students/{log_code}/exam/{exam}| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Course log code of a student, as returned by GET /api/v1/professional/classroom/{classroom}. Not a primary key |
{exam} | integer | Exam attempt id, the id of an entry of data.exams in GET /api/v1/professional/classroom/students/{log_code}. Bound by route-model binding |
200 OK{
"success": true,
"status": "success",
"message": "OK",
"data": {
"id": 920001,
"log_code": "5b8e2f0a9c1d4e7a83b6c2d1e0f49a37",
"total": 15,
"correct": 11,
"wrong": 4,
"score": 73,
"passed": false,
"date": "2025-01-12",
"start": "2025-01-12 18:38:16",
"end": "2025-01-12 18:48:06",
"questions": [
{
"id": 6002,
"text": "Example question?",
"missing": false,
"answers": [
{ "id": 24003, "text": "Example answer one", "is_correct": true, "selected": false },
{ "id": 24004, "text": "Example answer two", "is_correct": false, "selected": true }
]
}
]
}
}data is an ExamResultResource. It has the same shape as a quiz attempt, without module_id.| Field | Type | Nullable | Always present | Description |
|---|---|---|---|---|
data.id | integer | No | Yes | Exam attempt id |
data.log_code | string(32) | No | Yes | Course log code |
data.total | integer | No | Yes | Number of questions |
data.correct | integer | No | Yes | Correct answers |
data.wrong | integer | No | Yes | Wrong answers |
data.score | number | No | Yes | Score, rounded to 2 decimals. Integral values serialize without a decimal part (73) |
data.passed | boolean | No | Yes | Whether the attempt passed |
data.date | string | Yes | Yes | YYYY-MM-DD |
data.start | string | Yes | Yes | YYYY-MM-DD HH:MM:SS |
data.end | string | Yes | Yes | YYYY-MM-DD HH:MM:SS |
data.questions[].id | integer | No | Yes | Question id |
data.questions[].text | string | No | Yes | Question text; for a missing question, a "no longer available" text in the caller's language |
data.questions[].missing | boolean | No | Yes | true when the question no longer exists in the question bank: it keeps its place in the attempt, with answers empty |
data.questions[].answers[].id | integer | No | Yes | Answer id |
data.questions[].answers[].text | string | No | Yes | Answer text |
data.questions[].answers[].is_correct | boolean | No | Yes | Whether the answer is the correct one |
data.questions[].answers[].selected | boolean | No | Yes | Whether the student picked it |
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); no course log with that log_code belongs to a classroom of the caller, or that log_code does not exist; or the exam belongs to another log_code. The last two use the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}404 Not Found{exam} id that does not exist returns 404 from route-model binding, before the controller runs. The 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 answers 403, not 404; an unknown {exam} answers 404, evaluated before the ownership check.docs/api/professional/classroom/GET_student_exam.mdcurl --location 'https://test.diveraid.com/api/v1/professional/classroom/students//exam/' \
--header 'Authorization: Bearer <token>'{
"status": "success",
"message": "string",
"data": {
"id": 0,
"log_code": "string",
"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
}
]
}
]
}
}