コード例 #1
0
        public async Task <ActionResult> ClearAnswers(string courseId, string slideId, bool isLti)
        {
            var slide  = courseManager.GetCourse(courseId).GetSlideById(slideId);
            var userId = User.Identity.GetUserId();
            await userQuizzesRepo.RemoveAnswers(userId, slideId);

            await visitsRepo.RemoveAttempts(slideId, userId);

            var model = new { courseId, slideIndex = slide.Index };

            if (isLti)
            {
                LtiUtils.SubmitScore(slide, userId);
                return(RedirectToAction("LtiSlide", "Course", model));
            }
            return(RedirectToAction("Slide", "Course", model));
        }
コード例 #2
0
ファイル: QuizController.cs プロジェクト: epeshk/uLearn
        public async Task <ActionResult> ClearAnswers(string courseId, Guid slideId, bool isLti)
        {
            var slide = courseManager.FindCourse(courseId)?.FindSlideById(slideId) as QuizSlide;

            if (slide == null)
            {
                return(HttpNotFound());
            }

            var userId = User.Identity.GetUserId();
            await userQuizzesRepo.RemoveAnswers(userId, slideId);

            await visitsRepo.RemoveAttempts(slideId, userId);

            var model = new { courseId, slideId = slide.Id };

            if (isLti)
            {
                LtiUtils.SubmitScore(slide, userId);
                return(RedirectToAction("LtiSlide", "Course", model));
            }
            return(RedirectToAction("SlideById", "Course", model));
        }