public async Task AddQuizAttemptWithAutomaticChecking(string courseId, Guid slideId, string userId, int automaticScore) { var automaticChecking = new AutomaticQuizChecking { CourseId = courseId, SlideId = slideId, UserId = userId, Timestamp = DateTime.Now, Score = automaticScore, }; db.AutomaticQuizCheckings.Add(automaticChecking); await db.SaveChangesAsync(); }
public async Task <AutomaticQuizChecking> AddAutomaticQuizChecking(UserQuizSubmission submission, string courseId, Guid slideId, string userId, int automaticScore) { var automaticChecking = new AutomaticQuizChecking { Submission = submission, CourseId = courseId, SlideId = slideId, UserId = userId, Timestamp = DateTime.Now, Score = automaticScore, }; db.AutomaticQuizCheckings.Add(automaticChecking); await db.SaveChangesAsync().ConfigureAwait(false); return(automaticChecking); }