API for getting/creating/deleting Quizzes and saving its results against a user.
For adding/deleting/updating and fetching Quizzes.
Get all Quizzes.
-
No specific input is required.
-
Quizzes are publically available.
-
Quizzes are not associated with any user.
Endpoint:
Method: GET
Type:
URL: https://iquiz.onrender.com/api/v1/quiz/
Add new Quiz
- name must be provided in the body in JSON format.
- (Pending) Need to add an admin user to add Quiz.
Endpoint:
Method: POST
Type: RAW
URL: https://iquiz.onrender.com/api/v1/quiz/
Body:
{
"name": "2026 Qestion papers"
}
Update Quiz name
- name must be provided in body in json format.
- (Pending) Need to add admin user to update Quiz
Endpoint:
Method: PUT
Type: RAW
URL: https://iquiz.onrender.com/api/v1/quiz/
Body:
{
"quizId" : "Quiz_ID",
"name": "2022 Murad course"
}
Delete Quiz
- name must be provided in body in json format.
- (Pending) Need to add admin user to delete Quiz.
Endpoint:
Method: DELETE
Type: RAW
URL: https://iquiz.onrender.com/api/v1/quiz/Quiz_ID
This section is for adding/deleting questions in a quiz.
Get all questions against a quiz id.
- Input is category id in path params.
- quiz id can be gotten from Get All Quzzies request.
Endpoint:
Method: GET
Type:
URL: https://iquiz.onrender.com/api/v1/question/QUIZ_ID
Add a new question against a Quiz. .
- Input is must be in mentioned format.
Endpoint:
Method: POST
Type: RAW
URL: https://iquiz.onrender.com/api/v1/question/
Body:
{
"quizId": "Quiz_ID",
"question": "question 2",
"options": [
"Correct",
"Wrong",
"Wrong",
"Wrong",
"Wrong"
],
"correctAnswer": "A"
}
Add new questions against a Quiz through a file.
- Input file must be in array of update question formate.
Endpoint:
Method: POST
Type: FORMDATA
URL: https://iquiz.onrender.com/api/v1/question/bulkUpload
Body:
Key | Value | Description |
---|---|---|
dataFile |
Delete quiz
-
Input must be question id
-
question id can be get from Get quizzes request
Endpoint:
Method: DELETE
Type:
URL: https://iquiz.onrender.com/api/v1/question/QUESTION_ID
For saving the history, user must login as saving and retriving quiz history.
Login User will return JWT Token.
Client must save it for history action.
(Pending) Currently admin user is pending
Endpoint:
Method: POST
Type: RAW
URL: https://iquiz.onrender.com/api/v1/user/
Body:
{
"name": "Ali M",
"phone": "+923244897384",
"imageName": "1.png",
"role": "user"
}
End point for getting current user.
Endpoint:
Method: GET
Type:
URL: https://iquiz.onrender.com/api/v1/user/getUser
Update user details.
- name and imageName can be updated.
- (Pending) Need to add admin user to update user.
Endpoint:
Method: PUT
Type: RAW
URL: https://iquiz.onrender.com/api/v1/user/
Body:
{
"name": "Ali Farzan",
"imageName": "2.png"
}
Saving and fetching quiz results.
Return all quiz attemped completed by user with some details(score, quiz name, attempted date)
Endpoint:
Method: GET
Type: RAW
URL: https://iquiz.onrender.com/api/v1/history
Return detail of single quiz in details with correct and selected option.
Endpoint:
Method: GET
Type:
URL: https://iquiz.onrender.com/api/v1/history/QUIZ_ID
Save a quiz attempt in history.
Endpoint:
Method: POST
Type: RAW
URL: https://iquiz.onrender.com/api/v1/history/
Body:
{
"quizID" : "Quiz_ID",
"anwsers" : [
"A",
"B",
"C",
"D",
"F"
]
}
Generated at 2023-11-08 01:24:48 by docgen