diff --git a/src/main/java/com/budwk/app/zhgh/activity/qsv/h5controller/H5QsvQuizController.java b/src/main/java/com/budwk/app/zhgh/activity/qsv/h5controller/H5QsvQuizController.java index 00a0a9e..94c92f7 100644 --- a/src/main/java/com/budwk/app/zhgh/activity/qsv/h5controller/H5QsvQuizController.java +++ b/src/main/java/com/budwk/app/zhgh/activity/qsv/h5controller/H5QsvQuizController.java @@ -79,6 +79,7 @@ public class H5QsvQuizController { Integer maxAttempts = activity.getMaxAttempts(); //题目显示模式 String displayMode = activity.getDisplayMode(); + // 重复答题,显示提示 Boolean repeatTips = false; diff --git a/src/main/resources/views/platform/zhgh/activity/qsv/quiz/rank.html b/src/main/resources/views/platform/zhgh/activity/qsv/quiz/rank.html index 452577a..5cc8bb4 100644 --- a/src/main/resources/views/platform/zhgh/activity/qsv/quiz/rank.html +++ b/src/main/resources/views/platform/zhgh/activity/qsv/quiz/rank.html @@ -7,18 +7,20 @@ layout("/layouts/platform.html"){ - - + + @@ -36,12 +38,12 @@ layout("/layouts/platform.html"){ @@ -49,7 +51,8 @@ layout("/layouts/platform.html"){ - 导出xlsx + 导出xlsx + @@ -59,7 +62,11 @@ layout("/layouts/platform.html"){ - + + + {{$moment(row.attemptDate).format("YYYY-MM-DD")}} + + @@ -79,7 +86,7 @@ layout("/layouts/platform.html"){ }, methods: { listActivity() { - this.$axios.post("/platform/qsv/quizRank/listQuiz", { year: this.pageForm.year }).then((res) => { + this.$axios.post("/platform/qsv/quizRank/listQuiz", {year: this.pageForm.year}).then((res) => { if (res.code === 0) { this.activityOptions = res.data if (this.activityOptions.length > 0) { diff --git a/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/index.html b/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/index.html index 7d350d3..5603e33 100644 --- a/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/index.html +++ b/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/index.html @@ -76,7 +76,8 @@ layout("/layouts/platform_h5.html"){ - ⏰{{ remainingTime }}s + ⏰{{ remainingTime }}s + {{ activity.title }} @@ -92,19 +93,19 @@ layout("/layouts/platform_h5.html"){ @@ -112,7 +113,8 @@ layout("/layouts/platform_h5.html"){ - {{isEnd ? '已结束' : '提交'}} + {{isEnd ? '已结束' : '提交'}} + @@ -157,13 +159,12 @@ layout("/layouts/platform_h5.html"){ methods: { //获取活动、题目 listSubjects() { - this.$axios.post("/platform/h5/qsv/quiz/subjects", { activityId: this.id }).then((res) => { + this.$axios.post("/platform/h5/qsv/quiz/subjects", {activityId: this.id}).then((res) => { if (res.code === 0) { this.activity = res.data.activity this.subjects = res.data.subjects 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({ title: '温馨提示', @@ -185,14 +186,13 @@ layout("/layouts/platform_h5.html"){ //获取回答记录 getAnswerRecord() { - this.$axios.post("/platform/h5/qsv/quiz/answerRecord", { answerRecordId: this.answerRecordId }).then((res) => { + this.$axios.post("/platform/h5/qsv/quiz/answerRecord", {answerRecordId: this.answerRecordId}).then((res) => { if (res.code === 0) { this.answerRecord = res.data if (this.answerRecord.isFinish || this.$moment().unix() > this.$moment(this.activity.endTime)) { this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId) } - this.initAnswer() this.checkTimer() } @@ -250,35 +250,10 @@ layout("/layouts/platform_h5.html"){ 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() { - this.$axios.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activityId }).then((res) => { + this.$axios.post("/platform/h5/qsv/quiz/historyScore", {activityId: this.activityId}).then((res) => { if (res.code === 0) { this.historyScores = res.data } @@ -323,52 +298,42 @@ layout("/layouts/platform_h5.html"){ //自动提交 autoSubmit(loading = null) { - this.$axios - .post("/platform/h5/qsv/quiz/submitAnswer", { - answer: JSON.stringify({ - activityId: this.id, - answerRecordId: this.answerRecordId, - subjects: this.subjects.map((subject) => { - return { - id: subject.id, - userSelectOptionIds: ["checkbox", "radio"].includes(subject.type) ? subject.userSelectOptionIds : [] - } - }), - answerTime: this.answerTime + vant.Dialog.confirm({ + title: '温馨提示', + message: '您确定要提交当前题目吗?', + }).then(() => { + this.$axios + .post("/platform/h5/qsv/quiz/submitAnswer", { + answer: JSON.stringify({ + activityId: this.id, + answerRecordId: this.answerRecordId, + subjects: this.subjects.map((subject) => { + return { + id: subject.id, + userSelectOptionIds: ["checkbox", "radio"].includes(subject.type) ? subject.userSelectOptionIds : [] + } + }), + answerTime: this.answerTime + }) }) - }) - .then((res) => { - if (res.code === 0) { - this.$toast.success(res.msg) - this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId) - // this.getAnswerRecord() - } - }) - .finally(() => { - if (loading) { - loading.clear() - } - }) + .then((res) => { + if (res.code === 0) { + this.$toast.success(res.msg) + this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId) + // this.getAnswerRecord() + } + }) + .finally(() => { + if (loading) { + 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() { if (this.timerInterval) { diff --git a/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/result.html b/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/result.html index faee640..45ea3a1 100644 --- a/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/result.html +++ b/src/main/resources/views/platform/zhghh5/activity/qsv/quiz/result.html @@ -281,7 +281,6 @@ layout("/layouts/platform_h5.html"){ }).then(() => { pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id + "&H5JumpTo=true") }).catch(() => { - // on cancel }); }, getAnswerResult() {