|
@@ -1,14 +1,20 @@
|
|
|
<template>
|
|
|
- <div class="page-exam-question-box">
|
|
|
+ <div class="page-through-question-box">
|
|
|
<van-nav-bar title="闯关答题" left-arrow @click-left="handleBackFun" />
|
|
|
<!-- 题目卡片 -->
|
|
|
- <div class="exam-question-div">
|
|
|
- <div v-if="examQuestionList.length > 0" class="exam-question-card">
|
|
|
+ <div v-if="answerThroughNumber" class="through-question-div">
|
|
|
+ <div class="through-question-card">
|
|
|
+ <div class="through-question-number">第{{ answerThroughNumber }}关</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 题目卡片 -->
|
|
|
+ <div class="through-question-div">
|
|
|
+ <div v-if="examQuestionList.length > 0" class="through-question-card">
|
|
|
<!-- 标题、分数、题页 -->
|
|
|
- <div class="exam-question-head">
|
|
|
- <div class="exam-question-head-left">
|
|
|
- <div class="exam-question-head-left-icon"></div>
|
|
|
- <div class="exam-question-head-left-txt">
|
|
|
+ <div class="through-question-head">
|
|
|
+ <div class="through-question-head-left">
|
|
|
+ <div class="through-question-head-left-icon"></div>
|
|
|
+ <div class="through-question-head-left-txt">
|
|
|
{{ examQuestionList[answerIndex].typeTxt || "undefind" }}
|
|
|
</div>
|
|
|
<van-tag
|
|
@@ -19,8 +25,8 @@
|
|
|
>今日必答</van-tag
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="exam-question-head-right">
|
|
|
- <span class="exam-question-head-right-now">{{
|
|
|
+ <div class="through-question-head-right">
|
|
|
+ <span class="through-question-head-right-now">{{
|
|
|
answerIndex + 1
|
|
|
}}</span>
|
|
|
<span>/</span>
|
|
@@ -28,10 +34,10 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 描述 -->
|
|
|
- <div class="exam-question-describe">
|
|
|
+ <div class="through-question-describe">
|
|
|
{{
|
|
|
examQuestionList[answerIndex].questionContent ||
|
|
|
- examQuestionList[answerIndex].content
|
|
|
+ examQuestionList[answerIndex].content
|
|
|
}}
|
|
|
</div>
|
|
|
<!-- 答题列表 -->
|
|
@@ -39,19 +45,22 @@
|
|
|
<div
|
|
|
v-if="
|
|
|
examQuestionList[answerIndex].type === questionType.TrueOrFalse ||
|
|
|
- examQuestionList[answerIndex].type === questionType.singleChoice ||
|
|
|
- examQuestionList[answerIndex].type === questionType.multipleChoice
|
|
|
+ examQuestionList[answerIndex].type ===
|
|
|
+ questionType.singleChoice ||
|
|
|
+ examQuestionList[answerIndex].type === questionType.multipleChoice
|
|
|
"
|
|
|
- class="exam-question-options"
|
|
|
+ class="through-question-options"
|
|
|
>
|
|
|
<div
|
|
|
v-for="(item, index) in examQuestionList[answerIndex].answers"
|
|
|
:key="index"
|
|
|
:class="{
|
|
|
- 'exam-question-options-item': true,
|
|
|
- 'exam-question-options-item-checked': answerValue.includes(item),
|
|
|
- 'exam-question-options-false':
|
|
|
- answerValue.includes(item) && answerStatus === 2,
|
|
|
+ 'through-question-options-item': true,
|
|
|
+ 'through-question-options-item-checked': answerValue.includes(
|
|
|
+ item
|
|
|
+ ),
|
|
|
+ 'through-question-options-false':
|
|
|
+ answerValue.includes(item) && answerStatus === 2
|
|
|
}"
|
|
|
@click="handleExamQuestionOptionsItemFun(item)"
|
|
|
>
|
|
@@ -61,8 +70,8 @@
|
|
|
<!-- 填空题的答题区域 -->
|
|
|
<div
|
|
|
v-if="examQuestionList[answerIndex].type === questionType.gapFilling"
|
|
|
- class="exam-question-gapFilling"
|
|
|
- :class="{ 'exam-question-gapFilling-false': answerStatus === 2 }"
|
|
|
+ class="through-question-gapFilling"
|
|
|
+ :class="{ 'through-question-gapFilling-false': answerStatus === 2 }"
|
|
|
>
|
|
|
<textarea
|
|
|
v-for="(item, index) in examQuestionList[answerIndex]
|
|
@@ -78,67 +87,67 @@
|
|
|
</div>
|
|
|
<div
|
|
|
v-if="answerRecruitId === 'daily-questions'"
|
|
|
- class="exam-question-button-box"
|
|
|
+ class="through-question-button-box"
|
|
|
>
|
|
|
- <div class="exam-question-single-button-box">
|
|
|
- <van-button
|
|
|
- v-if="this.answerIndex !== 0"
|
|
|
- class="exam-question-button"
|
|
|
- type="primary"
|
|
|
- color="#0088e9"
|
|
|
- @click="handleLastFun"
|
|
|
- >上一题</van-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="exam-question-single-button-box">
|
|
|
+ <div class="through-question-single-button-box"></div>
|
|
|
+ <div class="through-question-single-button-box">
|
|
|
<van-button
|
|
|
- class="exam-question-button"
|
|
|
+ class="through-question-button"
|
|
|
type="primary"
|
|
|
color="#0088e9"
|
|
|
+ :disabled="answerValue.length === 0"
|
|
|
@click="handleSureFun"
|
|
|
>确定</van-button
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="exam-question-single-button-box">
|
|
|
+ <div class="through-question-single-button-box">
|
|
|
<van-button
|
|
|
- v-if="this.answerIndex < this.examQuestionList.length - 1"
|
|
|
- class="exam-question-button"
|
|
|
+ v-show="examQuestionList[answerIndex].userAnswer.length"
|
|
|
+ class="through-question-button"
|
|
|
type="primary"
|
|
|
color="#0088e9"
|
|
|
@click="handleNextFun"
|
|
|
- >下一题</van-button
|
|
|
+ >{{
|
|
|
+ this.examQuestionList.length - 1 > this.answerIndex
|
|
|
+ ? "下一题"
|
|
|
+ : "完成"
|
|
|
+ }}</van-button
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-else class="exam-question-button-box">
|
|
|
- <div class="exam-question-single-button-box"></div>
|
|
|
- <div class="exam-question-single-button-box">
|
|
|
+ <div v-else class="through-question-button-box">
|
|
|
+ <div class="through-question-single-button-box">
|
|
|
<van-button
|
|
|
v-show="answerStatus === 0"
|
|
|
- class="exam-question-button"
|
|
|
+ class="through-question-button"
|
|
|
type="primary"
|
|
|
color="#0088e9"
|
|
|
+ :disabled="answerValue.length === 0"
|
|
|
@click="handleSureFun"
|
|
|
>确定</van-button
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="exam-question-single-button-box">
|
|
|
+ <div class="through-question-single-button-box">
|
|
|
<van-button
|
|
|
v-show="answerStatus === 2"
|
|
|
- class="exam-question-button"
|
|
|
+ class="through-question-button"
|
|
|
type="primary"
|
|
|
color="#0088e9"
|
|
|
@click="handleNextFun"
|
|
|
- >下一题</van-button
|
|
|
+ >{{
|
|
|
+ this.examQuestionList.length - 1 > this.answerIndex
|
|
|
+ ? "下一题"
|
|
|
+ : "完成"
|
|
|
+ }}</van-button
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-else class="exam-question-card">
|
|
|
- <div v-if="isInited" class="exam-question-card-nodata">暂无数据</div>
|
|
|
+ <div v-else class="through-question-card">
|
|
|
+ <div v-if="isInited" class="through-question-card-nodata">暂无数据</div>
|
|
|
<div
|
|
|
v-else
|
|
|
- class="exam-question-card-nodata exam-question-card-loading"
|
|
|
+ class="through-question-card-nodata through-question-card-loading"
|
|
|
>
|
|
|
加载中...
|
|
|
</div>
|
|
@@ -148,17 +157,17 @@
|
|
|
<div
|
|
|
v-if="examQuestionList.length > 0"
|
|
|
v-show="answerStatus === 2"
|
|
|
- class="exam-question-div"
|
|
|
+ class="through-question-div"
|
|
|
>
|
|
|
- <div class="exam-question-card">
|
|
|
- <div class="exam-question-result">
|
|
|
+ <div class="through-question-card">
|
|
|
+ <div class="through-question-result">
|
|
|
正确答案:{{
|
|
|
formatQuestionFinalAnswerIndex(
|
|
|
examQuestionList[answerIndex].finalAnswer
|
|
|
)
|
|
|
}}
|
|
|
</div>
|
|
|
- <div class="exam-question-analysis">
|
|
|
+ <div class="through-question-analysis">
|
|
|
答案解析:{{ this.examQuestionList[this.answerIndex].answerAnalysis }}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -189,7 +198,7 @@ export default {
|
|
|
startTime: 0,
|
|
|
endTime: 0
|
|
|
}, // 答题的开始、结束时间
|
|
|
- answerStatus: 0 // 当前答题状态: 0未作答 1已做答且正确 2已做答但错误
|
|
|
+ answerStatus: 0 // 当前答题状态: 0未作答 1已做答且正确 2已做答但错误 3已完成当前的所有题目作答
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -200,7 +209,8 @@ export default {
|
|
|
...mapState({
|
|
|
answerRecruitId: state => state.answer.answerRecruitId,
|
|
|
userInfo: state => state.user.userInfo,
|
|
|
- chooseEngneeringWork: state => state.user.chooseEngneeringWork
|
|
|
+ chooseEngneeringWork: state => state.user.chooseEngneeringWork,
|
|
|
+ answerThroughNumber: state => state.answer.answerThroughNumber
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
@@ -418,6 +428,13 @@ export default {
|
|
|
: 2;
|
|
|
if (this.answerStatus === 1) {
|
|
|
this.handleNextFun();
|
|
|
+ } else if (this.answerStatus === 2) {
|
|
|
+ Dialog.alert({
|
|
|
+ message: "本题答错,闯关失败",
|
|
|
+ theme: "round-button"
|
|
|
+ }).then(() => {
|
|
|
+ this.$router.back();
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
// 方法:判断当前题目是否正确
|
|
@@ -468,18 +485,6 @@ export default {
|
|
|
nextIndex
|
|
|
);
|
|
|
},
|
|
|
- // 操作:上一题
|
|
|
- handleLastFun() {
|
|
|
- let nextIndex = this.answerIndex - 1;
|
|
|
- if (nextIndex >= this.examQuestionList.length) {
|
|
|
- this.examsEndFun(); // 结束考试
|
|
|
- return;
|
|
|
- }
|
|
|
- this.handleExamQuestionItemFun(
|
|
|
- this.examQuestionList[nextIndex],
|
|
|
- nextIndex
|
|
|
- );
|
|
|
- },
|
|
|
// 方法:结束考试
|
|
|
examsEndFun() {
|
|
|
let curTime = new Date();
|
|
@@ -505,7 +510,7 @@ export default {
|
|
|
.then(res => {
|
|
|
this.$store.commit("toggleLoading", false);
|
|
|
this.$router.replace({
|
|
|
- name: "answerRecruitResult",
|
|
|
+ name: "throughQuestionEnd",
|
|
|
params: {
|
|
|
allQuestionsNum: this.examQuestionList.length,
|
|
|
grades: grades
|
|
@@ -549,20 +554,20 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import "~@/styles/mixin";
|
|
|
-.page-exam-question-box {
|
|
|
+.page-through-question-box {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
overflow-y: auto;
|
|
|
overflow-x: hidden;
|
|
|
font-size: 0.6rem;
|
|
|
- .exam-question-div {
|
|
|
+ .through-question-div {
|
|
|
padding: 0.5rem 0.5rem;
|
|
|
- .exam-question-card {
|
|
|
+ .through-question-card {
|
|
|
padding: 0.5rem 0.5rem;
|
|
|
background-color: #fff;
|
|
|
border-radius: 4px;
|
|
|
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
|
|
|
- .exam-question-head {
|
|
|
+ .through-question-head {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
@@ -571,53 +576,53 @@ export default {
|
|
|
padding-bottom: 0.25rem;
|
|
|
height: 1.25rem;
|
|
|
font-size: 0.65rem;
|
|
|
- .exam-question-head-left {
|
|
|
+ .through-question-head-left {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: nowrap;
|
|
|
- .exam-question-head-left-icon {
|
|
|
+ .through-question-head-left-icon {
|
|
|
width: 0.25rem;
|
|
|
height: 1rem;
|
|
|
background-color: #0088e9;
|
|
|
}
|
|
|
- .exam-question-head-left-txt {
|
|
|
+ .through-question-head-left-txt {
|
|
|
margin-left: 0.25rem;
|
|
|
margin-right: 0.25rem;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-head-right {
|
|
|
+ .through-question-head-right {
|
|
|
span {
|
|
|
color: #666;
|
|
|
}
|
|
|
- .exam-question-head-right-now {
|
|
|
+ .through-question-head-right-now {
|
|
|
font-weight: bold;
|
|
|
color: #000;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-describe {
|
|
|
+ .through-question-describe {
|
|
|
padding: 0.5rem 0;
|
|
|
font-size: 0.65rem;
|
|
|
}
|
|
|
- .exam-question-options {
|
|
|
- .exam-question-options-item {
|
|
|
+ .through-question-options {
|
|
|
+ .through-question-options-item {
|
|
|
width: 100%;
|
|
|
padding: 0.5rem 0.25rem;
|
|
|
background-color: #f3f3f3;
|
|
|
margin-bottom: 0.5rem;
|
|
|
border: 1px solid transparent;
|
|
|
}
|
|
|
- .exam-question-options-item-checked {
|
|
|
+ .through-question-options-item-checked {
|
|
|
border-color: #0088e9;
|
|
|
color: #0088e9;
|
|
|
}
|
|
|
- .exam-question-options-false {
|
|
|
+ .through-question-options-false {
|
|
|
border-color: red !important;
|
|
|
background-color: #fedada !important;
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-gapFilling {
|
|
|
+ .through-question-gapFilling {
|
|
|
padding-top: 0.5rem;
|
|
|
textarea {
|
|
|
width: 100%;
|
|
@@ -631,25 +636,25 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-gapFilling-false {
|
|
|
+ .through-question-gapFilling-false {
|
|
|
textarea {
|
|
|
border-color: red !important;
|
|
|
background-color: #fedada !important;
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-button-box {
|
|
|
+ .through-question-button-box {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
- .exam-question-single-button-box {
|
|
|
+ .through-question-single-button-box {
|
|
|
width: 30%;
|
|
|
padding: 0.5rem 0.5rem;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
- .exam-question-button {
|
|
|
+ .through-question-button {
|
|
|
width: 6rem;
|
|
|
height: auto;
|
|
|
padding: 0.5rem 0.5rem;
|
|
@@ -658,16 +663,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .exam-question-result {
|
|
|
+ .through-question-result {
|
|
|
border-bottom: 1px solid #0088e9;
|
|
|
padding-bottom: 0.25rem;
|
|
|
font-size: 0.6rem;
|
|
|
}
|
|
|
- .exam-question-analysis {
|
|
|
+ .through-question-analysis {
|
|
|
padding-top: 0.25rem;
|
|
|
}
|
|
|
- .exam-question-card-loading,
|
|
|
- .exam-question-card-nodata {
|
|
|
+ .through-question-card-loading,
|
|
|
+ .through-question-card-nodata {
|
|
|
width: 100%;
|
|
|
height: 5rem;
|
|
|
color: #333;
|
|
@@ -676,9 +681,14 @@ export default {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
}
|
|
|
- .exam-question-card-loading {
|
|
|
+ .through-question-card-loading {
|
|
|
color: #0088e9;
|
|
|
}
|
|
|
+ .through-question-number {
|
|
|
+ padding: 0.25rem 0;
|
|
|
+ font-size: 0.7rem;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|