| | |
| | | </template> |
| | | <div class="referBox"> |
| | | <span>参考答案:</span> |
| | | <p |
| | | v-html="arrayToString(value.answer)" |
| | | <span |
| | | v-html="value.answer" |
| | | class="ti-2" |
| | | :class="[ |
| | | 'subjectiveBox', |
| | | value.isUnfold ? 'showText' : 'hideText', |
| | | ]" |
| | | ></p> |
| | | ></span> |
| | | </div> |
| | | <!-- 解析 --> |
| | | <div class="referBox" v-if="value.analysisCon"> |
| | |
| | | >保存</el-button |
| | | > |
| | | <el-button |
| | | @click="handleQuestion" |
| | | @click=" |
| | | (e) => { |
| | | handleQuestion(); |
| | | saveAnswer(e); |
| | | } |
| | | " |
| | | class="examinations-btn-box" |
| | | :style="{ borderColor: primaryColor }" |
| | | >提交</el-button |
| | | > |
| | | <el-button @click="redo" class="examinations-btn-box">重做</el-button> |
| | | <el-button |
| | | @click="openAnswers" |
| | | @click=" |
| | | (e) => { |
| | | openAnswers(); |
| | | saveAnswer(e); |
| | | } |
| | | " |
| | | class="examinations-btn-box" |
| | | :style="{ borderColor: primaryColor }" |
| | | >查看答案</el-button |
| | |
| | | watch: { |
| | | cardList: { |
| | | handler(newVal) { |
| | | // console.log('新值',newVal); |
| | | this.cardData = this.cardList; |
| | | if (newVal && newVal.length) { |
| | | this.loading = false; |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // this.cardData = this.cardList |
| | | // console.log('this.cardList',this.cardList); |
| | | // console.log('this.cardData',this.cardData); |
| | | this.getCollectIdList(); |
| | | this.getErrorList() |
| | | this.getErrorList(); |
| | | }, |
| | | methods: { |
| | | // 数组转为字符串方法 |
| | |
| | | }, |
| | | // 批改题目 (练习,我的做题,我的收藏模式下) |
| | | handleQuestion() { |
| | | let errorId = [] |
| | | let errorId = []; |
| | | const list = this.cardData; |
| | | for (let index = 0; index < list.length; index++) { |
| | | const item = list[index]; |
| | |
| | | } |
| | | } |
| | | } |
| | | if(citem.isRight == false) { |
| | | errorId.push(citem.id) |
| | | if (citem.isRight == false) { |
| | | errorId.push(citem.id); |
| | | } |
| | | } |
| | | } |
| | | this.cardData = list; |
| | | let oldErrodId = this.allError.find(item => item.type == this.sourceType).errorList |
| | | let oldErrodId = this.allError.find( |
| | | (item) => item.type == this.sourceType |
| | | ).errorList; |
| | | for (let index = 0; index < errorId.length; index++) { |
| | | const item = errorId[index]; |
| | | if(oldErrodId.indexOf(item == -1)) { |
| | | oldErrodId.push(item) |
| | | if (oldErrodId.indexOf(item) == -1) { |
| | | oldErrodId.push(item); |
| | | } |
| | | } |
| | | this.allError[1].errorList = oldErrodId |
| | | for (let cindex = 0; cindex < this.allError.length; cindex++) { |
| | | const citem = this.allError[cindex]; |
| | | if (citem.type == this.sourceType) citem.errorList = oldErrodId; |
| | | } |
| | | this.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: 'errorData', |
| | | domain: "errorData", |
| | | key: this.config.activeBook.bookId, |
| | | value: JSON.stringify(this.allError) |
| | | } |
| | | ] |
| | | value: JSON.stringify(this.allError), |
| | | }, |
| | | ], |
| | | }) |
| | | .then((res) => { |
| | | console.log('错题已保存',this.allError) |
| | | }) |
| | | console.log("错题已保存", this.allError); |
| | | }); |
| | | }, |
| | | getParentWithClass(element, className) { |
| | | while (element.parentElement) { |
| | |
| | | const item = this.allCollect[index]; |
| | | if (item.type == this.sourceType) item.collectList = this.collectList; |
| | | } |
| | | console.log(this.allCollect, this.collectList, list); |
| | | // console.log(this.allCollect, this.collectList, list); |
| | | this.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [ |
| | |
| | | }, |
| | | // 获取收藏id列表 |
| | | getCollectIdList() { |
| | | const token = localStorage.getItem("token"); |
| | | if (!token) return false; |
| | | this.MG.identity |
| | | .getUserKey({ |
| | | domain: "collectData", |
| | |
| | | }, |
| | | // 获取错题id列表 |
| | | getErrorList() { |
| | | const token = localStorage.getItem("token"); |
| | | if (!token) return false; |
| | | this.MG.identity |
| | | .getUserKey({ |
| | | domain: "errorData", |
| | |
| | | ).errorList; |
| | | } |
| | | } catch (error) {} |
| | | console.log('错题列表',this.allError); |
| | | }); |
| | | console.log('错题列表',this.allError) |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | width: 18px; |
| | | object-fit: contain; |
| | | } |
| | | /deep/ .examination-math { |
| | | display: flex; |
| | | align-items: center; |
| | | flex-wrap: wrap; |
| | | } |
| | | </style> |