| | |
| | | examination.loading = true |
| | | examination.submitStatus = false |
| | | examination.cardList = [] |
| | | examination.collectList = [] |
| | | // examination.collectList = [] |
| | | examination.errorList = [] |
| | | goTop() |
| | | if (props.type == 'option') { |
| | |
| | | domain: 'collectData', |
| | | keys: [props.activeBook.bookId] |
| | | }) |
| | | .then(async (res) => { |
| | | .then(async (res:any) => { |
| | | try { |
| | | const collect = JSON.parse(res[0].value) |
| | | if (collect.length) { |
| | | examination.collectList = collect.find((citem) => citem.type == 'bits').collectList |
| | | examination.collectList = collect.find((citem:any) => citem.type == 'bits').collectList |
| | | examination.allCollect[0].collectList = collect.find( |
| | | (citem) => citem.type == 'bits' |
| | | (citem:any) => citem.type == 'bits' |
| | | ).collectList |
| | | examination.allCollect[1].collectList = collect.find( |
| | | (citem) => citem.type == 'json' |
| | | (citem:any) => citem.type == 'json' |
| | | ).collectList |
| | | } |
| | | } catch (error) {} |
| | |
| | | const getCollectDataList = async () => { |
| | | // 开始请求 |
| | | let oldData = null |
| | | let oldList = [] |
| | | let oldList:any = [] |
| | | let cardList = [ |
| | | { |
| | | catalogName: '单选题', |
| | |
| | | infoList: [] |
| | | } |
| | | ] |
| | | let singleChoiceArr = [] // 单选 |
| | | let judgeArr = [] // 判断 |
| | | let shortArr = [] // 简答 |
| | | let multipleChoiceArr = [] // 多选 |
| | | let completionArr = [] // 填空 |
| | | let singleChoiceArr:any = [] // 单选 |
| | | let judgeArr:any = [] // 判断 |
| | | let shortArr:any = [] // 简答 |
| | | let multipleChoiceArr:any = [] // 多选 |
| | | let completionArr:any = [] // 填空 |
| | | // 11 |
| | | for (let qindex = 0; qindex < examination.collectList.length; qindex++) { |
| | | const qitem = examination.collectList[qindex] |
| | |
| | | questionObj.stem.stemImage = getPublicImage(questionObj.stem.stemImage, 150) |
| | | } |
| | | if (questionObj.optionStyle == 'Image' || questionObj.optionStyle == 'TxtAndImage') { |
| | | questionObj.option.forEach((optionItem) => { |
| | | questionObj.option.forEach((optionItem:any) => { |
| | | if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150) |
| | | }) |
| | | } |
| | |
| | | questionObj.questionType == 'judge' || |
| | | questionObj.questionType == 'multipleChoice') |
| | | ) { |
| | | questionObj.option.forEach((item) => { |
| | | questionObj.option.forEach((item:any) => { |
| | | if (item.txt) |
| | | item.txt = item.txt |
| | | .replace(/\<img/gi, '<img class="option-rich-img"') |