> ## 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 - Publish Result

> The Publish Result API allows the publication of exam results in two states:

 1. **Pre-publish:** Marks and performance details are shared with stakeholders for validation and feedback before finalizing the results.
 2. **Final-publish:** The final and locked results are published after necessary validations.

This API facilitates the seamless transition between provisional and final states in the evaluation process. 

**Scenarios:**

1. **Pre-Publish Exam Results for Stakeholder Review:**
   - After scoring student answer sheets and generating preliminary results, the teacher or administrator wants to share the results for review and feedback.
   - The API is used to pre-publish the results in a 'pre-publish' state, enabling stakeholders (e.g., teachers, moderators) to validate the marks and performance details.
   - **Outcome:**
     - Stakeholders can review the provisional results, verify accuracy, and suggest any necessary adjustments before finalizing the results.

2. **Final Publish of Exam Results After Validation:**
   - After incorporating feedback from stakeholders, the teacher or administrator finalizes and approves the results.
   - The API is used to final-publish the exam results, locking the results and marking them as final.
   - **Outcome:**
     - The final exam results are officially published, and no further changes can be made. The results are now available to students and other relevant parties in a definitive format.




## OpenAPI

````yaml POST /evaluation-platform/v1/exam/{examId}/publish-result/
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}/publish-result/:
    post:
      summary: Publish the result of an exam
      description: Publish the result of an exam
      parameters:
        - in: path
          name: examId
          schema:
            type: string
          required: true
      requestBody:
        description: Request body for final publish operation.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                entity:
                  type: string
                  example: final-publish
                  description: >-
                    The entity to be published either as a **pre-publish** or
                    **final-publish**.
              required:
                - entity
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully {{entity}} result
        '400':
          description: Bad Request - Invalid Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                        description: Error code indicating a bad request.
                      message:
                        type: object
                        properties:
                          entity:
                            type: string
                            example: 'Unknown entity: pree-publish'
                            description: Error message detailing the unknown entity.
              example:
                error:
                  code: 400
                  message:
                    entity: 'Unknown entity: pree-publish'
        '403':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    example: Token has expired
              example:
                detail: Token has expired
        '404':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  'error:':
                    type: object
                    properties:
                      code:
                        type: integer
                        example: 400
                      message:
                        type: object
                        properties:
                          non_field_errors:
                            type: array
                            items:
                              type: string
                              example: Exam not found
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````