问卷
This commit is contained in:
@@ -79,6 +79,7 @@ public class H5QsvQuizController {
|
|||||||
Integer maxAttempts = activity.getMaxAttempts();
|
Integer maxAttempts = activity.getMaxAttempts();
|
||||||
//题目显示模式
|
//题目显示模式
|
||||||
String displayMode = activity.getDisplayMode();
|
String displayMode = activity.getDisplayMode();
|
||||||
|
|
||||||
// 重复答题,显示提示
|
// 重复答题,显示提示
|
||||||
Boolean repeatTips = false;
|
Boolean repeatTips = false;
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ layout("/layouts/platform.html"){
|
|||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="问卷">
|
<search-item label="问卷">
|
||||||
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch" v-model="pageForm.activityId">
|
<el-select filterable placeholder="所属问卷" style="width: 100%" @change="doSearch"
|
||||||
<el-option :label="item.title" :value="item.id" :key="item.id" v-for="item in activityOptions"></el-option>
|
v-model="pageForm.activityId">
|
||||||
|
<el-option :label="item.title" :value="item.id" :key="item.id"
|
||||||
|
v-for="item in activityOptions"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</search-item>
|
</search-item>
|
||||||
<search-item label="姓名/工号">
|
<search-item label="姓名/工号">
|
||||||
@@ -49,7 +51,8 @@ layout("/layouts/platform.html"){
|
|||||||
|
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<table-tool>
|
<table-tool>
|
||||||
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>
|
<el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx
|
||||||
|
</el-button>
|
||||||
</table-tool>
|
</table-tool>
|
||||||
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
|
||||||
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
|
||||||
@@ -59,7 +62,11 @@ layout("/layouts/platform.html"){
|
|||||||
<el-table-column label="单位" prop="unitName" sortable></el-table-column>
|
<el-table-column label="单位" prop="unitName" sortable></el-table-column>
|
||||||
<el-table-column label="分工会" prop="unionName" sortable></el-table-column>
|
<el-table-column label="分工会" prop="unionName" sortable></el-table-column>
|
||||||
<el-table-column label="联系方式" prop="mobile" sortable></el-table-column>
|
<el-table-column label="联系方式" prop="mobile" sortable></el-table-column>
|
||||||
<el-table-column label="答题日期" prop="attemptDate" sortable></el-table-column>
|
<el-table-column label="答题日期" prop="attemptDate" sortable>
|
||||||
|
<template slot-scope="{row}">
|
||||||
|
{{$moment(row.attemptDate).format("YYYY-MM-DD")}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="得分" prop="totalScore" sortable></el-table-column>
|
<el-table-column label="得分" prop="totalScore" sortable></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--#include("/layouts/pagination.html"){}#-->
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
|
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
|
||||||
<van-sticky offset-top="46px">
|
<van-sticky offset-top="46px">
|
||||||
<!--开启计时 未完成 活动未结束-->
|
<!--开启计时 未完成 活动未结束-->
|
||||||
<div class="timer" v-if="activity.timeLimit > 0 && !answerRecord.isFinish && !isEnd">⏰{{ remainingTime }}s</div>
|
<div class="timer" v-if="activity.timeLimit > 0 && !answerRecord.isFinish && !isEnd">⏰{{ remainingTime }}s
|
||||||
|
</div>
|
||||||
<h2 class="title">{{ activity.title }}</h2>
|
<h2 class="title">{{ activity.title }}</h2>
|
||||||
</van-sticky>
|
</van-sticky>
|
||||||
|
|
||||||
@@ -112,7 +113,8 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</van-checkbox-group>
|
</van-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-control" v-if="!answerRecord.isFinish">
|
<div class="button-control" v-if="!answerRecord.isFinish">
|
||||||
<van-button type="primary" @click="onSubmit" block :disabled="isEnd">{{isEnd ? '已结束' : '提交'}}</van-button>
|
<van-button type="primary" @click="onSubmit" block :disabled="isEnd">{{isEnd ? '已结束' : '提交'}}
|
||||||
|
</van-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -162,7 +164,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.activity = res.data.activity
|
this.activity = res.data.activity
|
||||||
this.subjects = res.data.subjects
|
this.subjects = res.data.subjects
|
||||||
this.answerRecordId = res.data.answerRecordId
|
this.answerRecordId = res.data.answerRecordId
|
||||||
debugger
|
|
||||||
if (!this.H5JumpTo && this.activity.repeatable && res.data.repeatTips) {
|
if (!this.H5JumpTo && this.activity.repeatable && res.data.repeatTips) {
|
||||||
// 如果是可重复答题,第二次答题进来弹出提示
|
// 如果是可重复答题,第二次答题进来弹出提示
|
||||||
vant.Dialog.confirm({
|
vant.Dialog.confirm({
|
||||||
@@ -192,7 +193,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
if (this.answerRecord.isFinish || this.$moment().unix() > this.$moment(this.activity.endTime)) {
|
if (this.answerRecord.isFinish || this.$moment().unix() > this.$moment(this.activity.endTime)) {
|
||||||
this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
|
this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.initAnswer()
|
this.initAnswer()
|
||||||
this.checkTimer()
|
this.checkTimer()
|
||||||
}
|
}
|
||||||
@@ -250,31 +250,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
startInterval()
|
startInterval()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (this.activity.timeLimit > 0 && !this.isEnd) {
|
|
||||||
// if (!this.answerRecord.isFinish) {
|
|
||||||
// this.$dialog
|
|
||||||
// .alert({
|
|
||||||
// title: "提示",
|
|
||||||
// message: "本次答题时间" + this.activity.timeLimit + "分钟,点击确认开始答题"
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// this.remainingTime = this.activity.timeLimit * 60
|
|
||||||
// this.timerInterval = setInterval(() => {
|
|
||||||
// if (this.remainingTime > 0) {
|
|
||||||
// this.remainingTime--
|
|
||||||
// } else {
|
|
||||||
// clearInterval(this.timerInterval)
|
|
||||||
// const loading = this.$toast.loading({
|
|
||||||
// message: "答题时间到,自动提交中",
|
|
||||||
// forbidClick: true
|
|
||||||
// })
|
|
||||||
// this.autoSubmit(loading)
|
|
||||||
// }
|
|
||||||
// }, 1000)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
historyScore() {
|
historyScore() {
|
||||||
@@ -323,6 +298,10 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
//自动提交
|
//自动提交
|
||||||
autoSubmit(loading = null) {
|
autoSubmit(loading = null) {
|
||||||
|
vant.Dialog.confirm({
|
||||||
|
title: '温馨提示',
|
||||||
|
message: '您确定要提交当前题目吗?',
|
||||||
|
}).then(() => {
|
||||||
this.$axios
|
this.$axios
|
||||||
.post("/platform/h5/qsv/quiz/submitAnswer", {
|
.post("/platform/h5/qsv/quiz/submitAnswer", {
|
||||||
answer: JSON.stringify({
|
answer: JSON.stringify({
|
||||||
@@ -349,26 +328,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
loading.clear()
|
loading.clear()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}).catch(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async checkGroupPermission() {
|
|
||||||
const groupId = this.activity.groupId
|
|
||||||
if (groupId) {
|
|
||||||
const { code, data } = await this.$axios.post("/open/common/checkGroupPermission", { groupId })
|
|
||||||
if (code === 0) {
|
|
||||||
if (!data) {
|
|
||||||
this.$dialog
|
|
||||||
.alert({
|
|
||||||
title: "提示",
|
|
||||||
message: "您没有权限参与"
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
location.back()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.timerInterval) {
|
if (this.timerInterval) {
|
||||||
|
|||||||
@@ -281,7 +281,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id + "&H5JumpTo=true")
|
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id + "&H5JumpTo=true")
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// on cancel
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAnswerResult() {
|
getAnswerResult() {
|
||||||
|
|||||||
Reference in New Issue
Block a user