Example #1
0
        public ActionResult GetInstruction(int examId)
        {
            var me      = _examinationRepository.GetProfile(User.Identity.Name);
            var checker = _examinationRepository.GetExaminationData(examId);

            if (checker.Members.Contains(me.Member) && checker.Active)
            {
                return(View(checker));
            }
            return(View("InvalidAccess"));
        }
        public ActionResult ReportSheet(FormCollection fm)
        {
            var capture = fm["ExamId"];

            if (capture.IsEmpty())
            {
                ViewBag.ExamId = new SelectList(_examinationRepository.GetExaminations.OrderBy(x => x.Name).ToList(), "Id", "Name");
                return(View());
            }

            int capture2 = int.Parse(capture);
            var data     =
                _examinationRepository.GetResultManagers.Where(x => x.Examination.Id == capture2)
                .OrderByDescending(x => x.StarTime)
                .ToList();
            var info = new ReportSheet
            {
                ExamName      = _examinationRepository.GetExaminationData(capture2).Name,
                TotalAttempts = data.Count,
                ResultList    = data
            };

            ViewBag.NeededExamId = capture2;
            return(View(info));// ReportSheet(info);
        }