public async Task<UserQuiz> AddUserQuiz(string courseId, bool isRightAnswer, string itemId, string quizId, Guid slideId, string text, string userId, DateTime time, int quizBlockScore, int quizBlockMaxScore) { var quizzesRepo = new QuizzesRepo(db); var currentQuizVersion = quizzesRepo.GetLastQuizVersion(courseId, slideId); var userQuiz = new UserQuiz { CourseId = courseId, SlideId = slideId, QuizVersionId = currentQuizVersion.Id, IsRightAnswer = isRightAnswer, ItemId = itemId, QuizId = quizId, Text = text, Timestamp = time, UserId = userId, QuizBlockScore = quizBlockScore, QuizBlockMaxScore = quizBlockMaxScore }; db.UserQuizzes.Add(userQuiz); await db.SaveChangesAsync(); return userQuiz; }
public async Task <UserQuiz> AddUserQuiz(string courseId, bool isRightAnswer, string itemId, string quizId, Guid slideId, string text, string userId, DateTime time, int quizBlockScore, int quizBlockMaxScore) { var quizzesRepo = new QuizzesRepo(db); var currentQuizVersion = quizzesRepo.GetLastQuizVersion(courseId, slideId); var userQuiz = new UserQuiz { CourseId = courseId, SlideId = slideId, QuizVersionId = currentQuizVersion.Id, IsRightAnswer = isRightAnswer, ItemId = itemId, QuizId = quizId, Text = text, Timestamp = time, UserId = userId, QuizBlockScore = quizBlockScore, QuizBlockMaxScore = quizBlockMaxScore }; db.UserQuizzes.Add(userQuiz); await db.SaveChangesAsync(); return(userQuiz); }