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

>  This is a generic API that allows you to update various components of an evaluation platform: 

 - You can update the question text to reflect any changes or corrections.
 - The marking scheme can be modified to adjust the scoring criteria. 
 - Model answer step marking can be updated to ensure accurate evaluation. 
 - Additionally, you can update the student evaluated answer marking for consistency 

**Scenario: Updating Question Text for Clarity or Correction:**

1. **Clarifying or Correcting Question Text:**
   - During the evaluation process, an evaluator identifies an ambiguous or incorrect question. The Generic Update API allows updating the question text to make it clearer or correct any inaccuracies.
   - **Outcome:**
     - The question text is updated, ensuring consistency across the platform and more accurate evaluation for students.

**Scenario: Adjusting the Marking Scheme for a Specific Question:**

1. **Modifying the Marking Scheme:**
   - An evaluator reviews a question and decides to adjust the marking scheme, either by changing the total marks, modifying the breakdown, or adding new criteria.
   - **Outcome:**
     - The marking scheme is updated, ensuring fairness and alignment with evaluation criteria.

**Scenario: Updating Model Answer’s Step Marking:**

1. **Modifying Step-Wise Marking:**
   - After reviewing the model answer, the evaluator notices the step marking needs to be adjusted for clarity or accuracy. The Generic Update API is used to modify how marks are distributed across different steps.
   - **Outcome:**
     - The step marking is updated, impacting how student answers are evaluated and ensuring accurate scoring.

**Scenario: Correcting Student Answer Evaluation Marking:**

1. **Correcting Mistakes in Evaluation:**
   - After reviewing a student’s answer, an error is discovered in the evaluation, such as incorrect marking or wrong application of the model answer’s step-wise evaluation.
   - **Outcome:**
     - The student’s evaluated answer is corrected, ensuring that the final score accurately reflects the correct evaluation based on the model answer. 



## OpenAPI

````yaml PATCH /evaluation-platform/v1/exam/{examId}/update/
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:
  /evaluation-platform/v1/exam/{examId}/update/:
    patch:
      summary: Update Evaluation
      description: Updates an existing evaluation.
      parameters:
        - in: path
          name: examId
          schema:
            type: string
          required: true
      requestBody:
        description: >-
          Request payload containing a list of entities, including model answers
          and questions.
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  entity:
                    type: string
                    description: Type of entity (e.g., modelAnswer or question).
                    example: modelAnswer
                  id:
                    type: string
                    format: uuid
                    description: Unique identifier for the entity.
                    example: a17cd91d-55d3-46bb-a544-9f38ab2e027f
                  text:
                    type: string
                    description: The textual content of the entity.
                    example: sdsdf
                  stepMarking:
                    type: array
                    description: >-
                      List of step-wise marking details (only applicable to
                      modelAnswer entities).
                    items:
                      type: object
                      properties:
                        marksplit:
                          type: number
                          format: float
                          description: The marks assigned to the specific step.
                          example: 1
                        step_wise_answer:
                          type: string
                          description: The answer for the specific step.
                          example: b
                required:
                  - entity
                  - id
                  - text
            example:
              - entity: modelAnswer
                id: a17cd91d-55d3-46bb-a544-9f38ab2e027f
                text: sdsdf
                stepMarking:
                  - marksplit: 1
                    step_wise_answer: b
              - entity: question
                id: 2f35d316-ed4e-430f-90e1-28ac133219f6
                text: >-
                  Titles adopted by the ruler-Devanampiya, often translated as
                  'beloved of the gods' and Piyadassi, or 'pleasant to behold'.
                  A. King Harshavardhan B. King Ashoka C. King Samudragupta D.
                  King Chandragupta
      responses:
        '200':
          description: >-
            Successful operation response indicating the data was updated
            successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: Success
                    description: Indicates the status of the operation.
                  message:
                    type: string
                    example: Data updated successfully
                    description: Provides additional details about the operation result.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                      message:
                        type: object
                        properties:
                          entity:
                            type: array
                            items:
                              type: string
                              example: >-
                                Invalid entity: The provided entity is not
                                valid.
        '403':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Token has expired
              example:
                detail: Token has expired
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````