Пример #1
0
        public override object Get()
        {
            var typeControl = H.l(LabelFor(x => x.Type), SelectFor(x => x.Type,
                                                                   NamedIdCache <TestQuestionType> .List, x => x.Name, x => x.Id));

            if (Model.Id > 0)
            {
                typeControl = H.l(LabelFor(x => x.Type), div.Class("editor-div")[
                                      TestQuestionType.GetName(Model.Type)], HiddenFor(x => x.Type));
            }
            return(l(
                       Tabs(_.List("Вопрос", "Файл"),
                            AjaxForm(Url.Action <TestEditController>(x => x.EditQuestion(null)))[
                                HiddenFor(x => x.Id),
                                HiddenFor(x => x.TestId),
                                ControlFor(x => x.Description),
                                typeControl,
                                Select2For(Model.TestModule.GetOrDefault(x => x.Name), x => x.ModuleId,
                                           Url.Action <TestEditController>(c => c.GetModulesAuto(Model.TestId, null))),
                                SaveButton()
                            ], TestControls.TestFileUpload(TestControls.QuestionFileView(Model.Id, true),
                                                           Url.Action <TestEditController>(c => c.UploadQuestionFile(Model.Id, null)),
                                                           Url.Action <TestEditController>(c => c.DeleteQuestionFile(Model.Id)),
                                                           Url.Action <TestEditController>(c => c.GetQuestionFileControl(Model.Id)),
                                                           Model.Id == 0
                                                           ))));
        }
Пример #2
0
 public static TagDiv QuestionView(TestQuestion x, int count, int i, bool hideCount = false)
 {
     return(div.Style("border-bottom:1px solid;").Class("test-question-id-" + x.Id)[
                h3["Вопрос" + (hideCount ? "" : " {0}/{1}".FormatWith(i + 1, count))],
                p[TestText(x.Description)],
                TestControls.QuestionFileView(x.Id, false, true),
                div[AnswerPart(x)]]);
 }
Пример #3
0
 public object QuestionView(TestQuestion model, int index, int count)
 {
     return(div
            .Class(GetQuestionClass(model) + " test-question entity-id-" + model.Id)[
                h2["Вопрос {0} из {1}".FormatWith(index + 1, count)],
                button.Class("mark-button")["Отметить"].Title("Отметьте вопрос, что бы потом к нему вернуться"),
                p[TestReadOnlyView.TestText(model.Description), div.Style("margin:5px;")[TestControls.QuestionFileView(model.Id, false)]],
                AnswerPart(model)].Style("display:none;"));
 }