培训管理
parent
7c245ffe68
commit
f939db5e07
|
@ -1,476 +1,428 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="top">
|
||||
<view class="time">
|
||||
<text style="margin-right: 14rpx" class="iconfont"></text>
|
||||
<text>倒计时:</text>
|
||||
<u-count-down :time="info.ANSWERSHEETTIME * 60 * 1000" format="mm 分 ss 秒" auto-start millisecond @finish="fnCountDownFinish" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="top">
|
||||
<image src="/static/images/study/bgimg1.png" />
|
||||
<view class="suject">
|
||||
<text class="line-2">考试科目:{{ info.examname }}</text>
|
||||
</view>
|
||||
<view class="questions">
|
||||
<text>当前试题{{ current + 1 }}/{{ options.length }}</text>
|
||||
</view>
|
||||
<view class="time">
|
||||
<text>考试剩余时间:</text>
|
||||
<u-count-down
|
||||
:time="info.answersheettime * 60 * 1000"
|
||||
format="HH 时 mm 分 ss 秒"
|
||||
@finish="fnCountDownFinish"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="topic">
|
||||
<view class="title">
|
||||
<text>
|
||||
<text class="tag_title">
|
||||
{{ handleCalcQuestType(options[current].QUESTIONTYPE) }}
|
||||
</text>
|
||||
{{ current + 1 }}.{{ options[current].QUESTIONDRY }}
|
||||
</text>
|
||||
</view>
|
||||
<view v-show="options[current].QUESTIONTYPE === '1'" class="options">
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
|
||||
<text class="option">A</text>
|
||||
<text class="text">{{ options[current].OPTIONA }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
|
||||
<text class="option">B</text>
|
||||
<text class="text">{{ options[current].OPTIONB }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
|
||||
<text class="option">C</text>
|
||||
<text class="text">{{ options[current].OPTIONC }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
|
||||
<text class="option">D</text>
|
||||
<text class="text">{{ options[current].OPTIOND }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].QUESTIONTYPE === '2'" class="options">
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
<view class="topic">
|
||||
<view class="title">
|
||||
<text>
|
||||
<text class="tag_title">
|
||||
{{ handleCalcQuestType(options[current].questiontype) }}
|
||||
</text>
|
||||
{{ current + 1 }}.{{ options[current].questiondry }}
|
||||
</text>
|
||||
</view>
|
||||
<view v-show="options[current].questiontype === '1'" class="options">
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
|
||||
<text class="option">A</text>
|
||||
<text class="text">{{ options[current].optiona }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
|
||||
<text class="option">B</text>
|
||||
<text class="text">{{ options[current].optionb }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
|
||||
<text class="option">C</text>
|
||||
<text class="text">{{ options[current].optionc }}</text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
|
||||
<text class="option">D</text>
|
||||
<text class="text">{{ options[current].optiond }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].questiontype === '2'" class="options">
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
'active': options[current].checked && options[current].checked.indexOf('A') !== -1
|
||||
}"
|
||||
@click="fnChooseTopic('multiple', 'A')"
|
||||
>
|
||||
<text class="option">A</text>
|
||||
<text class="text">{{ options[current].OPTIONA }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
@click="fnChooseTopic('multiple', 'A')"
|
||||
>
|
||||
<text class="option">A</text>
|
||||
<text class="text">{{ options[current].optiona }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
'active': options[current].checked && options[current].checked.indexOf('B') !== -1
|
||||
}"
|
||||
@click="fnChooseTopic('multiple', 'B')"
|
||||
>
|
||||
<text class="option">B</text>
|
||||
<text class="text">{{ options[current].OPTIONB }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
@click="fnChooseTopic('multiple', 'B')"
|
||||
>
|
||||
<text class="option">B</text>
|
||||
<text class="text">{{ options[current].optionb }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
'active': options[current].checked && options[current].checked.indexOf('C') !== -1
|
||||
}"
|
||||
@click="fnChooseTopic('multiple', 'C')"
|
||||
>
|
||||
<text class="option">C</text>
|
||||
<text class="text">{{ options[current].OPTIONC }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
@click="fnChooseTopic('multiple', 'C')"
|
||||
>
|
||||
<text class="option">C</text>
|
||||
<text class="text">{{ options[current].optionc }}</text>
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="{
|
||||
'active': options[current].checked && options[current].checked.indexOf('D') !== -1
|
||||
}"
|
||||
@click="fnChooseTopic('multiple', 'D')"
|
||||
>
|
||||
<text class="option">D</text>
|
||||
<text class="text">{{ options[current].OPTIOND }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].QUESTIONTYPE === '3'" class="options">
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
|
||||
<text class="option">{{ options[current].OPTIONA }}</text>
|
||||
<text class="text"></text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
|
||||
<text class="option">{{ options[current].OPTIONB }}</text>
|
||||
<text class="text"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].QUESTIONTYPE === '4'" class="options">
|
||||
<view class="item">
|
||||
<u-textarea v-model="options[current].checked" auto-height count />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion" />
|
||||
<u-button v-show="current !== options.length - 1" type="primary" :style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion" />
|
||||
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷" @click="fnHandInThePaper" />
|
||||
</view>
|
||||
@click="fnChooseTopic('multiple', 'D')"
|
||||
>
|
||||
<text class="option">D</text>
|
||||
<text class="text">{{ options[current].optiond }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].questiontype === '3'" class="options">
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
|
||||
<text class="option">{{ options[current].optiona }}</text>
|
||||
<text class="text"></text>
|
||||
</view>
|
||||
<view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
|
||||
<text class="option">{{ options[current].optionb }}</text>
|
||||
<text class="text"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-show="options[current].questiontype === '4'" class="options">
|
||||
<view class="item">
|
||||
<u-textarea v-model="options[current].checked" auto-height count/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footer">
|
||||
<u-button v-show="current !== 0" :style="{ width: '45%' }" text="上一题" @click="fnPreviousQuestion"/>
|
||||
<u-button v-show="current !== options.length - 1" type="primary"
|
||||
:style="{ width: current === 0 ? '100%' : '45%' }" text="下一题" @click="fnNextQuestion"/>
|
||||
<u-button v-show="current === options.length - 1" type="primary" :style="{ width: '45%' }" text="交卷"
|
||||
@click="fnHandInThePaper"/>
|
||||
</view>
|
||||
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
<u-toast ref="uToast"/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getExamExercises,
|
||||
// getStrengthenExam,
|
||||
setTestPaperSubmission,
|
||||
getExamExercises,
|
||||
// getStrengthenExam,
|
||||
setTestPaperSubmission,
|
||||
} from '@/api';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// STAGEEXAMPAPERINPUT_ID: '',
|
||||
// STAGEEXAMPAPER_ID: '',
|
||||
// CLASS_ID: '',
|
||||
// POST_ID: '',
|
||||
// STUDENT_ID: '',
|
||||
// NUMBEROFEXAMS: '',
|
||||
routeQuery: {},
|
||||
entrySite: '',
|
||||
info: {},
|
||||
options: [{}],
|
||||
current: 0,
|
||||
questionTypeMap: {
|
||||
1: '单选',
|
||||
2: '多选',
|
||||
3: '判断',
|
||||
4: '填空'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
this.routeQuery = query
|
||||
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
|
||||
// this.entrySite = query.entrySite;
|
||||
this.fnGetData()
|
||||
},
|
||||
onBackPress(event) {
|
||||
if (event.from === 'backbutton') {
|
||||
uni.$u.toast('考试过程中不允许退出')
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
computed: {
|
||||
userInfo() {
|
||||
return this.$store.getters.getUserInfo
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async fnGetData() {
|
||||
const { stageexampaperinputId, classId, postId, studentId, numberofexams } = this.routeQuery
|
||||
const resData = await getExamExercises({
|
||||
STAGEEXAMPAPERINPUT_ID: stageexampaperinputId,
|
||||
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID,
|
||||
CLASS_ID: classId,
|
||||
POST_ID: postId,
|
||||
STUDENT_ID: studentId,
|
||||
NUMBEROFEXAMS: numberofexams
|
||||
})
|
||||
// if (this.entrySite === "strengththen") {
|
||||
// resData = await getStrengthenExam({
|
||||
// STRENGTHEN_STAGEEXAMPAPER_INPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
|
||||
// CLASS_ID: this.CLASS_ID,
|
||||
// POST_ID: this.POST_ID,
|
||||
// STUDENT_ID: this.STUDENT_ID,
|
||||
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
|
||||
// });
|
||||
// } else {
|
||||
// resData = await getExamExercises({
|
||||
// STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
|
||||
// STAGEEXAMPAPER_ID: this.STAGEEXAMPAPER_ID,
|
||||
// CLASS_ID: this.CLASS_ID,
|
||||
// POST_ID: this.POST_ID,
|
||||
// STUDENT_ID: this.STUDENT_ID,
|
||||
// NUMBEROFEXAMS: this.NUMBEROFEXAMS,
|
||||
// });
|
||||
// }
|
||||
|
||||
// this.info = resData.pd;
|
||||
this.info = { ...this.info, ANSWERSHEETTIME: 30 }
|
||||
this.options = [
|
||||
{
|
||||
QUESTIONDRY: '题干题干题干题干题干1 ( ) .',
|
||||
QUESTIONTYPE: '1',
|
||||
OPTIONA: '这是选项A',
|
||||
OPTIONB: '这是选项B',
|
||||
OPTIONC: '这是选项C',
|
||||
OPTIOND: '这是选项D'
|
||||
},
|
||||
{
|
||||
QUESTIONDRY: '题干题干题干题干题干2 ()',
|
||||
QUESTIONTYPE: '2',
|
||||
OPTIONA: '这是选项A',
|
||||
OPTIONB: '这是选项B',
|
||||
OPTIONC: '这是选项C',
|
||||
OPTIOND: '这是选项D'
|
||||
},
|
||||
{
|
||||
QUESTIONDRY: '未带安全头盔可正常进入堆场进行工业,以上说法是否正确?',
|
||||
QUESTIONTYPE: '3',
|
||||
OPTIONA: '对',
|
||||
OPTIONB: '错'
|
||||
},
|
||||
{
|
||||
QUESTIONDRY: '当进入施工现场后, 应立刻对_____设施做全面检查?',
|
||||
QUESTIONTYPE: '4',
|
||||
OPTIONA: '对',
|
||||
OPTIONB: '错'
|
||||
}
|
||||
]
|
||||
// if (resData.NUMBEROFEXAMS > 0) {
|
||||
// uni.showModal({
|
||||
// title: "温馨提示",
|
||||
// content: `您还可以考试${resData.NUMBEROFEXAMS}次!`,
|
||||
// showCancel: false,
|
||||
// });
|
||||
// } else if (resData.NUMBEROFEXAMS === "-9999") {
|
||||
// uni.showModal({
|
||||
// title: "温馨提示",
|
||||
// content: `加强学习考试开始,限时60分钟,请注意答题时间!`,
|
||||
// showCancel: false,
|
||||
// });
|
||||
// } else {
|
||||
// uni.showModal({
|
||||
// title: "温馨提示",
|
||||
// content: `您无考试次数!`,
|
||||
// showCancel: false,
|
||||
// success: (res) => {
|
||||
// if (res.confirm) {
|
||||
// uni.navigateBack();
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// }
|
||||
},
|
||||
fnChooseTopic(type, checked) {
|
||||
if (!this.options[this.current].checked) {
|
||||
this.$set(this.options[this.current], 'checked', '')
|
||||
}
|
||||
if (type === 'judge' || type === 'radio') {
|
||||
if (this.options[this.current].checked === checked) {
|
||||
this.options[this.current].checked = ''
|
||||
} else {
|
||||
this.options[this.current].checked = checked
|
||||
}
|
||||
}
|
||||
if (type === 'multiple') {
|
||||
if (this.options[this.current].checked) {
|
||||
const checkedArr = this.options[this.current].checked.split(',')
|
||||
if (checkedArr.indexOf(checked) !== -1) {
|
||||
checkedArr.splice(checkedArr.indexOf(checked), 1)
|
||||
this.options[this.current].checked = checkedArr.join(',')
|
||||
} else {
|
||||
checkedArr.push(checked)
|
||||
checkedArr.sort()
|
||||
this.options[this.current].checked = checkedArr.join(',')
|
||||
}
|
||||
} else {
|
||||
this.options[this.current].checked = checked
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCalcQuestType(type) {
|
||||
return `(${this.questionTypeMap[type]})`
|
||||
},
|
||||
fnIsFinish() {
|
||||
if (!this.options[this.current].checked) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '请对本题进行作答。',
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
/**
|
||||
* 下一题按钮点击事件
|
||||
*/
|
||||
fnNextQuestion() {
|
||||
if (!this.fnIsFinish()) return
|
||||
this.current++
|
||||
},
|
||||
/**
|
||||
* 上一题按钮点击事件
|
||||
*/
|
||||
fnPreviousQuestion() {
|
||||
this.current--
|
||||
},
|
||||
/**
|
||||
* 交卷按钮点击事件
|
||||
*/
|
||||
fnHandInThePaper() {
|
||||
if (!this.fnIsFinish()) return
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: `题目已全部做完,确认交卷吗?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.fnSubmit()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fnCountDownFinish() {
|
||||
uni.$u.toast('考试时间已结束')
|
||||
for (let i = 0; i < this.options.length; i++) {
|
||||
if (!this.options[i].checked) {
|
||||
this.options[i].checked = ''
|
||||
}
|
||||
}
|
||||
this.fnSubmit()
|
||||
},
|
||||
async fnSubmit() {
|
||||
// uni.navigateBack({ delta: 2 })
|
||||
for (let i = 0; i < this.options.length; i++) {
|
||||
if (this.options[i].QUESTIONTYPE === "2") {
|
||||
this.options[i].checked = this.options[i].checked.replace(/,/g, "");
|
||||
}
|
||||
}
|
||||
const resData = await setTestPaperSubmission({
|
||||
USERNAME: this.userInfo.NAME,
|
||||
entrySite: this.entrySite,
|
||||
STAGEEXAMPAPERINPUT_ID: this.STAGEEXAMPAPERINPUT_ID,
|
||||
CLASS_ID: this.CLASS_ID,
|
||||
STUDENT_ID: this.STUDENT_ID,
|
||||
NUMBEROFEXAMS: this.NUMBEROFEXAMS,
|
||||
PASSSCORE: this.info.PASSSCORE,
|
||||
EXAMSCORE: this.info.EXAMSCORE,
|
||||
EXAMTIMEBEGIN: this.info.EXAMTIMEBEGIN,
|
||||
options: JSON.stringify(this.options),
|
||||
});
|
||||
if (resData.examResult === "0") {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: `您的成绩为${resData.examScore}分,很遗憾您没有通过本次考试,请再接再厉!`,
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
if (this.entrySite === "video_study")
|
||||
uni.navigateBack({ delta: 3 });
|
||||
else uni.navigateBack();
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: `您的成绩为${resData.examScore}分,恭喜您通过本次考试,请继续保持!`,
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
if (this.entrySite === "video_study")
|
||||
uni.navigateBack({ delta: 3 });
|
||||
else if (this.entrySite === "strengththen")
|
||||
uni.navigateBack({ delta: 2 });
|
||||
else uni.navigateBack();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
routeQuery: {},
|
||||
entrySite: '',
|
||||
info: {},
|
||||
options: [{}],
|
||||
current: 0,
|
||||
questionTypeMap: {
|
||||
1: '单选',
|
||||
2: '多选',
|
||||
3: '判断',
|
||||
4: '填空'
|
||||
},
|
||||
studentId:''
|
||||
}
|
||||
},
|
||||
onLoad(query) {
|
||||
this.routeQuery = query
|
||||
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
|
||||
// this.entrySite = query.entrySite;
|
||||
this.fnGetData()
|
||||
},
|
||||
onBackPress(event) {
|
||||
if (event.from === 'backbutton') {
|
||||
uni.$u.toast('考试过程中不允许退出')
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
methods: {
|
||||
async fnGetData() {
|
||||
const {stageexampaperinputId, classId, } = this.routeQuery
|
||||
const resData = await getExamExercises({
|
||||
stageexampaperinputId: stageexampaperinputId,
|
||||
classId: classId,
|
||||
})
|
||||
this.info = resData.info
|
||||
this.options = resData.inputQue
|
||||
this.studentId = resData.student.studentId
|
||||
if (resData.numberofexams > 0) {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: `您还可以考试${resData.numberofexams}次!`,
|
||||
showCancel: false,
|
||||
});
|
||||
}
|
||||
},
|
||||
fnChooseTopic(type, checked) {
|
||||
if (!this.options[this.current].checked) {
|
||||
this.$set(this.options[this.current], 'checked', '')
|
||||
}
|
||||
if (type === 'judge' || type === 'radio') {
|
||||
if (this.options[this.current].checked === checked) {
|
||||
this.options[this.current].checked = ''
|
||||
} else {
|
||||
this.options[this.current].checked = checked
|
||||
}
|
||||
}
|
||||
if (type === 'multiple') {
|
||||
if (this.options[this.current].checked) {
|
||||
const checkedArr = this.options[this.current].checked.split(',')
|
||||
if (checkedArr.indexOf(checked) !== -1) {
|
||||
checkedArr.splice(checkedArr.indexOf(checked), 1)
|
||||
this.options[this.current].checked = checkedArr.join(',')
|
||||
} else {
|
||||
checkedArr.push(checked)
|
||||
checkedArr.sort()
|
||||
this.options[this.current].checked = checkedArr.join(',')
|
||||
}
|
||||
} else {
|
||||
this.options[this.current].checked = checked
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCalcQuestType(type) {
|
||||
return `(${this.questionTypeMap[type]})`
|
||||
},
|
||||
fnIsFinish() {
|
||||
if (!this.options[this.current].checked) {
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: '请对本题进行作答。',
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
/**
|
||||
* 下一题按钮点击事件
|
||||
*/
|
||||
fnNextQuestion() {
|
||||
if (!this.fnIsFinish()) return
|
||||
this.current++
|
||||
},
|
||||
/**
|
||||
* 上一题按钮点击事件
|
||||
*/
|
||||
fnPreviousQuestion() {
|
||||
this.current--
|
||||
},
|
||||
/**
|
||||
* 交卷按钮点击事件
|
||||
*/
|
||||
fnHandInThePaper() {
|
||||
if (!this.fnIsFinish()) return
|
||||
uni.showModal({
|
||||
title: '温馨提示',
|
||||
content: `题目已全部做完,确认交卷吗?`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.fnSubmit()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
fnCountDownFinish() {
|
||||
uni.$u.toast('考试时间已结束')
|
||||
for (let i = 0; i < this.options.length; i++) {
|
||||
if (!this.options[i].checked) {
|
||||
this.options[i].checked = ''
|
||||
}
|
||||
}
|
||||
this.fnSubmit()
|
||||
},
|
||||
async fnSubmit() {
|
||||
const {stageexampaperinputId, classId, } = this.routeQuery
|
||||
for (let i = 0; i < this.options.length; i++) {
|
||||
if (this.options[i].questiontype === "2") {
|
||||
this.options[i].checked = this.options[i].checked.replace(/,/g, "");
|
||||
}
|
||||
}
|
||||
const resData = await setTestPaperSubmission({
|
||||
stageexampaperinputId: stageexampaperinputId,
|
||||
classId: classId,
|
||||
studentId: this.studentId,
|
||||
passscore: this.info.passscore,
|
||||
options: JSON.stringify(this.options),
|
||||
});
|
||||
if (resData.examResult === "0") {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: `您的成绩为${resData.examScore}分,很遗憾您没有通过本次考试,请再接再厉!`,
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack({delta: 2});
|
||||
}
|
||||
},
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: "温馨提示",
|
||||
content: `您的成绩为${resData.examScore}分,恭喜您通过本次考试,请继续保持!`,
|
||||
showCancel: false,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.navigateBack({delta: 2});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import '/static/fonts/iconfont_timer.css';
|
||||
|
||||
.content {
|
||||
.top {
|
||||
padding: 17rpx;
|
||||
.time {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
color: #363636;
|
||||
font-size: 28rpx;
|
||||
.top {
|
||||
margin: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 40rpx;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
|
||||
::v-deep {
|
||||
.u-count-down__text {
|
||||
display: inline;
|
||||
color: #363636;
|
||||
font-size: 28rpx;
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.topic {
|
||||
margin: 20rpx;
|
||||
padding: 20rpx 20rpx 150rpx;
|
||||
box-sizing: border-box;
|
||||
.suject {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
.questions {
|
||||
color: #eeecec;
|
||||
font-size: 30rpx;
|
||||
padding-top: 20rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.question-type {
|
||||
border-radius: 40rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border: 1rpx solid #3c9cff;
|
||||
font-size: 24rpx;
|
||||
color: #3c9cff;
|
||||
}
|
||||
.time {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #eeecec;
|
||||
font-size: 28rpx;
|
||||
padding-top: 20rpx;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
.tag_title {
|
||||
font-size: 28rpx;
|
||||
background-color: #b3b3b3;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
::v-deep {
|
||||
.u-count-down__text {
|
||||
color: #eeecec;
|
||||
font-size: 28rpx;
|
||||
line-height: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.options {
|
||||
margin-top: 40rpx;
|
||||
.topic {
|
||||
margin: 20rpx;
|
||||
padding: 20rpx 20rpx 150rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 40rpx;
|
||||
color: #696868;
|
||||
.title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.active {
|
||||
color: #3c9cff;
|
||||
.question-type {
|
||||
border-radius: 40rpx;
|
||||
padding: 4rpx 14rpx;
|
||||
border: 1rpx solid #3c9cff;
|
||||
font-size: 24rpx;
|
||||
color: #3c9cff;
|
||||
}
|
||||
|
||||
.option {
|
||||
background-color: #3c9cff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.tag_title {
|
||||
font-size: 28rpx;
|
||||
background-color: #b3b3b3;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.option {
|
||||
background-color: #eee;
|
||||
border-radius: 80rpx;
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
line-height: 65rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.options {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.text {
|
||||
margin-left: 30rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.item {
|
||||
position: relative;
|
||||
margin-top: 40rpx;
|
||||
color: #696868;
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
&.active {
|
||||
color: #3c9cff;
|
||||
|
||||
button {
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
.option {
|
||||
background-color: #3c9cff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.option {
|
||||
background-color: #eee;
|
||||
border-radius: 80rpx;
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
line-height: 65rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-left: 30rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
background: #fff;
|
||||
|
||||
button {
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="content__titletop">
|
||||
<view class="content__title">试卷名称-综合素质测评</view>
|
||||
<view class="content__subtitle">(满分: 100分)</view>
|
||||
<view class="content__title">试卷名称:{{info.examname}}</view>
|
||||
<view class="content__subtitle">(满分: {{info.paperexamscore}}分)</view>
|
||||
<view class="content__subtitle">(合格分: {{info.passscore}}分)</view>
|
||||
</view>
|
||||
|
||||
<view class="content__info">
|
||||
<text>姓名: 测试者</text>
|
||||
<text>分数: 85分</text>
|
||||
<text>考试时间: 2024-12-30</text>
|
||||
<view>姓名: {{info.username}}</view>
|
||||
<view>分数: {{info.examscore}}分</view>
|
||||
<view>考试时间: {{info.examtimeend}}</view>
|
||||
</view>
|
||||
|
||||
<view class="content__sign">
|
||||
<view style="margin-right: 10rpx">签字: </view>
|
||||
<u-image width="120rpx" height="70rpx" model="widthFix" src="https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp" />
|
||||
<u-image width="120rpx" height="70rpx" model="widthFix" :src="$filePath + info.signaturePath" @click="previewImage" />
|
||||
</view>
|
||||
|
||||
<view class="counter">
|
||||
|
@ -96,9 +97,7 @@ import { getTaskScoreInfo } from "@/api";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
totalPage: 0,
|
||||
info:{},
|
||||
questionList: [],
|
||||
current: 0, // 新增当前激活的题目索引
|
||||
questionTypeMap: {
|
||||
|
@ -120,95 +119,21 @@ export default {
|
|||
|
||||
methods: {
|
||||
async getData(stagestudentrelationId, classId) {
|
||||
// const resData = await getTaskScoreInfo({
|
||||
// stagestudentrelationId,
|
||||
// classId
|
||||
// })
|
||||
// this.questionList = resData.list
|
||||
this.questionList = [
|
||||
{
|
||||
stageexamrecordId: '7cea826c3c974cb69028dd0624b632ba',
|
||||
stageexampaperId: null,
|
||||
stageexamId: null,
|
||||
questionId: null,
|
||||
userId: null,
|
||||
answer: 'B',
|
||||
answerright: 'B',
|
||||
creator: null,
|
||||
createTime: null,
|
||||
operator: null,
|
||||
operatTime: null,
|
||||
isDelete: null,
|
||||
corpinfoId: null,
|
||||
studytaskId: null,
|
||||
paperId: null,
|
||||
classId: null,
|
||||
studentId: null,
|
||||
paperQuestionId: 'c413570fac8b49d8bd3ac27e223beb48',
|
||||
questionnumber: null,
|
||||
questiontype: '1',
|
||||
questiondry: '发生生产安全事故以后,单位负责人应当在( )小时内向当地县级应急管理部门和负有安全生产监督管理职责的有关部门报告。',
|
||||
optiona: '2',
|
||||
optionb: '1',
|
||||
optionc: '4',
|
||||
optiond: '半',
|
||||
descr: '17',
|
||||
score: '50.0',
|
||||
labelType: '6a8577ad5cf84e259f6a601a0c253726',
|
||||
coursewarename: '测试40秒',
|
||||
labelTypeName: '规范标准',
|
||||
checkList: null,
|
||||
count: null,
|
||||
videocoursewareId: null
|
||||
},
|
||||
{
|
||||
stageexamrecordId: '956a9175accc4c96b062eac68a5cdc28',
|
||||
stageexampaperId: null,
|
||||
stageexamId: null,
|
||||
questionId: null,
|
||||
userId: null,
|
||||
answer: 'C',
|
||||
answerright: 'C',
|
||||
creator: null,
|
||||
createTime: null,
|
||||
operator: null,
|
||||
operatTime: null,
|
||||
isDelete: null,
|
||||
corpinfoId: null,
|
||||
studytaskId: null,
|
||||
paperId: null,
|
||||
classId: null,
|
||||
studentId: null,
|
||||
paperQuestionId: 'b8203efc27c04afc8b692fc2c82095ca',
|
||||
questionnumber: null,
|
||||
questiontype: '2',
|
||||
questiondry: '发生生产安全事故以后,单位负责人应当在( )小时内向当地县级应急管理部门和负有安全生产监督管理职责的有关部门报告。',
|
||||
optiona: '2',
|
||||
optionb: '1',
|
||||
optionc: '4',
|
||||
optiond: '半',
|
||||
descr: '17',
|
||||
score: '50.0',
|
||||
labelType: '2c0f587e982641c7965182826f9c41ac',
|
||||
coursewarename: '测试40秒',
|
||||
labelTypeName: '法律法规',
|
||||
checkList: null,
|
||||
count: null,
|
||||
videocoursewareId: null
|
||||
}
|
||||
]
|
||||
this.totalPage = 2
|
||||
this.totalCount = this.questionList.length
|
||||
},
|
||||
resetList() {
|
||||
this.pageSize = 10
|
||||
this.currentPage = 1
|
||||
this.questionList = []
|
||||
this.getData()
|
||||
const resData = await getTaskScoreInfo({
|
||||
stagestudentrelationId,
|
||||
classId
|
||||
})
|
||||
this.questionList = resData.pd.questionList
|
||||
this.info = resData.pd
|
||||
},
|
||||
handleCalcQuestType(type) {
|
||||
return `(${this.questionTypeMap[type]})`
|
||||
}
|
||||
},
|
||||
previewImage(){
|
||||
uni.previewImage({
|
||||
urls: [this.$filePath + this.info.signaturePath],
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -233,10 +158,9 @@ export default {
|
|||
|
||||
.content__info {
|
||||
font-size: 34rpx;
|
||||
margin-top: 36rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
view{
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content__sign {
|
||||
|
@ -257,7 +181,7 @@ export default {
|
|||
|
||||
.tag_title {
|
||||
font-size: 28rpx;
|
||||
background-color: #94f0bd;
|
||||
background-color: #fff;
|
||||
color: #5ac725;
|
||||
border-radius: 8rpx;
|
||||
padding: 2rpx 8rpx;
|
||||
|
|
|
@ -66,13 +66,14 @@ export default {
|
|||
},
|
||||
|
||||
/* 监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面 */
|
||||
onShow() {
|
||||
// this.resetList();
|
||||
async onShow() {
|
||||
await this.getUserFaceCompleted()
|
||||
await this.resetList()
|
||||
},
|
||||
|
||||
async onLoad(query) {
|
||||
await this.getUserFaceCompleted()
|
||||
await this.resetList()
|
||||
// await this.getUserFaceCompleted()
|
||||
// await this.resetList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
@ -108,7 +109,7 @@ export default {
|
|||
onlyFromCamera: false, // 是否只能从相机扫码,允许从相册选择图片
|
||||
hideAlbum: false, // 显示相册,允许从相册选择图片
|
||||
success: (response) => {
|
||||
const { stageexampaperinputId, classId, postId, studentId, numberofexams, type } = JSON.parse(response.result)
|
||||
const { stageexampaperinputId, classId, type, } = JSON.parse(response.result)
|
||||
const findClassId = this.trainList.some((item) => item.classId === classId)
|
||||
if (type === '0') {
|
||||
// 签到二维码方式进入
|
||||
|
@ -132,9 +133,6 @@ export default {
|
|||
type: 'learning_certification',
|
||||
stageexampaperinputId,
|
||||
classId,
|
||||
postId,
|
||||
studentId,
|
||||
numberofexams
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -200,7 +198,7 @@ export default {
|
|||
url: '/pages/train_management/exam_record',
|
||||
params: {
|
||||
classId,
|
||||
stagestudentrelationId
|
||||
stagestudentrelationId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
import { getDataDictionary, joinClass } from '@/api';
|
||||
import Sign from '@/components/sign/sign.vue'
|
||||
import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateField.js'
|
||||
import store from "@/store";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -256,7 +257,7 @@ export default {
|
|||
delete params.writeSign
|
||||
await joinClass({
|
||||
files,
|
||||
formData: { ...params, classId }
|
||||
formData: { ...params, classId,USER_ID:this.$store.getters.getUserInfo.USER_ID }
|
||||
})
|
||||
.then(() => {
|
||||
uni.$u.toast('保存成功')
|
||||
|
|
|
@ -1,40 +1,18 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<u-list @scrolltolower="scrolltolower">
|
||||
<u-list-item v-for="(item, index) in signList" :key="index">
|
||||
<view class="sign_item">
|
||||
<view class="sign_item_avatar">
|
||||
<!-- 用来给图片资源添加前置的统一的访问路径头部: $filePath, 这个将会用在下面的 u-image 组件中的 src 属性中, 示例为: src="$filePath + item.FILEPATH" -->
|
||||
<u-image width="200rpx" height="200rpx" model="widthFix" :src="item.useravatarurl" />
|
||||
</view>
|
||||
<view class="info_body">
|
||||
<view class="info_name">
|
||||
<text>{{ item.userName }}</text>
|
||||
</view>
|
||||
<view class="info_raw">
|
||||
<text class="content_label">班级名称: </text>
|
||||
<text class="content_value">{{ item.name }}</text>
|
||||
</view>
|
||||
<view class="info_raw">
|
||||
<text class="content_label">签到时间: </text>
|
||||
<text class="content_value">{{ item.studyStartTime }}</text>
|
||||
</view>
|
||||
<view class="info_raw">
|
||||
<text class="content_label">培训地点: </text>
|
||||
<text class="content_value">{{ item.trainingLocation }}</text>
|
||||
</view>
|
||||
<view class="info_raw flex_layout">
|
||||
<text class="content_label">签到状态: </text>
|
||||
<text class="tag" :class="studyStateMap[item.studystate].color">{{ studyStateMap[item.studystate].value }}</text>
|
||||
</view>
|
||||
<view class="info_raw flex_layout">
|
||||
<text class="content_label">考试状态: </text>
|
||||
<text class="tag" :class="stageexamStateMap[item.stageexamstate].color">{{ stageexamStateMap[item.stageexamstate].value }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<u-cell-group>
|
||||
<u-cell title="头像">
|
||||
<template #value>
|
||||
<u-image width="200rpx" height="200rpx" model="widthFix" :src="$filePath + signInfo.useravatarurl" />
|
||||
</template>
|
||||
</u-cell>
|
||||
<u-cell title="姓名" :value="signInfo.name"></u-cell>
|
||||
<u-cell title="班级名称" :value="signInfo.className"></u-cell>
|
||||
<u-cell title="签到时间" :value="signInfo.studyStartTime"></u-cell>
|
||||
<u-cell title="培训地点" :value="signInfo.trainingLocationName"></u-cell>
|
||||
<u-cell title="签到状态" :value="studyStateMap[signInfo.studystate].value"></u-cell>
|
||||
<u-cell title="考试签到" :value="stageexamStateMap[signInfo.stageexamstate].value"></u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
@ -45,17 +23,14 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
routeQuery: {},
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
totalPage: 0,
|
||||
signList: [],
|
||||
signInfo: {},
|
||||
// 签到状态枚举
|
||||
studyStateMap: {
|
||||
'0': {
|
||||
value: '未签到',
|
||||
color: 'tag__red'
|
||||
},
|
||||
'1': {
|
||||
'3': {
|
||||
value: '已签到',
|
||||
color: 'tag__green'
|
||||
}
|
||||
|
@ -78,47 +53,21 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.resetList()
|
||||
},
|
||||
|
||||
onLoad(query) {
|
||||
this.routeQuery = query
|
||||
this.getData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getData() {
|
||||
const { classId } = this.routeQuery
|
||||
// let resData = await getSignInfo({
|
||||
// showCount: this.pageSize,
|
||||
// currentPage: this.currentPage,
|
||||
// classId
|
||||
// });
|
||||
// this.signList = [...this.signList, ...resData.page.list]
|
||||
// this.totalPage = resData.page.totalPage
|
||||
this.signList = [
|
||||
{
|
||||
userName: '齐天大圣1',
|
||||
useravatarurl: 'https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp',
|
||||
name: '班级名称1班级名称1班级名称1班级名称1',
|
||||
studyStartTime: '2025-02-11 09:40',
|
||||
trainingLocation: '教三大教室',
|
||||
studystate: '0',
|
||||
stageexamstate: '0'
|
||||
},
|
||||
]
|
||||
this.totalPage = 2
|
||||
let resData = await getSignInfo({
|
||||
showCount: 1,
|
||||
currentPage: 1,
|
||||
classId
|
||||
});
|
||||
this.signInfo = resData.page.list[0]
|
||||
},
|
||||
resetList() {
|
||||
this.pageSize = 10
|
||||
this.currentPage = 1
|
||||
this.trainList = []
|
||||
this.getData()
|
||||
},
|
||||
scrolltolower() {
|
||||
this.currentPage++
|
||||
if (this.totalPage >= this.currentPage) this.getData()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -188,4 +137,4 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
Loading…
Reference in New Issue