<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改题库管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-question-edit" th:object="${tdQuestion}">
            <input name="ID" th:field="*{ID}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">题库类型：</label>
                <div class="col-sm-8">
                    <select name="TYPEID" required class="form-control m-b" th:with="type=${@dict.getType('td_question_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{TYPEID}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">问题描述：</label>
                <div class="col-sm-8">
                    <input name="qSubject" required th:field="*{qSubject}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">选项A：</label>
                <div class="col-sm-8">
                    <input name="OPTIONA" required th:field="*{OPTIONA}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">选项B：</label>
                <div class="col-sm-8">
                    <input name="OPTIONB" required th:field="*{OPTIONB}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">选项C：</label>
                <div class="col-sm-8">
                    <input name="OPTIONC" required th:field="*{OPTIONC}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">选项D：</label>
                <div class="col-sm-8">
                    <input name="OPTIOND" required th:field="*{OPTIOND}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">答案：</label>
                <div class="col-sm-8">
                    <input name="NOTE" required th:field="*{NOTE}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/question";
        $("#form-question-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-question-edit').serialize());
            }
        }

        $("input[name='CREATEDATE']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>