Repository navigation
Service Endpoints
Ian Drummond edited this page Jun 29, 2018
·
2 revisions
QuizService Endpoints: Answer Endpoints:
- getAnswer(): /answer/{id} Function: Endpoint retrieves an AnswerDTO representing an answer. Parameters: A path variable Id representing the answer id. Returns: An AnswerDTO representing the attempt.
- getAnswersByQuestionId(): /answer/question/{id} Function: Returns all answers for a specified question. Parameters: A path variable id representing the question id. Returns: A set of AnswerDTOs representing the answers for the specified question. addAnswer(): /answer/add Function: Adds an Answer to the database. Parameters: RequestParam content - A String representing the answer content. RequestParam isCorrect - A boolean stating whether the answer is correct or incorrect. RequestParam question_id - An integer value representing the id of the question. Returns: An AnswerDTO representing the answer. editAnswer(): /answer/edit/{id} Function: Edits a specified answer. Parameters: Path Variable id - represents the id of the answer to edit. RequestParam value - a String representing the new answer content. RequestParam isCorrect - a boolean representing the new answer correct/incorrect value. Returns: An AnswerDTO representing the Answer. deleteAnswer(): /answer/delete/{id} Function: Deletes a specified answer. Parameters: Path Variable id - represents the id of the answer to be deleted. Returns: A boolean value for true when deletion is successful. Question Endpoints: getQuestionsByLibraryId(): /question/lib/{library_id} Function: Gets all questions for a specified library. Parameters: Path Variable library_id - represents the id for the specified library. Returns: A set of QuestionDTOs representing the questions for the libaray. getQuestion(): /question/{id} Function: Get a question by id. Parameters: Path Variable id - The id for the question. Returns: A QuestionDTO represnting the question. updateQuestionDifficulty(): /update/{id}/{difficulty} Function: Update the question difficulty. Parameters: Path Variable id - The id for the question to update. Path Variable difficulty - An integer representing the new question difficulty. Returns: A QuestionDTO representing the updated question. updateQuestionContent(): /question/update/{id} Function: Updates the question content. Parameters: Path Variable id - The id of the question to update. RequestParam content - A String representing the new answer content. Returns: A QuestionDTO representing the updated question. addQuestion(): /question/add Function: Adds a question to the database. Parameters: RequestParam content - A String representing the content of the question. RequestParam difficulty - An integer representing the difficulty of the question. RequestParam library_id - An integer representing the library the question belongs to. Returns: A QuestionDTO representing the question added to the database. Quiz Endpoints: generateQuiz(): /quiz/generateQuiz Function: Parameters: Returns: getQuizById(): /quiz/{id} Function: Parameters: Returns: AttemptService Endpoints: Attempt Endpoints: getAttemptById(): /attempt/{id} getAttemptAnswersByAttemptId(): /attempt/attemptanswers/{id} getAllAttempts(): /attempt/getAllAttempts getAllAttemptAnswers(): /attempt/getallattemptanswers getCompleteAttemptsByAccountId(): /attempt/complete/{accountId} getIncompleteAttemptsByAccountId(): /attempt/incomplete/{accountId} getCompleteAttemptsByUserAndQuiz(): /attempt/complete/{accountId}/{quizId} addAttempt(): /attempt/add addAttemptAnswer(): /attempt/add/attemptanswer scoreAttempt(): /attempt/score