学习中心考试带上考试id

feature/v-xuexi
wangdong 8 months ago
parent b898d79f8d
commit c0845cab72
  1. 2
      pages/learningCenter/brushQuestion.vue
  2. 8
      pages/special/question_index.vue
  3. 7
      pages/topic/question_detail.vue
  4. 10
      pages/topic/question_result.vue
  5. 13
      pages/topic/question_sheet.vue

@ -53,7 +53,7 @@ import { specialTestPaper } from '@/api/learning';
methods: {
toContent(item) {
uni.navigateTo({
url: `/pages/special/question_index?id=${item.id}&is_analysis=${1}`,
url: `/pages/special/question_index?id=${item.id}&is_analysis=${1}&special_id=${this.id}`,
});
},
async specialTestPaper() {

@ -102,14 +102,16 @@
isOpenWeixing: false,
status: -1,
is_analysis: 0,
special_id: 0,
};
},
onLoad({ id, isMember, is_analysis }) {
onLoad({ id, isMember, is_analysis, special_id }) {
this.id = Number(id);
this.isMember = isMember;
this.special_id = special_id || '';
this.getDetail();
this.getAuthInfo();
if (parseInt(is_analysis)) {
if (is_analysis && parseInt(is_analysis)) {
this.is_analysis = parseInt(is_analysis);
} else {
this.is_analysis = 0;
@ -133,7 +135,7 @@
if (this.status == 1) this.$util.setStorage(`exam_time${id}`, 0);
console.log(this.$util.getStorage(`exam_time${id}`));
uni.navigateTo({
url: `/pages/topic/question_detail?test_id=${id}&is_analysis=${this.is_analysis}`
url: `/pages/topic/question_detail?test_id=${id}&is_analysis=${this.is_analysis}&special_id=${this.special_id}`
});
},
async getAuthInfo() {

@ -8,7 +8,7 @@
<view class="header-bd">
<navigator
open-type="redirect"
:url="`/pages/topic/question_sheet?test_id=${test_id}&record_id=${e_id}&index=${activeIndex}&is_analysis=${is_analysis}&txamination_time=${txamination_time}&exam_time=${duration}`"
:url="`/pages/topic/question_sheet?test_id=${test_id}&special_id=${special_id}&record_id=${e_id}&index=${activeIndex}&is_analysis=${is_analysis}&txamination_time=${txamination_time}&exam_time=${duration}`"
>答题卡</navigator
>
<view v-if="!is_analysis">{{ duration | formatTime }}</view>
@ -200,8 +200,9 @@ export default {
}
},
},
onLoad({ test_id, type, index = 0, e_id, is_analysis }) {
onLoad({ test_id, type, index = 0, e_id, is_analysis, special_id }) {
this.test_id = test_id;
this.special_id = special_id;
this.activeIndex = Number(index);
const task = this.getData();
@ -302,6 +303,7 @@ export default {
"/pages/topic/question_sheet?" +
this.$util.objToParam({
test_id: this.test_id,
special_id: this.special_id,
record_id: this.e_id,
index: this.activeIndex,
is_analysis: this.is_analysis,
@ -321,6 +323,7 @@ export default {
"/pages/topic/question_sheet?" +
this.$util.objToParam({
test_id: this.test_id,
special_id: this.special_id,
record_id: this.e_id,
index: this.activeIndex,
is_analysis: this.is_analysis,

@ -60,9 +60,9 @@
:class="{ no: item.is_correct === 1, ok: item.is_correct === 2 }">{{ index + 1 }}</view>
</view>
<view v-if="!footerHidden" class="result-ft">
<navigator :url="`/pages/topic/question_sheet?is_analysis=1&test_id=${test_id}&record_id=${result.id}`">查看解析
<navigator :url="`/pages/topic/question_sheet?is_analysis=1&test_id=${test_id}&record_id=${result.id}&check_analysis=1`">查看解析
</navigator>
<navigator open-type="redirect" :url="`/pages/special/question_index?id=${test_id}&is_analysis=${is_analysis}`">再考一次</navigator>
<navigator open-type="redirect" :url="`/pages/special/question_index?id=${test_id}&special_id=${special_id}&is_analysis=${is_analysis}`">再考一次</navigator>
</view>
</view>
<view :class="{ mask: imgSrc }" @touchmove.prevent @click="imgSrc = ''"></view>
@ -96,12 +96,14 @@ export default {
fill: { gradient: ["rgba(44, 142, 255, 1)", "rgba(44, 142, 255, 0.05)"] },
footerHidden: false,
imgSrc: "",
userInfo: {}
userInfo: {},
special_id: 0,
};
},
onLoad({ test_id, from, is_analysis }) {
onLoad({ test_id, from, is_analysis, special_id }) {
this.test_id = test_id;
this.is_analysis = parseInt(is_analysis);
this.special_id = special_id;
this.footerHidden = from === "question_user";
this.$util.removeStorage("exam_time");

@ -26,12 +26,12 @@
open-type="redirect"
v-for="(item, index) in questions"
:class="{ blue: item.is_correct }"
:url="`/pages/topic/question_detail?test_id=${test_id}&e_id=${record_id}&is_analysis=${is_analysis}&index=${index}&txamination_time=${txamination_time}&exam_time=${duration}`"
:url="`/pages/topic/question_detail?test_id=${test_id}&special_id=${special_id}&e_id=${record_id}&is_analysis=${is_analysis}&index=${index}&txamination_time=${txamination_time}&exam_time=${duration}`"
>{{ index + 1 }}</navigator
>
</view>
</view>
<view class="footer">
<view v-if="!check_analysis" class="footer">
<view class="btn" @click="submit">提交考试</view>
</view>
</view>
@ -72,15 +72,19 @@ export default {
loading: false,
is_analysis: 0,
txamination_time: 0,
special_id: 0,
check_analysis: 0,
};
},
onLoad({ test_id, record_id, is_analysis, index, txamination_time }) {
onLoad({ test_id, record_id, is_analysis, index, txamination_time, special_id, check_analysis }) {
const exam_time = this.$util.getStorage(`exam_time${test_id}`);
if (exam_time) {
this.exam_time = parseInt(exam_time);
}
this.test_id = test_id;
this.record_id = record_id;
this.special_id = special_id;
this.check_analysis = check_analysis;
this.is_analysis = parseInt(is_analysis);
if (index) {
this.index = parseInt(index);
@ -139,6 +143,7 @@ export default {
try {
const { data, code, msg } = await submitTestPaper({
examination_id: this.record_id,
special_id: this.special_id,
type: 2,
duration: this.duration,
});
@ -149,7 +154,7 @@ export default {
this.$util.removeStorage("exam_time");
// this.is_analysis = 1;
uni.redirectTo({
url: `/pages/topic/question_result?test_id=${this.test_id}&is_analysis=${this.is_analysis}`,
url: `/pages/topic/question_result?test_id=${this.test_id}&special_id=${this.special_id}&is_analysis=${this.is_analysis}`,
});
} else {
this.$util.showMsg(msg);

Loading…
Cancel
Save