Esempio n. 1
0
        public async Task <IActionResult> SubmitQuiz(long id, [FromBody] QuizModel quizModel)
        {
            if (!await Quizzes.CheckIfQuizExists(id))
            {
                return(NotFound());
            }

            return(Ok(await Quizzes.SubmitQuiz(id, User.Id(), quizModel)));
        }
Esempio n. 2
0
        public async Task <IActionResult> Update(long id, [FromBody] QuizFormModel model)
        {
            if (!await Quizzes.CheckIfQuizExists(id))
            {
                return(NotFound());
            }
            await Quizzes.Update(id, model);

            return(Ok());
        }
Esempio n. 3
0
        public async Task <IActionResult> Remove(long id)
        {
            if (!await Quizzes.CheckIfQuizExists(id))
            {
                return(NotFound());
            }

            await Quizzes.Remove(id);

            return(Ok());
        }