<div class="panel panel-default mg" cg-busy="{promise:loading,message:loadingMsg}">
<div class="panel-body">
<form class="form-inline {{submitted ? 'submitted' : ''}}" name="form" novalidate ng-submit="submit()">
	<div>
		<div class="form-group">
			<label>课程</label><label class="text-danger">*</label>
			<select class="form-control" disabled ng-if="model.id != null" ng-model="model.courseId" style="width:170px;" ng-change="changeCourse()">
	      		<option ng-repeat="item in courses" value="{{item.id}}" ng-selected="model.courseId == item.id">
	      			{{item.code}} - {{item.name}}
      			</option>
  			</select>
			<select class="form-control" ng-if="model.id == null" ng-model="model.courseId" style="width:170px;" ng-change="changeCourse()">
	      		<option ng-repeat="item in courses" value="{{item.id}}" ng-selected="model.courseId == item.id">
	      			{{item.code}} - {{item.name}}
      			</option>
  			</select>
		</div>
		<div class="form-group">
			<label>教材</label><label class="text-danger">*</label>
			<select class="form-control" ng-model="model.book" style="width:170px;" ng-options="item.name for item in (books | filter:{courseId : model.courseId}) track by item.id">
     		</select>
		</div>
		<div class="form-group">
			<label>题型</label><label class="text-danger">*</label>
			<select class="form-control" ng-model="model.typeId" style="width:150px;" ng-change="changeQuestionType()">
	      		<option ng-repeat="item in questionTypes" value="{{item.id}}" ng-selected="model.typeId == item.id">
	      			{{item.name}}
      			</option>
     		</select>
		</div>
		<div class="form-group">
			<label>知识点</label><label class="text-danger">*</label>
			<input type="text" min-value=0 max-value=999999 valid-input-value-range
				 class="form-control" ng-model="model.chapter" placeholder="章*" style="width:60px;" required ng-trim="true">
			<input type="text" min-value=0 max-value=999999 valid-input-value-range class="form-control" ng-model="model.section" ng-trim="true" placeholder="节" style="width:40px;">
			<input type="text" min-value=0 max-value=999999 valid-input-value-range class="form-control" ng-model="model.item" ng-trim="true" placeholder="目" style="width:40px;">
			<input type="text" min-value=0 max-value=999999 valid-input-value-range class="form-control" ng-model="model.page" ng-trim="true" placeholder="页" style="width:40px;">
		</div>
		<div class="form-group">
			<label>试题编号</label>
			<input type="text" readOnly class="form-control" ng-model="model.questionNo" placeholder="试题编号" style="width:150px;">
		</div>
	</div>
	<div class="m-t">
		<div class="form-group">
			<label>分值</label><label class="text-danger">*</label>
			<input type="number" class="form-control" ng-model="model.score" placeholder="分值" 
				style="width:100px;" ng-required="true" 
				min-value=0 max-value=100 valid-input-value-range>
		</div>
		<div class="form-group">
			<label>能力要求</label><label class="text-danger">*</label>
			<select class="form-control" ng-model="model.abilityCode" ng-required="true">
	      		<option ng-repeat="item in codes | filter:{itemType: 'ABILITY'}" value="{{item.itemCode}}">
	      			{{item.itemValue}}
      			</option>
     		</select>
		</div>
		<div class="form-group">
			<label>考核要求</label><label class="text-danger">*</label>
			<select class="form-control" ng-model="model.assessmentDemand" ng-required="true">
	      		<option ng-repeat="item in codes | filter:{itemType: 'ASSESSMENT_DEMAND'}" value="{{item.itemCode}}">
	      			{{item.itemValue}}
      			</option>
     		</select>
		</div>
		<div class="form-group">
			<label>预计难度</label><label class="text-danger">*</label>
			<select class="form-control" ng-model="model.estimateDifficultyCode" ng-required="true">
	      		<option ng-repeat="item in codes | filter:{itemType: 'QUESTION_DIFFICULTY'}" value="{{item.itemCode}}">
	      			{{item.itemValue}}
      			</option>
     		</select>
		</div>
		<div class="form-group">
			<label>命题教师</label>
			<select class="form-control" ng-model="model.teacher" style="width:170px;" ng-options="item.name for item in teachers track by item.name">
     		</select>
		</div>
		<div class="form-group">
			<label>命题时间</label>
			 <input type="text" data-date-format="yyyy-MM-dd" ng-model="model.setTime" class="form-control" 
      			data-autoclose="1" bs-datepicker />
		</div>
		<div class="form-group">
			<label>启用时间</label>
			 <input type="text" class="form-control" ng-model="model.enableTimeYear" maxlength="4" ngMinlength="4" ng-pattern="/^[1-2][0-9]{3}$/" ng-trim="true" style="width: 90px;display: inline;">年-
			 <select class="form-control" ng-model="model.enableTimeMonth" style="width: 80px;display: inline;" ng-options="item for item in months track by item"></select>月
		</div>
	</div>
	<div class="m-t">
		<div class="form-group">
			<label>题干</label><label class="text-danger">*</label>
			<textarea ckeditor class="form-control" ng-model="model.body" rows="6" width="700px" height="100px"  ng-required="true">
	    	</textarea>
	    	
		</div>
	</div>
	<div class="m-t" ng-show="!model.options || model.options.length == 0">
		<div class="form-group">
			<label>答案与解析</label><label class="text-danger">*</label>
			<textarea ckeditor class="form-control" ng-model="model.answer" rows="3" width="700px" height="100px">
	    	</textarea>
		</div>
	</div>
	<div class="m-t"  ng-show="model.options && model.options.length == 4">
		<div class="form-group">
			<label>选项</label><label class="text-danger">*</label>
			<ul class="list-group" style="margin-left:70px;">
				<li class="list-group-item" ng-repeat="option in model.options">
					<label><input type="radio" value="{{option.optionNo}}" ng-model="model.correctOptionNo"  ng-checked="option.isCorrectOption == 1">
						{{option.optionNo | optionNoStr}}.</label>
					<textarea ckeditor class="form-control" ng-model="option.content" rows="1" width="700px" height="40px" ng-required="true"></textarea>
				</li>
			</ul>
		</div>
	</div>
	<div class="m-t"  ng-show="model.options && model.options.length == 5">
		<div class="form-group">
			<label>选项</label><label class="text-danger">*</label>
			<ul class="list-group" style="margin-left:70px;">
				<li class="list-group-item" ng-repeat="option in model.options">
					<label><input type="checkbox" ng-model="option.checked">
						{{option.optionNo | optionNoStr}}.</label>
					<textarea ckeditor class="form-control" ng-model="option.content" rows="1" width="700px" height="40px"></textarea>
				</li>
			</ul>
		</div>
	</div>

  	<div class="m-t">
	  <div class="form-group">
	    <div class="col-sm-offset-5 col-sm-7">
	      <button type="submit" class="btn btn-info btn-lg">保存</button>
	    </div>
	  </div>
  	</div>
</form>
    </div>
</div>
