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

# PATCH - Update Model Answer

>  This API allows authenticated users to update an existing model answer by either attaching rubric-based evaluation criteria or uploading supporting documents. 

 ### Key Parameters: 
 - **assignmentId** (`path param`, required): Unique ID of the assignment. 
 - **rubricId** (`form-data`, optional): The unique ID of the rubric used for evaluation or you can refer [this doc](https://docs.crazygoldfish.com/api-reference/endpoint/rubrics/v1-rubric) to get the `rubricId`. 
 - **isFinal** (`form-data`, optional): Pass `true` if this is the final model answer being submitted for evaluation. 
 - **documents[]** (`form-data`, optional): Uploads related documents such as reference material or answer sheets. 

 ### Behavior: 
 - You must **only pass one** of these at a time: `documents`, `rubricId`, or `isFinal`. 
 - If `isFinal=true`, the model answer sheet will be sent for evaluation. <Danger> You can either upload `documents` or provide a `rubricId` in a single request — not both. This is to ensure clarity in what part of the model answer you're updating. </Danger> 



## OpenAPI

````yaml PATCH /assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/
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:
  /assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/:
    patch:
      summary: Update Assignment Model Answer
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the assignment
        - name: modelAnswerId
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the model answer
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                rubricId:
                  type: string
                  example: 2b973c83-2830-4712-87b7-64a8c0a99035
                  description: >-
                    Unique ID of the rubric to associate with the model answer
                    sheet or you can refer [this
                    doc](https://docs.crazygoldfish.com/api-reference/endpoint/rubrics/v1-rubric)
                    to get the `rubricId`
                isFinal:
                  type: string
                  enum:
                    - 'true'
                    - 'false'
                  example: 'true'
                  description: >-
                    Flag to trigger evaluation if set to 'true'. Only one of
                    documents, rubricId, or isFinal is allowed.
                documents:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: List of model answer sheet documents to upload (if any).
      responses:
        '200':
          description: Model answer sheet updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    example: 3b27e0be-f9e8-4c4d-977b-b315bfb292ab
                    description: Unique identifier for the model answer sheet.
                  documents:
                    type: array
                    items:
                      type: object
                    example: []
                    description: List of documents associated with the model answer sheet.
                  rubric:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 2b973c83-2830-4712-87b7-64a8c0a99035
                        description: Unique identifier for the rubric.
                      name:
                        type: string
                        example: English Rubrics
                        description: Name of the rubric.
                      description:
                        type: string
                        nullable: true
                        example: null
                        description: Description of the rubric.
                      rubricCriteria:
                        type: array
                        description: List of criteria for the rubric.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              example: d102b0ff-1111-4235-b8e9-764ef03c57cb
                              description: Unique identifier for the rubric criteria
                            name:
                              type: string
                              example: Confidence & fluency in speaking
                              description: Name of the rubric criteria
                            description:
                              type: string
                              nullable: true
                              description: Description of the rubric criteria
                              example: ''
                            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: '2023-10-01T12:00:00Z'
                              description: Timestamp when the rubric criteria was created
                            modifiedAt:
                              type: string
                              format: date-time
                              example: '2023-10-01T12:00:00Z'
                              description: >-
                                Timestamp when the rubric criteria was last
                                modified
                      createdAt:
                        type: string
                        format: date-time
                        example: '2023-10-01T12:00:00Z'
                        description: Timestamp when the rubric was created
                      modifiedAt:
                        type: string
                        format: date-time
                        example: '2023-10-01T12:00:00Z'
                        description: Timestamp when the rubric was last modified
                  status:
                    type: integer
                    example: 1
                    description: >-
                      Status of the model answer sheet [(refer this doc to get
                      the
                      constants)](https://docs.crazygoldfish.com/api-reference/endpoint/assignments/v1-constants)
        '403':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/403Response'
        '404':
          description: Assignment not found.
          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: >-
                                Only one of documents, rubricId, or isFinal can
                                be provided
      security:
        - bearerAuth: []
components:
  schemas:
    403Response:
      type: object
      properties:
        detail:
          type: string
          example: Token has expired
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````