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

# POST - Rubric Criteria

>  This API allows authenticated users to add a new criteria to an existing rubric by specifying its title, score range, and detailed scoring logic.


 **Key Notes:** 
 - `name`, `maxScore`, and `minScore` are **required** fields. 
 - `scoringLogic` is an array of objects, each containing a `score` and its associated `scoringLogic` explanation. 
 - This helps maintain a transparent and consistent evaluation framework.


 **Scenario: Adding a Criterion to a Rubric**

 A teacher wants to assess 'Confidence & fluency in speaking' in a student presentation rubric.

**Outcome:**
- The teacher sends a POST request with the criterion name and scoring details.
- The criterion is added to the existing rubric.
- The rubric becomes more detailed and useful for structured evaluation. 



## OpenAPI

````yaml POST /rubrics/v1/rubric/{id}/criteria/
openapi: 3.0.1
info:
  title: Evaluation Report API
  description: An API for retrieving evaluation reports.
  version: 1.0.0
servers:
  - url: https://api-staging.crazygoldfish.com
    description: SandBox endpoint
  - url: https://api.crazygoldfish.com
    description: Prod End Point
security: []
paths:
  /rubrics/v1/rubric/{id}/criteria/:
    post:
      tags:
        - Rubrics
      summary: Create Rubric Criterion
      operationId: createRubricCriterion
      parameters:
        - name: id
          in: path
          required: true
          description: ID of the rubric the criteria belongs to
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Confidence & fluency in speaking
                  description: Name of the rubric criterion
                description:
                  type: string
                  example: Evaluates how confidently and fluently the student speaks
                  description: Description of the rubric criterion
                maxScore:
                  type: string
                  example: 5 Star
                  description: Maximum score for the criterion
                minScore:
                  type: string
                  example: 1 Star
                  description: Minimum score for the criterion
                scoringLogic:
                  type: array
                  items:
                    type: object
                    properties:
                      score:
                        type: string
                        example: 5 Star
                        description: Score for the criterion
                      scoringLogic:
                        type: string
                        example: >-
                          Speaking: Reflects poise & confidence. Great body
                          language, eye contact.
                        description: Scoring logic for the criterion
                    required:
                      - score
                      - scoringLogic
              required:
                - name
                - maxScore
                - minScore
                - scoringLogic
      responses:
        '201':
          description: Rubric criteria created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RubricResponse'
        '400':
          description: Bad Request - Invalid input or missing required fields
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                      message:
                        type: object
                        properties:
                          scoringLogic:
                            type: array
                            items:
                              type: object
                              properties:
                                score:
                                  type: array
                                  items:
                                    type: string
                                    example: This field is required.
                                scoringLogic:
                                  type: array
                                  items:
                                    type: string
                                    example: This field is required.
        '403':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Response'
        '404':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  'error:':
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 404
                      message:
                        type: object
                        properties:
                          non_field_errors:
                            type: array
                            items:
                              type: string
                              example: Rubric not found
      security:
        - bearerAuth: []
components:
  schemas:
    RubricResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the rubric
          example: 2b973c83-2830-4712-87b7-64a8c0a99035
        name:
          type: string
          description: Name of the rubric
          example: English Rubric
        description:
          type: string
          description: Description of the rubric
          example: A rubric for evaluating english hand written assignment.
        rubricCriteria:
          type: array
          description: List of rubric criteria
          items:
            $ref: '#/components/schemas/RubricCriteriaResponse'
        createdAt:
          type: string
          format: date-time
          example: '2023-11-07T05:31:56Z'
          description: Created date for the rubric
        modifiedAt:
          type: string
          format: date-time
          example: '2023-11-07T05:31:56Z'
          description: Modified date of the rubric
    403Response:
      type: object
      properties:
        detail:
          type: string
          example: Token has expired
    RubricCriteriaResponse:
      type: object
      properties:
        id:
          type: string
          example: d102b0ff-1111-4235-b8e9-764ef03c57cb
          description: Unique ID of the rubric criteria
        name:
          type: string
          example: Confidence & fluency in speaking
          description: Name of the rubric criteria
        maxScore:
          type: string
          example: 5 Star
          description: Maximum score for the rubric criteria
        minScore:
          type: string
          example: 1 Star
          description: Minimum score for the rubric criteria
        scoringLogic:
          type: array
          items:
            type: object
            properties:
              score:
                type: string
                example: 5 Star
                description: Score for the rubric criteria
              scoringLogic:
                type: string
                example: >-
                  Speaking: Reflects poise & confidence. Great body language,
                  eye contact.
                description: Scoring logic for the rubric criteria
        createdAt:
          type: string
          format: date-time
          example: '2025-03-27T11:34:53.172550Z'
          description: Created date for the rubric criteria
        modifiedAt:
          type: string
          format: date-time
          example: '2025-03-27T11:35:17.739952Z'
          description: Modified date of the rubric criteria
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````