| | |
| | | import { activeBook } from "@/assets/js/config"; |
| | | import MG from "@/assets/js/middleGround/WebMiddleGroundApi"; |
| | | import getPublicImage from "@/assets/js/middleGround/tool"; |
| | | const getQuestionList = (questionList) => { |
| | | const getQuestionList = async (questionList) => { |
| | | let cardList = [ |
| | | { |
| | | catalogName: "单选题", |
| | |
| | | Embedded_QuestionBank_Difficulty: [], |
| | | }, |
| | | }; |
| | | MG.store.getProductDetail(query).then((res) => { |
| | | const res = await MG.store.getProductDetail(query); |
| | | res.datas.cmsDatas[0].datas.forEach((item, index) => { |
| | | const questionObj = { |
| | | number: index + 1, // 题号 |
| | |
| | | shortArr.push(questionObj); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | cardList[0].infoList = singleChoiceArr, |
| | | cardList[1].infoList = judgeArr |
| | |
| | | citem.number = cindex + 1; |
| | | } |
| | | } |
| | | return cardList; |
| | | console.log(cardList.filter(item=>item.infoList.length > 0),"cardList.filter(item=>item.infoList.length > 0)"); |
| | | return cardList.filter(item=>item.infoList.length > 0); |
| | | }; |
| | | |
| | | const getQuestionData = (chapterData) => { |
| | | const getQuestionData = async (chapterData) => { |
| | | const data = { ...chapterData }; |
| | | for (let key in chapterData) { |
| | | data[key] = getQuestionList(chapterData[key]); |
| | | data[key] = await getQuestionList(chapterData[key]); |
| | | } |
| | | return data; |
| | | }; |