YouQuiz is An interactive platform that empowers trainers to design engaging quizzes, while providing students the opportunity to take and excel in these quizzes.
Click here to visit the front end repository of this project.
-
When fetching the data successfully, you will receive this response:
{ "data": {/* Fetched data */}, "message": "Success message", "status": 200 // HTTP status code (201 for creating new resource, else 200) }
-
-
When an unexpected error occurs during request processing, you will receive this response:
{ "cause": {/* Optional: The cause of this exception, if available */}, "message": "Exception message", "status": 404 // HTTP status code (can be adjusted for specific exceptions) }
-
When submitting invalid data in a request, you will receive this response:
{ "errors": {/* The invalid fields with specific error messages */}, "message": "Error message", "status": 422 // HTTP status code (can be adjusted for specific errors) }
-
-
An example of the answer request object when creating or updating an answer:
{ "id": 3, // Required only when updating an answer "answer": "A software development platform that provides all the tools and libraries ..." }
-
GET /api/answers/:idParameters Description No parameter Returns an answer object if a valid identifier was provided, and throws an error otherwise. -
GET /api/answersQuery Parameters Description text: stringpage: integersize: integersortBy: stringsortOrder: stringtext: To search for an answer, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of answers in a single page, default is24.
sortBy: name of the attribute to sort by (idoranswer), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of answers. -
POST /api/answers/addParameters Description answer: objectReturns an answer object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/answers/updateParameters Description answer: objectReturns an answer object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/answers/:idParameters Description No parameter Returns an object of the deleted answer if a valid identifier was provided, and throws an error otherwise.
-
An example of the answer-validation request object when creating an answer-validation:
{ "points": 3.4, "answerId": 2, "questionId": 1 }
-
-
GET /api/answers-assignment/pk/:idParameters Description No parameter Returns an answer-validation object if a valid identifier was provided, and throws an error otherwise. -
GET /api/answers-assignment/fk/:questionId/:answerIdParameters Description No parameter Returns an answer-validation object if a valid identifiers were provided, and throws an error otherwise.
-
-
-
GET /api/answers-assignment/by-question/:questionIdParameters Description No parameter Returns a list of answer-validation objects if a valid identifier was provided, and throws an error otherwise. -
GET /api/answers-assignment/by-answer/:answerIdParameters Description No parameter Returns a list of answer-validation objects if a valid identifier was provided, and throws an error otherwise.
-
-
POST /api/answers-assignment/addParameters Description AnswerValidation: objectReturns an answer-validation object if a valid object was provided, and throws an error or exception otherwise. -
-
DELETE /api/answers-assignment/pk/:idParameters Description No parameter Returns an object of the deleted answer-validation if a valid identifier was provided, and throws an error otherwise. -
DELETE /api/answers-assignment/fk/:questionId/:answerIdParameters Description No parameter Returns an object of the deleted answer-validation if a valid identifiers were provided, and throws an error otherwise.
-
-
An example of the level request object when creating or updating a level:
{ "id": 3, // Required only when updating a level "title": "Medium", "description": "Optional description, can be empty.", "maxPoints": 29.9, "minPoints": 21.1 }
-
GET /api/levels/:idParameters Description No parameter Returns a level object if a valid identifier was provided, and throws an error otherwise. -
GET /api/levelsQuery Parameters Description title: stringpage: integersize: integersortBy: stringsortOrder: stringtitle: To search for a level, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of levels in a single page, default is24.
sortBy: name of the attribute to sort by (id,title,description,maxPointsorminPoints), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of levels. -
POST /api/levels/addParameters Description level: objectReturns a level object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/levels/updateParameters Description level: objectReturns a level object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/levels/:idParameters Description No parameter Returns an object of the deleted level if a valid identifier was provided, and throws an error otherwise.
-
An example of the media request object when creating a media:
{ "title": "A beautiful sunset", "type": "VIDEO" // 'type' must be either "VIDEO", "IMAGE" or "AUDIO" "file": {/* Attached file with the request */}, "questionId": 1 }
-
GET /api/media/:idParameters Description No parameter Returns a media object if a valid identifier was provided, and throws an error otherwise. -
GET /api/media/get/:file-nameParameters Description No parameter Returns a file if a valid file name was provided, and throws an error otherwise. -
⚠️ NB: You must use FormData in order to submit a post request.POST /api/media/addParameters Description media: objectReturns a media object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/media/:idParameters Description No parameter Returns an object of the deleted media if a valid identifier was provided, and throws an error otherwise.
-
An example of the question request object when creating or updating a question:
{ "id": 3, // Required only when updating a level "question": "What is JDK?", "description": "Optional description, can be empty.", "type": "SINGLE", // 'type' must be either "SINGLE", "MULTI" or "DIRECT" "levelId": 3 "subjectId": 4 }
-
GET /api/questions/:idParameters Description No parameter Returns a question object if a valid identifier was provided, and throws an error otherwise. -
GET /api/questionsQuery Parameters Description question: stringtype: enumlevel: longsubject: longpage: integersize: integersortBy: stringsortOrder: stringquestion: To search for a question, default is "".
type: To filter questions by their types (SINGLE,MULTI,DIRECTor empty string), default is"".
level: To filter questions by the level, default is0.
subject: To filter questions by the subject, default is0.
page: Number of the page (starting from 0), default is0.
size: Number of questions in a single page, default is24.
sortBy: name of the attribute to sort by (id,question,description), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of questions. -
POST /api/questions/addParameters Description question: objectReturns a question object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/questions/updateParameters Description question: objectReturns a question object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/questions/:idParameters Description No parameter Returns an object of the deleted question if a valid identifier was provided, and throws an error otherwise.
-
An example of the subject request object when creating or updating a subject:
{ "id": 3, // Required only when updating a subject "title": "Mathematics", "parent": 1 // Can be null }
-
GET /api/subjects/:idParameters Description No parameter Returns a subject object if a valid identifier was provided, and throws an error otherwise. -
GET /api/subjectsQuery Parameters Description title: stringpage: integersize: integersortBy: stringsortOrder: stringtitle: To search for a subject, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of subjects in a single page, default is24.
sortBy: name of the attribute to sort by (id,title), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of subjects. -
POST /api/subjects/addParameters Description subject: objectReturns a subject object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/subjects/updateParameters Description subject: objectReturns a subject object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/subjects/:idParameters Description No parameter Returns an object of the deleted subject if a valid identifier was provided, and throws an error otherwise.
-
An example of the student request object when creating or updating a student:
{ "id": 3, // Required only when updating a student "name": "Margaret", "familyName": "Hamilton", "address": "Paoli, Indiana, United States", "birthdate": "1936-08-17", // yyyy-MM-dd "registrationDate": "2022-12-31" // yyyy-MM-dd }
-
GET /api/students/:idParameters Description No parameter Returns a student object if a valid identifier was provided, and throws an error otherwise. -
GET /api/studentsQuery Parameters Description fullName: stringpage: integersize: integersortBy: stringsortOrder: stringfullName: To search for a student, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of students in a single page, default is24.
sortBy: name of the attribute to sort by (id,name,familyName,address,birthdate,registrationDate), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of students. -
POST /api/students/addParameters Description student: objectReturns a student object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/students/updateParameters Description student: objectReturns a student object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/students/:idParameters Description No parameter Returns an object of the deleted student if a valid identifier was provided, and throws an error otherwise.
-
An example of the trainer request object when creating or updating a trainer:
{ "id": 3, // Required only when updating a trainer "name": "Margaret", "familyName": "Hamilton", "address": "Paoli, Indiana, United States", "birthdate": "1936-08-17", // yyyy-MM-dd "speciality": "Software Engineering" }
-
GET /api/trainers/:idParameters Description No parameter Returns a trainer object if a valid identifier was provided, and throws an error otherwise. -
GET /api/trainersQuery Parameters Description fullName: stringpage: integersize: integersortBy: stringsortOrder: stringfullName: To search for a trainer, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of trainers in a single page, default is24.
sortBy: name of the attribute to sort by (id,name,familyName,address,birthdate,speciality), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of trainers. -
POST /api/trainers/addParameters Description trainer: objectReturns a trainer object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/trainers/updateParameters Description trainer: objectReturns a trainer object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/trainers/:idParameters Description No parameter Returns an object of the deleted trainer if a valid identifier was provided, and throws an error otherwise.
-
An example of the quiz request object when creating or updating a quiz:
{ "id": 3, // Required only when updating a quiz "title": "Java quiz", "duration": 45, // In minutes "successScore": 80.5, "canSeeAnswers": true, // Choose if the student can see the correct answer after answering the question "canSeeResult": true, // Choose if the student can see the result after finishing the quiz "chances": 5, "remark": "Remark about the quiz", "trainerId": 1 }
-
GET /api/quizzes/:idParameters Description No parameter Returns a quiz object if a valid identifier was provided, and throws an error otherwise. -
GET /api/quizzesQuery Parameters Description title: stringpage: integersize: integersortBy: stringsortOrder: stringtitle: To search for a quiz, default is "".
page: Number of the page (starting from 0), default is0.
size: Number of quizzes in a single page, default is24.
sortBy: name of the attribute to sort by (id,title,duration,successScore,chances,remark,trainerId), default is"id".
sortOrder: Sorting in ascending (ASC) or descending (DESC) order, default is"ASC".
Returns an object that contains all the data about pagination & array of quizzes. -
POST /api/quizzes/addParameters Description quiz: objectReturns a quiz object if a valid object was provided, and throws an error or exception otherwise. -
PUT /api/quizzes/updateParameters Description quiz: objectReturns a quiz object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/quizzes/:idParameters Description No parameter Returns an object of the deleted quiz if a valid identifier was provided, and throws an error otherwise.
-
An example of the quiz-question request object when creating or updating a quiz-question:
{ "timer": 20, // In seconds "allowPartialPoints": false, // Choose whether to allow partial points for each question or not "questionId": 5, "quizId": 1 }
-
GET /api/quiz-questions/:quizId/:questionIdParameters Description No parameter Returns a quiz-question object if a valid identifiers were provided, and throws an error otherwise. -
GET /api/quiz-questions/quiz/:quizIdParameters Description No parameter Returns an array of quiz-question objects if a valid identifier was provided, and throws an error otherwise. -
GET /api/quiz-questions/question/:questionIdParameters Description No parameter Returns an array of quiz-question objects if a valid identifier was provided, and throws an error otherwise. -
POST /api/quiz-questions/addParameters Description quiz-question: objectReturns a quiz-question object if a valid object was provided, and throws an error or exception otherwise. -
DELETE /api/quiz-questions/:quizId/:questionIdParameters Description No parameter Returns an object of the deleted quiz-question if a valid identifier was provided, and throws an error otherwise.
-
An example of the quiz-assignment request object when creating a quiz-assignment:
{ "reason": "Margaret", "startingTime": "2023-12-14 18:45:00.000", "endingTime": "2023-12-14 23:45:00.000", "studentId": 4, "quizId": 32 }
-
-
GET /api/quiz-assignments/:idParameters Description No parameter Get a quiz-assignment object with or without result & score, depends if the student is allowed to see the result & score of a quiz.
Returns a quiz-assignment object if a valid identifier was provided, and throws an error otherwise. -
GET /api/quiz-assignments/with-results/:idParameters Description No parameter Get a quiz-assignment object with result & score, regardless if the student is allowed to see the result & score of a quiz or not.
Returns a quiz-assignment object if a valid identifier was provided, and throws an error otherwise.
-
-
-
GET /api/quiz-assignments/by-student/:studentIdParameters Description No parameter Get a list of quiz-assignment objects of a student with or without result & score, depends if the student is allowed to see the result & score of a quiz.
Returns a list quiz-assignment objects if a valid identifier was provided, and throws an error otherwise. -
GET /api/quiz-assignments/by-student-with-results/:studentIdParameters Description No parameter Get a list of quiz-assignment objects of a student with result & score, regardless if the student is allowed to see the result & score of a quiz or not.
Returns a list quiz-assignment objects if a valid identifier was provided, and throws an error otherwise.
-
-
POST /api/quiz-assignments/addParameters Description quiz-assignment: objectReturns a quiz-assignment object if a valid object was provided, and throws an error or exception otherwise. -
POST /api/quiz-assignments/selected-answer/:quizAssignmentId/:answerValidationIdParameters Description No parameter Returns a quiz-assignment object if a valid identifiers were provided, and throws an error or exception otherwise. -
POST /api/quiz-assignments/close-quiz-assignment/:idParameters Description No parameter Closes & calculate the score of the quiz after passing the quiz.
Returns a quiz-assignment object if a valid identifier was provided, and throws an error or exception otherwise. -
DELETE /api/quiz-assignments/:idParameters Description No parameter Returns an object of the deleted quiz-assignment if a valid identifier was provided, and throws an error otherwise.