Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout
| | |
| | | process.env.VUE_APP_RESOURCE_CTX + |
| | | (process.env.VUE_APP_ENV == "product" |
| | | ? process.env.VUE_APP_BOOK_ID |
| | | : "artAndDrama") |
| | | : "mathBook") |
| | | ); |
| | | // 测试试读30页 |
| | | // this.activeBook.tryPageCount = 10; |
| | |
| | | import fileApi from "@/assets/js/middleGround/api/file"; |
| | | import identityApi from "../js/middleGround/api/identity"; |
| | | export const getResourcePath = async (md5, appRefCode = "jingshieke") => { |
| | | let path = ""; |
| | | await fileApi |
| | |
| | | }); |
| | | return path; |
| | | }; |
| | | // 获取收藏的资源 |
| | | export const getCollectResource = async (key) => { |
| | | let list = [] |
| | | await identityApi |
| | | .getUserKey({ |
| | | domain: "collectResource", |
| | | keys: [key], |
| | | }) |
| | | .then((res) => { |
| | | if(res.length) { |
| | | list = JSON.parse(res[0].value) |
| | | } |
| | | }); |
| | | return list |
| | | } |
| | | export const setCollectResource = (key,list) => { |
| | | identityApi.setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: "collectResource", |
| | | key, |
| | | value: JSON.stringify(list), |
| | | }, |
| | | ], |
| | | }) |
| | | } |
| | | const MT = { |
| | | getResourcePath, |
| | | getCollectResource, |
| | | setCollectResource |
| | | }; |
| | | |
| | | export default MT; |
| | |
| | | placement="top-start" |
| | | > |
| | | <img |
| | | :src="chapterData.isCollectImg ? collectCheck : collectImg" |
| | | :src="collectResourceList.findIndex(item => item.id == '722FE833') > -1 ? collectCheck : collectImg" |
| | | alt="" |
| | | class="collect-btn" |
| | | @click="handleCollect('img')" |
| | |
| | | placement="top-start" |
| | | > |
| | | <img |
| | | :src="chapterData.isCollectVideo ? collectCheck : collectImg" |
| | | :src="collectResourceList.findIndex(item => item.id == 'a28cd862d61b5df2201406b76e9f01b0') > -1 ? collectCheck : collectImg" |
| | | alt="" |
| | | class="collect-btn" |
| | | @click="handleCollect('video')" |
| | |
| | | </p> |
| | | <div class="bj"> |
| | | <examinations |
| | | :cardList="questionData" |
| | | :cardList="questionData[9]" |
| | | :hideCollect="true" |
| | | sourceType="json" |
| | | inputBc="#d3edfa" |
| | | v-if="questionData" |
| | | :isReal="false" |
| | |
| | | <script> |
| | | import examinations from "@/components/examinations/index.vue"; |
| | | import { getResourcePath } from "@/assets/methods/resources"; |
| | | import axios from "axios"; |
| | | import { getCollectResource,setCollectResource } from "@/assets/methods/resources"; |
| | | export default { |
| | | name: "chapter-one", |
| | | components: { examinations }, |
| | |
| | | type: Array, |
| | | default: [], |
| | | }, |
| | | questionData:{ |
| | | type:Object |
| | | } |
| | | }, |
| | | mounted() { |
| | | async mounted() { |
| | | const data = localStorage.getItem("math-chapterData"); |
| | | if (data) { |
| | | this.chapterData = JSON.parse(data); |
| | | } |
| | | this.getPath(); |
| | | this.getQuestionData(); |
| | | this.collectResourceList = await getCollectResource(this.config.activeBook.bookId) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | thinkingDialog: false, |
| | | stepDialog: false, |
| | | videoPath: "", |
| | | questionData: [], |
| | | stepIndex: 1, |
| | | thinkIndex: 1, |
| | | collectResourceList:[], |
| | | chapterData: { |
| | | isCollectImg: false, |
| | | isCollectVideo: false, |
| | |
| | | "a28cd862d61b5df2201406b76e9f01b0" |
| | | ); |
| | | }, |
| | | getQuestionData() { |
| | | axios |
| | | .get(this.config.activeBook.resourceUrl + "/question.json") |
| | | .then((res) => { |
| | | let oldAnswer = localStorage.getItem( |
| | | this.config.activeBook.name + "oldAnswerData" |
| | | ); |
| | | if (oldAnswer) { |
| | | oldAnswer = JSON.parse(oldAnswer); |
| | | console.log("旧数据", oldAnswer); |
| | | if (oldAnswer[9]) { |
| | | for (let index = 0; index < res.data.data.length; index++) { |
| | | const item = res.data.data[index]; |
| | | if (item.infoList.length) { |
| | | for ( |
| | | let cindex = 0; |
| | | cindex < item.infoList.length; |
| | | cindex++ |
| | | ) { |
| | | const citem = item.infoList[cindex]; |
| | | const question = oldAnswer[9].find( |
| | | (ditem) => ditem.id == citem.id |
| | | ); |
| | | if (question) { |
| | | citem.userAnswer = question.userAnswer; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | this.questionData = res.data.data; |
| | | }); |
| | | }, |
| | | // getQuestionData() { |
| | | // axios |
| | | // .get(this.config.activeBook.resourceUrl + "/question.json") |
| | | // .then((res) => { |
| | | // let oldAnswer = localStorage.getItem( |
| | | // this.config.activeBook.name + "oldAnswerData" |
| | | // ); |
| | | // if (oldAnswer) { |
| | | // oldAnswer = JSON.parse(oldAnswer); |
| | | // console.log("旧数据", oldAnswer); |
| | | // if (oldAnswer[9]) { |
| | | // for (let index = 0; index < res.data.data.length; index++) { |
| | | // const item = res.data.data[index]; |
| | | // if (item.infoList.length) { |
| | | // for ( |
| | | // let cindex = 0; |
| | | // cindex < item.infoList.length; |
| | | // cindex++ |
| | | // ) { |
| | | // const citem = item.infoList[cindex]; |
| | | // const question = oldAnswer[9].find( |
| | | // (ditem) => ditem.id == citem.id |
| | | // ); |
| | | // if (question) { |
| | | // citem.userAnswer = question.userAnswer; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // this.questionData = res.data.data; |
| | | // }); |
| | | // }, |
| | | handleCollect(type) { |
| | | if (type == "img") { |
| | | this.chapterData.isCollectImg = !this.chapterData.isCollectImg; |
| | | this.handleCollectResource("722FE833","",'images/0101-1.jpg',"图片","json",'图3-15') |
| | | } else if (type == "video") { |
| | | this.chapterData.isCollectVideo = !this.chapterData.isCollectVideo; |
| | | this.handleCollectResource("a28cd862d61b5df2201406b76e9f01b0","a28cd862d61b5df2201406b76e9f01b0",'',"视频","bits",'视频:判数函数奇偶性的方法和步骤') |
| | | // setCollectResource(this.config.activeBook.bookId,[]) |
| | | } |
| | | this.handleChapterData(); |
| | | }, |
| | |
| | | this.stepIndex++; |
| | | } |
| | | }, |
| | | //资源收藏事件 |
| | | handleCollectResource(id,md5,resourcePath,resourceType,source,resourceName){ |
| | | console.log(this.collectResourceList); |
| | | let list = this.collectResourceList |
| | | if(list.findIndex(item => item.id == id) > -1) { |
| | | list = list.filter(item => item.id != id) |
| | | } else { |
| | | list.push({ |
| | | id, |
| | | md5, |
| | | resourcePath, |
| | | resourceType, |
| | | source, |
| | | resourceName, |
| | | }) |
| | | } |
| | | this.collectResourceList = list |
| | | setCollectResource(this.config.activeBook.bookId,this.collectResourceList) |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <chapterOne |
| | | v-if="showCatalogList.indexOf(2) > -1" |
| | | :showPageList="loadPageList" |
| | | :questionData="questionDataMap" |
| | | ></chapterOne> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import axios from "axios"; |
| | | import pageHeader from "./header.vue"; |
| | | import chapterOne from "./chapter001.vue"; |
| | | // import chapterTwo from "./chapter002.vue"; |
| | |
| | | import "swiper/swiper-bundle.css"; |
| | | import Viewer from "viewerjs"; |
| | | import "viewerjs/dist/viewer.css"; |
| | | import getQuestionList from "@/assets/methods/examination"; |
| | | export default { |
| | | name:"pageContent", |
| | | data() { |
| | |
| | | questionDataMap: {}, |
| | | renderSignMap: {}, |
| | | highlightData: null, |
| | | questionId: {}, |
| | | collectId:[] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | // txtIndex: 57 |
| | | // }); |
| | | // }, 5000); |
| | | |
| | | // 获取题目id列表 |
| | | this.getQuestionId(); |
| | | this.getCollect() |
| | | }, |
| | | methods: { |
| | | // setZoom1() { |
| | |
| | | this.container ? this.container : document |
| | | ).querySelector(`[page="${data.page}"]`); |
| | | // 创建 createTreeWalker 迭代器,用于遍历文本节点,保存到一个数组 |
| | | const treeWalker = document.createTreeWalker(pageDom, NodeFilter.SHOW_TEXT); |
| | | const treeWalker = document.createTreeWalker( |
| | | pageDom, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | const allTextNodes = []; |
| | | let currentNode = treeWalker.nextNode(); |
| | | while (currentNode) { |
| | |
| | | // 添加页码 |
| | | this.loadPageList.push(Number(page)); |
| | | const catalog = catalogDom.getAttribute("num"); |
| | | // if (!this.questionDataMap[page]) { |
| | | // if (testData && testData[catalog]) { |
| | | // if (testData[catalog][page]) { |
| | | // if (Array.isArray(testData[catalog][page])) { |
| | | // this.questionDataMap[page] = await getQuestionList( |
| | | // page, |
| | | // testData[catalog][page], |
| | | // this.config.activeBook |
| | | // ); |
| | | // } else { |
| | | // const obj = {}; |
| | | // for (let key in testData[catalog][page]) { |
| | | // obj[key] = await getQuestionList( |
| | | // [], |
| | | // testData[catalog][page][key], |
| | | // this.config.activeBook |
| | | // ); |
| | | // } |
| | | // this.questionDataMap[page] = obj; |
| | | // } |
| | | // console.log("题目", this.questionDataMap); |
| | | // } |
| | | // } |
| | | // } |
| | | if (!this.questionDataMap[page]) { |
| | | if (this.questionId && this.questionId[catalog]) { |
| | | if (this.questionId[catalog][page]) { |
| | | this.questionDataMap[page] = await this.getQuestion(catalog, page); |
| | | console.log("题目", this.questionDataMap); |
| | | } |
| | | } |
| | | } |
| | | // 渲染这一页的标记 |
| | | for (const key in this.renderSignMap) { |
| | | if (this.renderSignMap[key][page]) { |
| | |
| | | // 高亮行 |
| | | setTimeout(() => { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker(target, NodeFilter.SHOW_TEXT); |
| | | const pageTextList = document.createTreeWalker( |
| | | target, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | autoplay: { |
| | | //自动开始 |
| | | delay: 3000, //时间间隔 |
| | | disableOnInteraction: false //*手动操作轮播图后不会暂停* |
| | | disableOnInteraction: false, //*手动操作轮播图后不会暂停* |
| | | }, |
| | | paginationClickable: true, |
| | | slidesPerView: 1, // 一组三个 |
| | | spaceBetween: 30, // 间隔 |
| | | // 如果需要前进后退按钮 |
| | | navigation: { |
| | | nextEl: dom.querySelector( |
| | | ".swiper-button-next" |
| | | ), |
| | | prevEl: dom.querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | nextEl: dom.querySelector(".swiper-button-next"), |
| | | prevEl: dom.querySelector(".swiper-button-prev"), |
| | | }, |
| | | // 窗口变化,重新init,针对F11全屏和放大缩小,必须加 |
| | | observer: true, |
| | | observeParents: true |
| | | observeParents: true, |
| | | // // 如果需要分页器 |
| | | // pagination: { |
| | | // el: (this.container ? this.container : document).querySelector( |
| | |
| | | spaceBetween: 30, // 间隔 |
| | | // 如果需要前进后退按钮 |
| | | navigation: { |
| | | nextEl: dom.querySelector( |
| | | ".swiper-button-next" |
| | | ), |
| | | prevEl: dom.querySelector( |
| | | ".swiper-button-prev" |
| | | ) |
| | | nextEl: dom.querySelector(".swiper-button-next"), |
| | | prevEl: dom.querySelector(".swiper-button-prev"), |
| | | }, |
| | | // 窗口变化,重新init,针对F11全屏和放大缩小,必须加 |
| | | observer: true, |
| | |
| | | var paginationInfoEl = dom.querySelector(".pageBox"); |
| | | if (paginationInfoEl) |
| | | paginationInfoEl.textContent = currentPage + "/" + totalPages; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | propsData: { |
| | | showPageList: [], |
| | | questionData: {}, |
| | | isSearch: true |
| | | isSearch: true, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | |
| | | propsData: { |
| | | showPageList: [pageNum], |
| | | questionData: {}, |
| | | isSearch: true |
| | | isSearch: true, |
| | | }, |
| | | }); |
| | | pageExample.$mount( |
| | |
| | | .querySelector(`[page="${pageNum}"]`); |
| | | if (thisPageDom) { |
| | | // 获取页面所有text节点 |
| | | const pageTextList = document.createTreeWalker(thisPageDom, NodeFilter.SHOW_TEXT); |
| | | const pageTextList = document.createTreeWalker( |
| | | thisPageDom, |
| | | NodeFilter.SHOW_TEXT |
| | | ); |
| | | // 匹配关键字 |
| | | const allPageTextNodes = []; |
| | | let currentNode = pageTextList.nextNode(); |
| | |
| | | // 跳转 |
| | | this.gotoPage(data.catalog, data.page, () => {}); |
| | | }, |
| | | // 获取题目列表 |
| | | getQuestionId() { |
| | | axios |
| | | .get(this.config.activeBook.resourceUrl + "/question.json") |
| | | .then((res) => { |
| | | this.questionId = res.data.data; |
| | | }); |
| | | }, |
| | | // 获取题目收藏id列表 |
| | | getCollect() { |
| | | this.MG.identity |
| | | .getUserKey({ |
| | | domain: "collectData", |
| | | keys: [this.config.activeBook.bookId], |
| | | }) |
| | | .then((res) => { |
| | | try { |
| | | const collect = JSON.parse(res[0].value); |
| | | if (collect.length) { |
| | | this.collectId = collect.find(item => item.type == 'json').collectList |
| | | } |
| | | } catch (error) { |
| | | console.log("暂无数据"); |
| | | } |
| | | }).catch(res => { |
| | | console.log('index 请求题目收藏id报错'); |
| | | }) |
| | | }, |
| | | // 获取章节题目 |
| | | async getQuestion(num, page) { |
| | | let cardList = [ |
| | | { |
| | | catalogName: "单选题", |
| | | infoList: [], |
| | | }, |
| | | { |
| | | catalogName: "判断题", |
| | | infoList: [], |
| | | }, |
| | | { |
| | | catalogName: "多选题", |
| | | infoList: [], |
| | | }, |
| | | { |
| | | catalogName: "填空题", |
| | | infoList: [], |
| | | }, |
| | | { |
| | | catalogName: "简答题", |
| | | infoList: [], |
| | | }, |
| | | ]; |
| | | if (this.questionId) { |
| | | if (this.questionId[num] && this.questionId[num][page]) { |
| | | const res = await axios.get( |
| | | this.config.activeBook.resourceUrl + "/question-" + num + ".json" |
| | | ); |
| | | if (!res.data.data) return []; |
| | | for (let index = 0; index < res.data.data.length; index++) { |
| | | const item = res.data.data[index]; |
| | | item.isCollect = this.collectId.indexOf(item.id) > -1 ? true :false |
| | | console.log(item.id ,this.collectId.indexOf(item.id)); |
| | | if (this.questionId[num][page].indexOf(item.id) > -1) { |
| | | if (item.type && item.type == "material") { |
| | | cardList.push(item); |
| | | } else { |
| | | if (item.questionType == "judge") { |
| | | cardList[1].infoList.push(item); |
| | | } else if (item.questionType == "singleChoice") { |
| | | cardList[0].infoList.push(item); |
| | | } else if (item.questionType == "multipleChoice") { |
| | | cardList[2].infoList.push(item); |
| | | } else if (item.questionType == "completion") { |
| | | cardList[3].infoList.push(item); |
| | | } else if (item.questionType == "shortAnswer") { |
| | | cardList[4].infoList.push(item); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return cardList.filter((item) => item.infoList.length > 0); |
| | | } |
| | | } else { |
| | | return []; |
| | | } |
| | | }, |
| | | }, |
| | | components: { |
| | | pageHeader, |
| | |
| | | v-cloak |
| | | ></p> |
| | | </div> |
| | | <img :src="value.isCollect ? isHeart : heart" alt="" class="collect-png" @click="handleCollect(nindex,index)" v-if="!(hideCollect && value.questionType == 'shortAnswer')" > |
| | | <img |
| | | :src="value.isCollect ? isHeart : heart" |
| | | alt="" |
| | | class="collect-png" |
| | | @click="setCollect(nindex, index)" |
| | | v-if="!(hideCollect && value.questionType == 'shortAnswer')" |
| | | /> |
| | | <!-- 收藏 --> |
| | | </div> |
| | | <div class="questionContent"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { Message } from 'element-ui'; |
| | | import { Message } from "element-ui"; |
| | | export default { |
| | | name: "examination-option", |
| | | props: { |
| | |
| | | }, |
| | | hideCollect:{ |
| | | type:Boolean, |
| | | default:false |
| | | } |
| | | default: false, |
| | | }, |
| | | sourceType: { |
| | | type: String, |
| | | default: "bits", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | loading: true, |
| | | heart:require("@/assets/images/heart.png"), |
| | | isHeart:require("@/assets/images/heart-check.png"), |
| | | collectList: [], |
| | | allCollect: [ |
| | | { |
| | | type: "bits", |
| | | collectList: [], |
| | | }, |
| | | { |
| | | type: "json", |
| | | collectList: [], |
| | | }, |
| | | ], |
| | | errorList: [], |
| | | allError: [ |
| | | { |
| | | type: "bits", |
| | | errorList: [], |
| | | }, |
| | | { |
| | | type: "json", |
| | | errorList: [], |
| | | }, |
| | | ], |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // this.cardData = this.cardList |
| | | // console.log('this.cardList',this.cardList); |
| | | // console.log('this.cardData',this.cardData); |
| | | this.getCollectIdList(); |
| | | this.getErrorList() |
| | | }, |
| | | methods: { |
| | | // 数组转为字符串方法 |
| | |
| | | }, |
| | | // 批改题目 (练习,我的做题,我的收藏模式下) |
| | | handleQuestion() { |
| | | 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) |
| | | } |
| | | } |
| | | } |
| | | this.cardData = list; |
| | | console.log(this.cardData); |
| | | 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) |
| | | } |
| | | } |
| | | 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', |
| | | key: this.config.activeBook.bookId, |
| | | value: JSON.stringify(this.allError) |
| | | } |
| | | ] |
| | | }) |
| | | .then((res) => { |
| | | console.log('错题已保存',this.allError) |
| | | }) |
| | | }, |
| | | getParentWithClass(element, className) { |
| | | while (element.parentElement) { |
| | |
| | | this.config.activeBook.name + "oldAnswerData", |
| | | JSON.stringify(oldData) |
| | | ); |
| | | Message.success('保存成功') |
| | | Message.success("保存成功"); |
| | | } |
| | | |
| | | // if(oldData[this.chapter]) { |
| | |
| | | // console.log(oldData); |
| | | }, |
| | | handleCollect(infoNum,num) { |
| | | console.log(this.cardData[infoNum].infoList[num] ); |
| | | this.cardData[infoNum].infoList[num].isCollect = !this.cardData[infoNum].infoList[num].isCollect |
| | | this.cardData[infoNum].infoList[num].isCollect = |
| | | !this.cardData[infoNum].infoList[num].isCollect; |
| | | }, |
| | | // 题目收藏按钮,收藏和取消同一接口,取消数组减去该项id |
| | | setCollect(num, number) { |
| | | const item = this.cardData[num].infoList[number]; |
| | | item.isCollect = !item.isCollect; |
| | | if (this.cardData.length == 0) { |
| | | this.collectList.push(item.id); |
| | | } else { |
| | | const isShow = this.collectList.findIndex((citem) => citem == item.id); |
| | | if (isShow == -1) { |
| | | this.collectList.push(item.id); |
| | | } else { |
| | | this.collectList = this.collectList.filter( |
| | | (citem) => citem != item.id |
| | | ); |
| | | } |
| | | } |
| | | const list = this.collectList; |
| | | for (let index = 0; index < this.allCollect.length; index++) { |
| | | const item = this.allCollect[index]; |
| | | if (item.type == this.sourceType) item.collectList = this.collectList; |
| | | } |
| | | // console.log(this.allCollect, this.collectList, list); |
| | | this.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [ |
| | | { |
| | | domain: "collectData", |
| | | key: this.config.activeBook.bookId, |
| | | value: JSON.stringify(this.allCollect), |
| | | }, |
| | | ], |
| | | }) |
| | | .then((res) => { |
| | | console.log("收藏/取消成功"); |
| | | }); |
| | | }, |
| | | // 获取收藏id列表 |
| | | getCollectIdList() { |
| | | this.MG.identity |
| | | .getUserKey({ |
| | | domain: "collectData", |
| | | keys: [this.config.activeBook.bookId], |
| | | }) |
| | | .then((res) => { |
| | | try { |
| | | const collect = JSON.parse(res[0].value); |
| | | if (collect.length) { |
| | | this.collectList = collect.find( |
| | | (citem) => citem.type == this.sourceType |
| | | ).collectList; |
| | | this.allCollect[0].collectList = collect.find( |
| | | (citem) => citem.type == "bits" |
| | | ).collectList; |
| | | this.allCollect[1].collectList = collect.find( |
| | | (citem) => citem.type == "json" |
| | | ).collectList; |
| | | } |
| | | } catch (error) { |
| | | console.log("暂无数据"); |
| | | } |
| | | }) |
| | | .catch((res) => { |
| | | console.log("答题器请求题目收藏id报错"); |
| | | }); |
| | | }, |
| | | // 获取错题id列表 |
| | | getErrorList() { |
| | | this.MG.identity |
| | | .getUserKey({ |
| | | domain: "errorData", |
| | | keys: [this.config.activeBook.bookId], |
| | | }) |
| | | .then((res) => { |
| | | try { |
| | | const error = JSON.parse(res[0].value); |
| | | if (error.length) { |
| | | this.errorList = error.find( |
| | | (citem) => citem.type == this.sourceType |
| | | ).errorList; |
| | | this.allError[0].errorList = error.find( |
| | | (citem) => citem.type == "bits" |
| | | ).errorList; |
| | | this.allError[1].errorList = error.find( |
| | | (citem) => citem.type == "json" |
| | | ).errorList; |
| | | } |
| | | } catch (error) {} |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | const rightIndex = this.question.options.linkValues.findIndex( |
| | | (citem) => citem.oldId == item.oldId |
| | | ); |
| | | |
| | | answerArr.push({ |
| | | left: index, |
| | | right: rightIndex, |
| | | }); |
| | | } |
| | | console.log(this.question.userChoise,answerArr); |
| | | this.isRight = this.areArraysEqual(this.question.userChoise, answerArr); |
| | | this.isShowAnswer = true; |
| | | }, |