|
@@ -12,6 +12,10 @@
|
|
|
inactive-color="#13ce66"
|
|
|
></el-switch>
|
|
|
</div>
|
|
|
+ <div v-show="examType != 'OFFLINE'" class="first-board">
|
|
|
+ <el-checkbox v-model="showBody">显示题干</el-checkbox
|
|
|
+ ><el-checkbox v-model="showAnswer">显示标答</el-checkbox>
|
|
|
+ </div>
|
|
|
<div class="second-board">
|
|
|
<div class="board-title"><span>总分</span></div>
|
|
|
<div class="board-score">
|
|
@@ -266,9 +270,15 @@ export default {
|
|
|
type: Number,
|
|
|
default: 0.5,
|
|
|
},
|
|
|
+ examType: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ showBody: true,
|
|
|
+ showAnswer: true,
|
|
|
resultItemsData: this.resultItems,
|
|
|
signOptionData: this.signOption,
|
|
|
signScoresData: this.signScores,
|
|
@@ -415,12 +425,44 @@ export default {
|
|
|
this.initKeyBoardMode();
|
|
|
}
|
|
|
},
|
|
|
+ showAnswer: {
|
|
|
+ immediate: false,
|
|
|
+ handler() {
|
|
|
+ this.showAnswerChange();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ showBody: {
|
|
|
+ immediate: false,
|
|
|
+ handler() {
|
|
|
+ this.showBodyChange();
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.getTags();
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions([USER_SIGNOUT]),
|
|
|
+ showAnswerChange() {
|
|
|
+ if (this.examType == "OFFLINE") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var es = Array.from(document.getElementsByClassName("right-answer"));
|
|
|
+ var displayVal = this.showAnswer ? "block" : "none";
|
|
|
+ es.forEach((element) => {
|
|
|
+ element.style.display = displayVal;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showBodyChange() {
|
|
|
+ if (this.examType == "OFFLINE") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var es = Array.from(document.getElementsByClassName("question-body"));
|
|
|
+ var displayVal = this.showBody ? "block" : "none";
|
|
|
+ es.forEach((element) => {
|
|
|
+ element.style.display = displayVal;
|
|
|
+ });
|
|
|
+ },
|
|
|
resetProblem() {
|
|
|
if (this.markedResultData.tag) {
|
|
|
this.markedResultData.tag = "";
|