示例#1
0
        public override object Get()
        {
            var courseControl = Select2For(Model.CourseName, x => x.Test.CourseTCList,
                                           Url.Action <TestEditController>(c => c.GetCoursesAuto(null)));

            if (Model.Test.CompanyId.HasValue)
            {
                courseControl = null;
            }

            return(l(
                       AjaxForm(Url.Action <TestEditController>(x => x.EditTest((TestEditVM)null)))[
                           Tabs(_.List("Тест", "Условия прохождения", "Проценты модулей"),
                                l(
                                    HiddenFor(x => x.Test.Id),
                                    ControlFor(x => x.Test.Name),
                                    ControlFor(x => x.Test.Description),
                                    courseControl
                                    ),
                                l(
                                    HiddenFor(x => x.Test.TestPassRule.Id),
                                    ControlFor(x => x.Test.TestPassRule.Time),
                                    ControlFor(x => x.Test.TestPassRule.QuestionCount),
                                    ControlFor(x => x.Test.TestPassRule.PassMark),
                                    ControlFor(x => x.Test.TestPassRule.AverageMark),
                                    ControlFor(x => x.Test.TestPassRule.ExpertMark)
                                    ),
                                l(
                                    TestControls.ModulePercentsView(Model.ModulePercents, Model.Modules)
                                    )

                                ),
                           SaveButton()
                       ]));
        }
示例#2
0
        public override object Get()
        {
            var names = _.List("Тест");

            if (Model.Modules.Any())
            {
                names.Add("Проценты модулей");
            }
            return(l(
                       AjaxForm(Url.Action <GroupTestController>(x => x.EditGroupTest(null)))[
                           Tabs(names,
                                l(
                                    AutocompleteFor(Model.GroupTest.Test.GetOrDefault(x => x.Name), x => x.GroupTest.TestId,
                                                    Url.Action <GroupTestController>(c => c.GetTestsAuto(Model.GroupTest.GroupInfoId, null))),
                                    HiddenFor(x => x.GroupTest.Id),
                                    ControlFor(x => x.GroupTest.DateBegin),
                                    ControlFor(x => x.GroupTest.DateEnd),
                                    ControlFor(x => x.GroupTest.AttemptCount),
                                    HiddenFor(x => x.GroupTest.GroupInfoId),
                                    HiddenFor(x => x.GroupTest.TestPassRule.Id),
                                    ControlFor(x => x.GroupTest.TestPassRule.Time),
                                    ControlFor(x => x.GroupTest.TestPassRule.QuestionCount),
                                    ControlFor(x => x.GroupTest.TestPassRule.PassMark),
                                    ControlFor(x => x.GroupTest.TestPassRule.AverageMark),
                                    ControlFor(x => x.GroupTest.TestPassRule.ExpertMark)
                                    ),
                                TestControls.ModulePercentsView(Model.ModulePercents, Model.Modules)
                                ), SaveButton()
                       ]));
        }
示例#3
0
 object Modules()
 {
     return(TestControls.ModulePercentsView(Model.ModulePercents, Model.Modules));
 }