调整考试系统判断

This commit is contained in:
zyy 2020-09-07 13:51:25 +08:00
parent 518bf2eeac
commit 074d4677fe
2 changed files with 9 additions and 7 deletions

View File

@ -74,15 +74,15 @@ const exam = {
actions: {
start({ commit }) {
commit('setStarted', true);
commit('setSuspend', false);
commit('setUsedTime', 0);
commit('countUsedTime');
// commit('setSuspend', false);
// commit('setUsedTime', 0);
// commit('countUsedTime');
},
over({ commit }) {
commit('setStarted', false);
commit('setSuspend', true);
commit('setUsedTime', 0);
commit('stopCountTime');
// commit('setSuspend', true);
// commit('setUsedTime', 0);
// commit('stopCountTime');
},
isOver() {
const trainingList = store.getters['trainingList/trainingList'];

View File

@ -98,6 +98,7 @@ export default {
this.isDisable = true;
startTrainingNew({ id: this.$route.query.trainingId }, this.group).then(response => {
this.$store.dispatch('training/examModeStart');
this.$store.dispatch('exam/start');
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
this.$store.dispatch('training/setMapDefaultState').then(() => {
this.$store.dispatch('training/emitTipFresh');
@ -117,7 +118,7 @@ export default {
end() {
if (this.$route.query.trainingId) {
this.isDisable = false;
if (this.$store.state.training.started) {
if (this.$store.state.exam.started) {
const model = {
id: this.$route.query.examQuestionId,
usedTime: this.$store.state.training.usedTime,
@ -125,6 +126,7 @@ export default {
};
this.$store.dispatch('training/end', null);
this.$store.dispatch('exam/over');
finishOneExamQuestion(model).then(response => {
this.$store.dispatch('training/setStopCountTime');
this.$store.dispatch('training/emitTipFresh');