<div class="modal center" ng-controller="CourseRelatedQuestionTypeCtrl">
<div cg-busy="{promise:myPromise,message:'正在加载...'}"></div>
<div class="modal-dialog" style="max-width: 1200px;width: 1200px;max-height:630px;overflow-y:auto;margin-top: 60px;">
<div class="modal-content">
	<div class="modal-header">
				<button type="button" class="close" aria-label="Close"
					ng-click="$hide()">
					<span aria-hidden="true">×</span>
				</button>
				<h4 class="modal-title">课程： {{course.code}} - {{course.name}}</h4>
	</div>
	<div class="modal-body">
	<div class="row">
	<div class="col-sm-5">
		<div class="form-inline">
			<label>未选中的题型：</label>
			<div class="input-group">
	      		<div class="input-group-addon"><i class="glyphicon glyphicon-search"></i></div>
				<input type="text" class="form-control" ng-model="search.keyword" placeholder="题型编号或题型名称" ng-change="search()" />
			</div>
		</div>
	  <table class="table table-striped table-bordered">
	  	<tr>
	  		<th class="col-sm-4">题型编号</th>
	  		<th>题型名称</th>
	  		<th>默认分值</th>
	  		<th>操作</th>
	 	</tr>
	 	<tr ng-repeat="row in pageModel.array">
	 		<td>{{row.code}}</td>
			<td>{{row.name}}</td>
			<td>{{row.defaultScore}}</td>
			<td>
				<button ng-click="addRelatedQuestionType(row)" class="btn btn-default btn-xs">
					<i class="glyphicon glyphicon-arrow-right"></i>								
				</button>
			</td>
	 	</tr>
	  </table>
	  <nav ng-if="pageModel.totalPage > 1">
		<ul class="pagination">
		  	<li class="{{pageModel.curPage == 1 ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage - 1)">
				<a aria-label="Previous"><span aria-hidden="true"> 上一页</span></a>
	      	</li>
		    <li class="{{pageModel.curPage == pageModel.totalPage ? 'disabled' : ''}}" ng-click="goPage(pageModel.curPage + 1)">
		      	<a aria-label="Next"><span aria-hidden="true"> 下一页</span></a>
		    </li>
	    </ul>
    </nav>
	</div>
	<div class="col-sm-7">
		<span>已选中的题型：</span>
	  <table class="table table-striped table-bordered">
	  	<tr>
	  		<th>操作</th>
	  		<th>题型编号</th>
	  		<th>题型名称</th>
	  		<th>默认分值</th>
	 	</tr>
	 	<tr ng-repeat="row in relatedQuestionTypes" class="{{row.inCourseStatus == 1 ? 'text-success' : ''}}">
	 		<td>
				<button ng-click="deleteRelatedQuestionType(row)" class="btn btn-danger btn-xs">
					<i class="glyphicon glyphicon-trash"></i>								
				</button>
				<button ng-click="enableRelatedQuestionType(row)" class="btn btn-success btn-xs" ng-if="row.inCourseStatus == 0" title="启用">
					<i class="glyphicon glyphicon glyphicon-ok"></i>								
				</button>
			</td>
			<td style="display: none" ng-model="sortNo">{{sortNo}}</td>
			<td>{{row.code}}</td>
	 		<td>
	 			<button class="btn btn-success btn-xs" ng-click="questionTypeUp($index)" ng-if="$index != 0">
					<i class="glyphicon glyphicon-chevron-up"></i>								
				</button>
				<button class="btn btn-info btn-xs" ng-click="questionTypeDown($index)" ng-if="$index != relatedQuestionTypes.length-1">
					<i class="glyphicon glyphicon-chevron-down"></i>								
				</button>
				{{row.name}}
			</td>
	 		<td>{{row.defaultScore}}</td>
	 	</tr>
	  </table>
	</div>
    </div>
    </div>
    </div>
</div>
</div>
