Skip to content

Calculate Student's quiz score

Gauri Pandharinath Bodke edited this page Jun 15, 2022 · 1 revision

Calculate Student's quiz score

Calculate Student's quiz score

URL: /api/student/course/:courseID/module/quiz/score

URL Parameters : courseId=[integer] where courseId is the ID of the course to which module needs to be added.

Method: POST

Authorization required: Yes

Content-Type: application/json

Request

{
    "moduleId": 21,
    "response":[25,26,28,29]
}

Success Response

Condition: If everything goes well and the scores would be calculated.

Code : 200 Created

Example:

{
    "ID": 6,
    "CreatedAt": "2022-04-13T19:22:25.067392867-04:00",
    "UpdatedAt": "2022-04-13T19:22:25.067392867-04:00",
    "DeletedAt": null,
    "studentId": 12,
    "quizId": 17,
    "scoreValue": 1
}

Error Responses

Condition: If the input request does not satisfy data constraints.

Code: 400 Bad Request

Example:

{
    "error": "incorrect parameters"
}

Condition: If the JWT-token is not present in the request headers.

Code: 401 Unauthorized

Example:

{
    "error": "token not found"
}

Condition: If the JWT-token is expired.

Code: 401 Unauthorized

Example:

{
    "error": "user unauthorized"
}

Condition: If the course Id does not exist .

Code: 404 Bad Request

Example:

{
    "error": "course not found"
}

Condition: If the course is not published .

Code: 404 Bad Request

Example:

{
    "error": "course not Published"
}

Condition: If the student is not enrolled in the course .

Code: 404 Bad Request

Example:

{
    "error": "student not enrolled"
}

Condition: If the module type is not quiz .

Code: 404 Bad Request

Example:

{
    "error": "incorrect module type"
}

Condition: Unknown error.

Code: 500 Internal Server Error

Example:

{
    "error": "internal server error"
}
Clone this wiki locally