RAID API
  1. Renewals
  • DiveRAID frontend public API
    • Search divers
      POST
    • Search instructors
      POST
    • Search dive centers
      POST
    • Search dive centers by country
      GET
  • DiveRAID rest API V1
    • Auth
      • Register a new user
      • Login and get a Sanctum token
      • Send password reset email
      • Reset password using token
      • Logout and revoke the current token
      • Resend email verification
      • Complete a two-factor login and get a Sanctum token
    • Profile
      • The user resource
      • Get authenticated user profile
      • Update profile
      • Register push token
      • Update password
      • Remove push token
      • Rotate exam unlock code
      • Delete account
      • Update dive center association
    • Diver
      • Shared diver resources
      • Courses
        • List active courses
        • Get exam result
        • Submit course exam
        • Sign skills (diver)
        • Get course detail
        • Submit module quiz
        • List expired courses
        • Get quiz result
        • Get skills progress
      • Free Learnings
        • List enrolled free learnings
        • Get free learning quiz result
        • List available free learning courses
        • Submit free learning module quiz
        • Get free learning detail
        • Enroll in a free learning course
      • Certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
        • List diver certifications
      • Dive Logs
        • Delete dive log
        • Create dive log
        • Update dive log
        • List loggable courses
        • List dive logs (paginated)
        • Get dive log
      • Awards
        • List the recognition cards issued to the user
      • Documents
        • Upload own medical certificate or insurance
        • List own medical certificates and insurance
        • List diver documents
      • Forms
        • List diver forms
      • Medical
        • Get medical questionnaire structure
        • Submit medical questionnaire
      • Store
        • List courses available for purchase
        • Get order status
    • Professional
      • Students
        • List students
        • Get student progress
        • Sign student skills
        • Get student exam result
        • Get student quiz result
        • Get student skills progress
      • Certifications
        • Get certification history
        • Get certification quiz result
        • Get certification exam result
        • Get certification skills
        • List all professional certifications
        • List diver-level certifications
        • List examiner certifications
        • List professional certifications
        • List specialty certifications
        • List trainer certifications
      • Classroom
        • List classrooms
        • Get classroom progress (all students)
        • Get classroom student progress
        • Sign classroom student skills
        • Get classroom student exam result
        • Get classroom student quiz result
        • Get classroom student skills
      • Renewals
        • List renewal courses
          GET
        • Get renewal exam result
          GET
        • Submit renewal exam
          POST
        • Sign renewal skills
          POST
        • Renewal status
          GET
        • Get renewal progress
          GET
        • Submit renewal module quiz
          POST
        • Get renewal quiz result
          GET
        • Get renewal skills progress
          GET
      • Dive Logs
        • Get student dive log
        • Sign student dive log
        • List student dive logs for a course
    • Sync
      • Download full course data for offline use
      • Upload offline operations
      • Get sync status
    • Public
      • List all countries
      • Dive-log enum values with labels in the response language
      • Get country data
      • Get country divisions (states/provinces)
      • List time zone identifiers, optionally narrowed to one country
      • List, search, and radius-search publicly visible dive centres
      • Every publicly visible, geolocated dive centre as a map marker
      • Countries with at least one publicly visible dive centre
      • Full detail of one publicly visible dive centre
    • Library
      • List the RAID document library
      • List the current RAID standards
  • Schemas
    • Frontend API Schema
      • DiverSearch
    • SuccessResponse
    • DiverCertification
    • ValidationErrorResponse
    • TwoFactorChallengeResponse
    • TokenResponse
    • IssuedCertification
    • ErrorResponse
    • DiveLog
    • ExamResult
    • QuizResult
    • CourseLogDetail
    • CourseLog
    • UserProfile
    • SkillProgress
    • Certification
    • PaginatedDiveLogs
    • StoreItem
    • PaymentIntentResponse
    • OrderConfirmResponse
    • OrderStatusResponse
    • InstructorSearch
    • DiveCenterSearch
  1. Renewals

Submit renewal module quiz

POST
https://test.diveraid.com/api/v1/professional/renewals/{log_code}/modules/{module}/quiz
Professional / Renewals
Maintainer:Not configured

Overview#

Submits the answers of one module quiz of a professional renewal course, scores it server-side and creates a Quiz record. Served by RenewalController::submitQuiz().
{module} is route-model-bound to App\Models\Courses\Module by its primary key; the controller then checks it belongs to the course of the renewal (403 otherwise). Scoring covers the submitted questions: each key of answers must be a question of the module's quiz pool, and no more keys than the module's quiz_questions may be sent, otherwise 403. A question counts as correct when its selected answer is one of its correct answers. total is the module's quiz_questions, so an unanswered question counts as wrong, and the quiz passes when correct reaches the module's quiz_minimum. There is no lock and no mail: renewal logs have neither.
Controller: App\Http\Controllers\Api\V1\Professional\RenewalController::submitQuiz()
Route name: api.v1.professional.renewals.quiz.submit

Authentication#

Type: Bearer Token (Sanctum)
Header: Authorization: Bearer {token}
Additional middleware: role:professional. A user without the professional role receives 403.

Request#

Method: POST
Path: /api/v1/professional/renewals/{log_code}/modules/{module}/quiz
Content-Type: application/json

Path parameters#

ParameterTypeDescription
{log_code}string(32)Renewal course log code, as returned by GET /api/v1/professional/renewals. Not a primary key.
{module}integerModule id, route-model-bound

Body#

{
  "answers": { "7121": 27632, "7129": 27664 },
  "start": "2026-09-30 10:00:00",
  "end": "2026-09-30 10:10:00"
}
Validated by App\Http\Requests\Api\V1\Professional\SubmitRenewalAttemptRequest.
FieldTypeRequiredValidationDescription
answersobjectYesrequired|array{question id: answer id} map. The keys are the answered questions, checked against the pool by the controller (403)
answers.*integerYesrequired|integer|exists:answers,idAn id that exists in answers
startdatetimeYesrequired|dateAttempt start. With the renewal and module it identifies the attempt (409 when sent twice)
enddatetimeYesrequired|date|after:startAttempt end, after start

Example request#


Response 201 Created#

Illustrative values: a module with quiz_questions 2 and quiz_minimum 1.
{
  "success": true,
  "status": "success",
  "message": "Quiz submitted successfully",
  "data": {
    "id": 1582901,
    "log_code": "7c1e5d9a3b2f4a68901d2c3b4a5f6e70",
    "module_id": 300,
    "total": 2,
    "correct": 1,
    "wrong": 1,
    "score": 50,
    "passed": true,
    "date": "2026-09-30",
    "start": "2026-09-30 10:00:00",
    "end": "2026-09-30 10:10:00",
    "questions": [
      {
        "id": 7121,
        "text": "How should oxygen equipment be cleaned after use?",
        "missing": false,
        "answers": [
          { "id": 27632, "text": "Wipe down with a soft damp cloth", "is_correct": true, "selected": true },
          { "id": 27633, "text": "Store without cleaning", "is_correct": false, "selected": false }
        ]
      },
      {
        "id": 7129,
        "text": "When should a cylinder be visually inspected?",
        "missing": false,
        "answers": [
          { "id": 27663, "text": "Once a year", "is_correct": true, "selected": false },
          { "id": 27664, "text": "Never", "is_correct": false, "selected": true }
        ]
      }
    ]
  }
}

Response fields#

Same QuizResultResource shape as GET_quiz_results.md - see _resources.md. passed is correct >= module.quiz_minimum, not a percentage threshold.

Errors#

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 Forbidden#

Returned when the authenticated user does not have the professional role (role:professional middleware, body not captured), when no renewal with that log_code belongs to the caller or the log_code does not exist, when {module} does not belong to the course of the renewal, or when a key of answers is not a question of the module's quiz pool or more keys than the module's quiz_questions are sent. Nothing is written. The last three cases use the standard envelope:
{
  "success": false,
  "status": "error",
  "message": "Forbidden"
}

404 Not Found#

A {module} id that does not exist returns 404 from route-model binding, before the validation and the controller run. The body was not captured for this route.

409 Conflict - attempt already submitted#

Returned when an attempt with the same start was already submitted for this renewal 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 - validation#

Emitted by ApiFormRequest::failedValidation(), before the controller runs. Not captured on this route; the shape is the one the base class emits.
{
  "success": false,
  "status": "error",
  "message": "Validation failed",
  "errors": {
    "answers": ["The answers field is required."]
  }
}

429 Too Many Requests#

The route sits behind the API rate limiter; the live responses carried x-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.

Notes#

Side effects: creates a Quiz row. No lock is set and no mail is sent.
The row stores the submitted question ids in questions, the caller's IP in ip_address and the server time in date; start and end are stored as given.
RenewalController carries a @deprecated docblock; it concerns the renewal payment endpoints only (checkout() and confirmPayment() answer 501), not this endpoint.

Source: docs/api/professional/renewals/POST_quiz_submit.md

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Path Params

Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Quiz submitted
Bodyapplication/json

🟠401
🟠403
🟠404
🟠409
🟠422
🟠429
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://test.diveraid.com/api/v1/professional/renewals//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"
}'
Response Response Example
201 - Example 1
{
    "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
                    }
                ]
            }
        ]
    }
}
Modified at 2026-12-04 08:05:13
Previous
Get renewal progress
Next
Get renewal quiz result
Built with