Exemple #1
0
        public ActionResult BySubmissionSimilarity()
        {
            var viewModel = new SubmissionSimilarityFiltersInputModel
            {
                PlagiarismDetectorTypes = DropdownViewModel.GetEnumValues <PlagiarismDetectorType>()
            };

            return(this.View(viewModel));
        }
        public ActionResult GetSubmissions(int id)
        {
            if (!this.CheckIfUserHasProblemPermissions(id))
            {
                return(this.RedirectToContestsAdminPanelWithNoPrivilegesMessage());
            }

            this.ViewBag.SubmissionStatusData = DropdownViewModel.GetEnumValues <SubmissionStatus>();
            return(this.PartialView("_SubmissionsGrid", id));
        }
        private void PrepareViewBagData(int?contestId = null)
        {
            this.ViewBag.TypeData = DropdownViewModel.GetEnumValues <ContestType>();
            this.ViewBag.SubmissionExportTypes = DropdownViewModel.GetEnumValues <SubmissionExportType>();

            if (contestId.HasValue)
            {
                // TODO: find a better solution for determining whether a Contest is active or not
                this.ViewBag.IsActive = this.contestsData.IsActiveById(contestId.Value);
            }
        }
        public ActionResult GetSubmissions(int id)
        {
            if (!this.CheckIfUserHasProblemPermissions(id))
            {
                this.TempData[GlobalConstants.DangerMessage] = "Нямате привилегиите за това действие";
                return(this.RedirectToAction("Index", "Contests", new { area = "Administration" }));
            }

            this.ViewBag.SubmissionStatusData = DropdownViewModel.GetEnumValues <SubmissionStatus>();
            return(this.PartialView("_SubmissionsGrid", id));
        }
Exemple #5
0
        public ActionResult GetSubmissions(int id)
        {
            if (!this.CheckIfUserHasProblemPermissions(id))
            {
                this.TempData.AddDangerMessage(GlobalConstants.NoPrivilegesMessage);
                return(this.RedirectToAction("Index", "Contests", new { area = "Administration" }));
            }

            this.ViewBag.SubmissionStatusData = DropdownViewModel.GetEnumValues <SubmissionStatus>();
            return(this.PartialView("_SubmissionsGrid", id));
        }
        private void AddCheckersAndProblemGroupsToProblemViewModel(
            ViewModelType problem,
            int numberOfProblemGroups,
            bool isOnlineContest)
        {
            problem.AvailableCheckers = this.checkersData
                                        .GetAll()
                                        .Select(checker => new SelectListItem
            {
                Text     = checker.Name,
                Value    = checker.Name,
                Selected = checker.Name.Contains("Trim")
            });

            if (isOnlineContest && numberOfProblemGroups > 0)
            {
                this.ViewBag.ProblemGroupIdData = this.problemGroupsData
                                                  .GetAllByContest(problem.ContestId)
                                                  .OrderBy(pg => pg.OrderBy)
                                                  .Select(DropdownViewModel.FromProblemGroup);
            }

            this.ViewBag.ProblemGroupTypeData = DropdownViewModel.GetEnumValues <ProblemGroupType>();
        }
Exemple #7
0
 private void PrepareViewBagData()
 {
     this.ViewBag.TypeData = DropdownViewModel.GetEnumValues <ContestType>();
     this.ViewBag.SubmissionExportTypes = DropdownViewModel.GetEnumValues <SubmissionExportType>();
 }
Exemple #8
0
 public ActionResult Index()
 {
     this.ViewBag.SubmissionStatusData = DropdownViewModel.GetEnumValues <SubmissionStatus>();
     return(this.View());
 }
Exemple #9
0
 public ActionResult RenderGrid(int?id)
 {
     this.ViewBag.SubmissionStatusData = DropdownViewModel.GetEnumValues <SubmissionStatus>();
     return(this.PartialView("_SubmissionsGrid", id));
 }
Exemple #10
0
 private void PrepareViewBagData() =>
 this.ViewBag.TypeData = DropdownViewModel.GetEnumValues <ProblemGroupType>();