qa-education-exam-weapp/pages/exam/examination/examination.wxml

121 lines
7.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<wxs module="tool" src="../../../utils/util.wxs"></wxs>
<view class="content">
<view class="top">
<view class="option" style="height:350rpx;">
<van-image width="700rpx" height="330rpx" src="/assets/images/exam/examination/bgimg1.png" />
<view class="head-text">
考试科目:{{ EXAMNAME }}
</view>
<view class="questions">
<view>当前试题{{ current+1 }}/{{ topic.length }}</view>
</view>
<view class="time" wx:if="{{ SIMULATION == 0 }}">
<view style="display: flex;font-size: 28rpx;">
剩余考试时间:
<van-count-down bind:finish="fnCountDownFinish" time="{{ time }}" format="HH时mm分ss秒" />
<!-- <van-count-down use-slot time="{{ time }}" bind:change="countDownChange">
<text class="text-white ml-10">剩余时间:</text>
<text class="text-white">{{ timeData.minutes }}:</text>
<text class="text-white">{{ timeData.seconds }}</text>
</van-count-down> -->
</view>
</view>
</view>
</view>
<view class="question-info">
<view class="container">
<van-tag type="primary" size="small">
<block wx:if="{{topic[current].QUESTIONTYPE === '1'}}">单选题</block>
<block wx:if="{{topic[current].QUESTIONTYPE === '2'}}">多选题</block>
<block wx:if="{{topic[current].QUESTIONTYPE === '3'}}">判断题</block>
<block wx:if="{{topic[current].QUESTIONTYPE === '4'}}">填空题</block>
</van-tag>
<text class="index">{{current + 1}}.</text>
<text class="stem">{{topic[current].QUESTIONDRY}}</text>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '1'}}">
<view class="option" bind:tap="chooseTopic" data-type="radio" data-check="A">
<text class="choice {{topic[current].CHECK === 'A' ? 'check' : ''}} {{topic[current].ANSWER === 'A' ? (topic[current].ANSWERRIGHT === 'A' ? 'success' : 'error') : ''}}">A</text>
<text class="title">{{topic[current].OPTIONA}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="radio" data-check="B">
<text class="choice {{topic[current].CHECK === 'B' ? 'check' : ''}} {{topic[current].ANSWER === 'B' ? (topic[current].ANSWERRIGHT === 'B' ? 'success' : 'error') : ''}}">B</text>
<text class="title">{{topic[current].OPTIONB}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="radio" data-check="C">
<text class="choice {{topic[current].CHECK === 'C' ? 'check' : ''}} {{topic[current].ANSWER === 'C' ? (topic[current].ANSWERRIGHT === 'C' ? 'success' : 'error') : ''}}">C</text>
<text class="title">{{topic[current].OPTIONC}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="radio" data-check="D">
<text class="choice {{topic[current].CHECK === 'D' ? 'check' : ''}} {{topic[current].ANSWER === 'D' ? (topic[current].ANSWERRIGHT === 'D' ? 'success' : 'error') : ''}}">D</text>
<text class="title">{{topic[current].OPTIOND}}</text>
</view>
</view>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '2'}}">
<view class="option" bind:tap="chooseTopic" data-type="multiple" data-check="A">
<text class="choice {{tool.indexOf(topic[current].CHECK,'A') !== -1 ? 'check' : ''}} {{tool.indexOf(topic[current].ANSWER,'A') !== -1 ? (tool.indexOf(topic[current].ANSWERRIGHT,'A') !== -1 ? 'success' : 'error') : ''}}">A</text>
<text class="title">{{topic[current].OPTIONA}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="multiple" data-check="B">
<text class="choice {{tool.indexOf(topic[current].CHECK,'B') !== -1 ? 'check' : ''}} {{tool.indexOf(topic[current].ANSWER,'B') !== -1 ? (tool.indexOf(topic[current].ANSWERRIGHT,'B') !== -1 ? 'success' : 'error') : ''}}">B</text>
<text class="title">{{topic[current].OPTIONB}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="multiple" data-check="C">
<text class="choice {{tool.indexOf(topic[current].CHECK,'C') !== -1 ? 'check' : ''}} {{tool.indexOf(topic[current].ANSWER,'C') !== -1 ? (tool.indexOf(topic[current].ANSWERRIGHT,'C') !== -1 ? 'success' : 'error') : ''}}">C</text>
<text class="title">{{topic[current].OPTIONC}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="multiple" data-check="D">
<text class="choice {{tool.indexOf(topic[current].CHECK,'D') !== -1 ? 'check' : ''}} {{tool.indexOf(topic[current].ANSWER,'D') !== -1 ? (tool.indexOf(topic[current].ANSWERRIGHT,'D') !== -1 ? 'success' : 'error') : ''}}">D</text>
<text class="title">{{topic[current].OPTIOND}}</text>
</view>
</view>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '3'}}">
<view class="option" bind:tap="chooseTopic" data-type="judge" data-check="A">
<text class="choice {{topic[current].CHECK === 'A' ? 'check' : ''}} {{topic[current].ANSWER === 'A' ? (topic[current].ANSWERRIGHT === 'A' ? 'success' : 'error') : ''}}">A</text>
<text class="title">{{topic[current].OPTIONA}}</text>
</view>
<view class="option" bind:tap="chooseTopic" data-type="judge" data-check="B">
<text class="choice {{topic[current].CHECK === 'B' ? 'check' : ''}} {{topic[current].ANSWER === 'B' ? (topic[current].ANSWERRIGHT === 'B' ? 'success' : 'error') : ''}}">B</text>
<text class="title">{{topic[current].OPTIONB}}</text>
</view>
</view>
<view class="options" wx:if="{{topic[current].QUESTIONTYPE === '4'}}">
<view class="option">
<van-field value="{{ topic[current].CHECK }}" placeholder="请输入答案" border="{{ true }} " bind:change="onChange" />
</view>
</view>
<view class="answer" wx:if="{{type === 'practice' && topic[current].ANSWER}}">
正确答案:{{topic[current].ANSWERRIGHT}}
</view>
<view class="answer" wx:if="{{type === 'practice' && topic[current].ANSWER && topic[current].DESCR}}">
答案解析:{{topic[current].DESCR}}
</view>
</view>
<view class="button">
<van-button color="#d0d0d2" custom-style="color:#000;border-radius: 10rpx;width:{{current === topic.length - 1 ? 630 : 280}}rpx;" size="large" wx:if="{{current !== 0}}" bind:click="previousQuestion">
上一题
</van-button>
<van-button type="info" custom-style="border-radius: 10rpx;width:{{current === 0 ? 630 : 280}}rpx;" size="large" wx:if="{{current !== topic.length - 1}}" bind:click="nextQuestion">
下一题
</van-button>
</view>
</view>
<view class="footer">
<van-button color="linear-gradient(to right, #00ccff, #3676f2)" round size="small" wx:if="{{type !== 'practice'}}" bind:click="submitPapers">
交卷
</van-button>
<van-button color="linear-gradient(to right, #00ccff, #3676f2)" round size="small" wx:if="{{type === 'practice'}}" bind:click="viewAnswers">
查看答案
</van-button>
<view class="surplus">
<!-- <van-icon name="../../../assets/images/fenlei.png" /> -->
<view class="ml-10">
<text class="text-blue">{{current + 1}} </text>
<text>/ {{topic.length}}</text>
</view>
</view>
</view>
<van-dialog id="nation"></van-dialog>
</view>
<!-- 引入.wxs文件 src为相对路径module指定当前模块的名称 -->
<wxs module="filter" src="./func.wxs"></wxs>