Exemple #1
0
        public IActionResult UpdateUserQuiz([FromBody] QuizGrade request)
        {
            var attempt = _repoWrapper.QuizAttempts.FindByCondition(u => u.Id.Equals(request.Id)).Single();

            attempt.QuizScore = request.QuizScore;
            attempt.QuizItems = request.QuizItems;
            _repoWrapper.QuizAttempts.Save();

            return(Ok(new { attempt_id = attempt.Id }));
        }
Exemple #2
0
        public IActionResult PostUserQuiz([FromBody] QuizGrade request)
        {
            var attempt = new QuizAttempts
            {
                UserQuizId = request.UserQuizId,
                ScoreDate  = DateTime.Now
            };

            _repoWrapper.QuizAttempts.Create(attempt);
            _repoWrapper.QuizAttempts.Save();

            return(Ok(new { attempt_id = attempt.Id }));
        }