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();
        }
示例#2
0
        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);
        }