<wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>

<view class="exam-page p10">

	<view class="view-wrap">
    <view class="exam-count-down">{{remainTimeStr}}</view>
	</view>
	<view class="view-wrap-hidden">
	</view>
	

	<i-panel i-class="exam-panel-title" >
		<i-cell-group i-class="exam-cell">
			<!-- 单选题 -->
			<i-cell wx:if="{{item.type==2}}">
				<view>
					<rich-text nodes="[单]{{item.title}}" />
					<radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
						<label class="radio" wx:for="{{preList}}" wx:for-item="answer" wx:key="anserIndex"
							wx:if="{{item['answer'+(index+1)]}}">
							<view class="radio-answer">
								<radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
									{{answer}}. {{item['answer'+(index+1)]}}
								</radio>
							</view>
						</label>
					</radio-group>
				</view>
			</i-cell>
			<!-- 多选题 -->
			<i-cell wx:if="{{item.type==3}}">
				<view>
					<text> [多]{{item.title}} </text>
					<checkbox-group class="checkbox-answer" style="margin-top:10rpx" bindchange="checkboxChange">
						<label class="checkbox" wx:for="{{preList}}" wx:key="index" wx:for-item="answer"
							wx:if="{{item['answer'+(index+1)]}}">
							<view class="checkbox-answer">
								<checkbox color="#2d8cf0" value="{{index+1}}" checked="{{filter.isSelect( index+1, item.select)}}">
									{{answer}}. {{item['answer'+(index+1)]}}
								</checkbox>
							</view>
						</label>
					</checkbox-group>
				</view>
			</i-cell>
			<!-- 判断 -->
			<i-cell wx:if="{{item.type==1}}">
				<view>
					<rich-text nodes="[判]{{item.title}}" />
					<radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
						<label class="radio" wx:for="{{2}}" wx:for-item="answer">
							<view class="radio-answer">
								<radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
									{{preList[index]}}. {{item['answer'+(index+1)]}}
								</radio>
							</view>
						</label>
					</radio-group>
				</view>
			</i-cell>
		</i-cell-group>

		<view class="tc">
			<button  type="primary" size="mini" bindtap='nextAnswer'>下一题</button>
			<button  type="primary" size="mini" bindtap='dosubmit' class="ml20">交卷</button>
		</view>
	</i-panel>
</view>

<view class="bg-white p20">
	<i-row wx:for="{{10}}" wx:for-index="row">
		<i-col  wx:for="{{5}}" wx:for-index="cell" style="float:left;width:20%;text-alignP:center">
			<view class="item-select {{filter.isExamSelect( 5*row+cell, info)}} " 
				bindtap="selectquestion" data-index="{{5*row+cell}}" > {{5*row+cell+1}} </view>
		</i-col>
	</i-row>
</view>


<i-modal title="考试结果" visible="{{modalShow}}" bind:ok="returnRecord" bind:cancel="returnRecord">
	<view>我的战绩：{{score}} </view>
</i-modal>

<i-action-sheet visible="true" visible="{{timeOutShow}}" mask-closable="{{ false }}">
	<view slot="header" style="padding: 16px">
		<view class="exam-timeout-title">考试试卷结束，请提交试卷！</view>
		<button class="i-btn  i-btn-primary i-btn-square"  bindtap='dosubmit'>提交</button>
	</view>
</i-action-sheet>