<template>
	<view class='wrap'>
		<view class="subTitle">
			考试信息
		</view>
		<view class="examContent">
			<view>考试名称：<text>{{currentExam.name}}</text> </view>
			<view>考试总分：<text>{{currentExam.paper_.total_score}}</text>分</view>
			<view v-if="currentExam.limit>0">考试时长：<text>{{currentExam.limit}}</text>分钟</view>
			<view v-else>考试时长：<text>不限时长</text></view>
			<view>题目分布：单选<text>{{currentExam.paper_.danxuan_count}}</text>道;多选<text>{{currentExam.paper_.duoxuan_count}}</text>道;判断<text>{{currentExam.paper_.panduan_count}}</text>道</view>
			<view>判分规则：单选{{currentExam.paper_.danxuan_score}}分,多选{{currentExam.paper_.duoxuan_score}}分,多选{{currentExam.paper_.panduan_score}}分,错选少选均不得分</view>
		</view>
		<view class="subTitle">答题须知</view>
		<view class="tipsArea">
			<ul>
				<li>1.进入答题后请不要后退或返回。</li>
				<li>2.可点击上一题/下一题切换。</li>
				<li>3.可点击答题卡复查</li>
				<li>4.请合理安排时间答题,可提前交卷</li>
			</ul>
		</view>
		<u-button type="primary" @click="start()">开始答题</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentExam:{}
			}
		},
		onLoad() {
			this.currentExam = uni.getStorageSync('currentExam')
		},
		methods: {
			start(){
				this.$u.api.startExam(this.currentExam.id).then(res=>{
					let currentExam =uni.getStorageSync('currentExam');
					currentExam.examrecord = res.data.examrecord;
					currentExam.questions_ = res.data.questions_;
					uni.setStorageSync('currentExam',currentExam)
					uni.reLaunch({
						url:'/pages/exam/main'
					})
				})
				
			}
		}
	}
</script>

<style lang="scss" scoped>
.wrap{
		padding: 24rpx;
		font-size: 32rpx;
	}
.subTitle {
		font-size: $u-font-size-title;
		font-weight: bold;
		color: $theme-color;
		text-align: center;
		margin: 40rpx auto 20rpx auto;
	}
.examContent {
		line-height: 50rpx;
		margin-left: 80rpx;
		text {
			font-weight: bold;
			color:$u-type-warning-dark;
		}
	}
	.tipsArea {
		padding: 0 40rpx;
		margin-left: 0rpx;
		margin-bottom: 30rpx;
	}
	ul {
		margin: 0 30rpx;
		line-height: 50rpx;
	}
</style>
