> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whop.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit assessment course lesson

> Submit answers for a quiz or knowledge check lesson and receive a graded result.



## OpenAPI

````yaml /openapi/api-v1-stable.json post /course_lessons/{lesson_id}/submit_assessment
openapi: 3.1.0
info:
  description: >-
    The Whop REST API. Please see
    https://docs.whop.com/developer/api/getting-started for more details.
  termsOfService: https://whop.com/tos-developer-api/
  title: Whop API
  version: 1.0.0
  x-api-version-date: 2026-08-21-1
servers:
  - description: Production Whop API
    url: https://api.whop.com/api/v1
  - description: Sandbox Whop API
    url: https://sandbox-api.whop.com/api/v1
security: []
tags:
  - description: Products
    name: Products
  - description: Payments
    name: Payments
  - description: Refunds
    name: Refunds
  - description: Disputes
    name: Disputes
  - description: Dispute alerts
    name: Dispute alerts
  - description: Resolution center cases
    name: Resolution center cases
  - description: Checkout configurations
    name: Checkout configurations
  - description: Setup intents
    name: Setup intents
  - description: Payment methods
    name: Payment methods
  - description: Invoices
    name: Invoices
  - description: Promo codes
    name: Promo codes
  - description: Card transactions
    name: Card transactions
  - description: Ledger accounts
    name: Ledger accounts
  - description: Withdrawals
    name: Withdrawals
  - description: Payout methods
    name: Payout methods
  - description: Verifications
    name: Verifications
  - description: Identity profiles
    name: Identity profiles
  - description: Payout accounts
    name: Payout accounts
  - description: Topups
    name: Topups
  - description: Companies
    name: Companies
  - description: Authorized users
    name: Authorized users
  - description: Fee markups
    name: Fee markups
  - description: Members
    name: Members
  - description: Memberships
    name: Memberships
  - description: Leads
    name: Leads
  - description: Entries
    name: Entries
  - description: Shipments
    name: Shipments
  - description: Reviews
    name: Reviews
  - description: Company token transactions
    name: Company token transactions
  - description: Affiliates
    name: Affiliates
  - description: Experiences
    name: Experiences
  - description: Forums
    name: Forums
  - description: Forum posts
    name: Forum posts
  - description: Chat channels
    name: Chat channels
  - description: Support channels
    name: Support channels
  - description: Messages
    name: Messages
  - description: Reactions
    name: Reactions
  - description: Dm members
    name: Dm members
  - description: Dm channels
    name: Dm channels
  - description: Notifications
    name: Notifications
  - description: Courses
    name: Courses
  - description: Course chapters
    name: Course chapters
  - description: Course lessons
    name: Course lessons
  - description: Course students
    name: Course students
  - description: Course lesson interactions
    name: Course lesson interactions
  - description: Apps
    name: Apps
  - description: Webhooks
    name: Webhooks
  - description: App builds
    name: App builds
  - description: Access tokens
    name: Access tokens
  - description: Account links
    name: Account links
  - description: Files
    name: Files
  - description: Ai chats
    name: Ai chats
  - description: Bounties
    name: Bounties
  - description: Stats
    name: Stats
  - description: Conversions
    name: Conversions
  - description: Ad reports
    name: Ad reports
paths:
  /course_lessons/{lesson_id}/submit_assessment:
    post:
      tags:
        - Course lessons
      summary: Submit assessment course lesson
      description: >-
        Submit answers for a quiz or knowledge check lesson and receive a graded
        result.
      operationId: submitAssessmentCourseLesson
      parameters:
        - description: >-
            The unique identifier of the quiz or knowledge check lesson to
            submit answers for (e.g., "les_XXXXX").
          in: path
          name: lesson_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              description: Parameters for SubmitAssessment
              properties:
                answers:
                  description: The list of answers to submit for each assessment question.
                  items:
                    description: >-
                      Input for a single question's answer in an assessment
                      submission
                    properties:
                      answer_text:
                        description: >-
                          The text answer provided by the user (for short answer
                          questions)
                        type:
                          - string
                          - 'null'
                      question_id:
                        description: The ID of the question being answered
                        type: string
                      selected_option_ids:
                        description: >-
                          The IDs of the selected options (for multiple
                          choice/select questions)
                        items:
                          description: >-
                            Represents a unique identifier that is Base64
                            obfuscated. It is often used to refetch an object or
                            as key for a cache. The ID type appears in a JSON
                            response as a String; however, it is not intended to
                            be human-readable. When expected as an input type,
                            any string (such as `"VXNlci0xMA=="`) or integer
                            (such as `4`) input value will be accepted as an ID.
                          type: string
                        type:
                          - array
                          - 'null'
                    required:
                      - question_id
                    type: object
                  type: array
              required:
                - answers
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                description: The result of a user's assessment attempt
                properties:
                  created_at:
                    description: The datetime the assessment result was created.
                    example: '2023-12-01T05:00:00.401Z'
                    format: date-time
                    type: string
                  id:
                    description: The unique identifier for the assessment result.
                    example: crsar_xxxxxxxxxxxx
                    type: string
                  lesson:
                    description: The lesson this assessment result is for
                    properties:
                      id:
                        description: The unique identifier for the lesson.
                        example: lesn_xxxxxxxxxxxxx
                        type: string
                      title:
                        description: >-
                          The display name of the lesson shown to students.
                          Maximum 120 characters.
                        example: Understanding Candlestick Patterns
                        type: string
                    required:
                      - id
                      - title
                    type: object
                  result_correct:
                    description: The number of correct answers
                    example: 42
                    type: integer
                  result_grade:
                    description: The grade achieved on the assessment
                    example: 6.9
                    type: number
                  result_graded_questions:
                    additionalProperties: true
                    description: Array of graded questions with details
                    type: object
                  result_passing_grade:
                    description: Whether the user achieved a passing grade
                    type: boolean
                  result_question_count:
                    description: The total number of questions in the assessment
                    example: 42
                    type: integer
                  score_percent:
                    description: The percentage score achieved on the assessment
                    example: 6.9
                    type: number
                  updated_at:
                    description: The datetime the assessment result was last updated.
                    example: '2023-12-01T05:00:00.401Z'
                    format: date-time
                    type: string
                  user:
                    description: The user who took the assessment
                    properties:
                      id:
                        description: The unique identifier for the user.
                        example: user_xxxxxxxxxxxxx
                        type: string
                      name:
                        description: The user's display name shown on their public profile.
                        example: John Doe
                        type:
                          - string
                          - 'null'
                      username:
                        description: >-
                          The user's unique username shown on their public
                          profile.
                        example: johndoe42
                        type: string
                    required:
                      - id
                      - name
                      - username
                    type: object
                required:
                  - id
                  - created_at
                  - updated_at
                  - result_grade
                  - result_correct
                  - result_question_count
                  - result_passing_grade
                  - result_graded_questions
                  - score_percent
                  - user
                  - lesson
                type: object
          description: A successful response
        '400':
          content:
            application/json:
              example:
                error:
                  code: parameter_missing
                  message: 'Missing required parameter: amount.'
                  param: amount
                  type: invalid_request_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Bad request
        '401':
          content:
            application/json:
              example:
                error:
                  message: Invalid or missing API key
                  type: unauthorized
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Unauthorized
        '403':
          content:
            application/json:
              example:
                error:
                  message: You do not have permission to access this resource
                  type: forbidden
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                error:
                  message: Resource not found
                  type: not_found
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Not found
        '422':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Verification required
        '429':
          content:
            application/json:
              example:
                error: null
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Too many requests
        '500':
          content:
            application/json:
              example:
                error:
                  message: An unexpected error occurred
                  type: internal_server_error
              schema:
                properties:
                  error:
                    properties:
                      code:
                        description: >-
                          A short string indicating the specific error code,
                          e.g. 'parameter_missing', 'parameter_invalid',
                          'invalid_json'
                        type:
                          - string
                          - 'null'
                      message:
                        type: string
                      param:
                        description: The parameter that caused the error, if applicable
                        type:
                          - string
                          - 'null'
                      type:
                        type: string
                    required:
                      - type
                      - message
                    type: object
                required:
                  - error
                type: object
          description: Internal server error
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Whop from '@whop/sdk';


            const client = new Whop({
              apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.courseLessons.submitAssessment('lesson_id', {
              answers: [{ question_id: 'question_id' }],
            });


            console.log(response.id);
components:
  securitySchemes:
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        An Account API key, account-scoped JWT, App API key, or user OAuth
        token. Prepend the key or token with `Bearer`, for example `Bearer
        ***************************`.
      scheme: bearer
      type: http

````