| | |
| | | :cardList="examination.cardList" |
| | | @setCollect="setCollect" |
| | | @onChangeRadio="onChangeRadio" |
| | | @onChangeInput="onChangeInput" |
| | | /> |
| | | </div> |
| | | </li> |
| | |
| | | getErrorList() |
| | | } else if (props.type == 'collectQuestion') { |
| | | examination.submitStatus = true |
| | | await getcollectId() // 获取收藏题目 |
| | | await getcollectId() // 获取收藏题目id |
| | | // 收藏夹 |
| | | } else if (props.type == 'errorQuestion') { |
| | | examination.submitStatus = true |
| | |
| | | } else if (item.questionType == 'singleChoice' || item.questionType == 'judge') { |
| | | // 单选 判断 |
| | | item.isRight = item.answer == item.userAnswer |
| | | } else if (item.questionType == 'shortAnswer') { |
| | | } else if (item.questionType == 'shortAnswer' || item.questionType == 'formula') { |
| | | // 简答 翻译 |
| | | item.isRight = null |
| | | } else if (item.questionType == 'completion') { |
| | |
| | | citem.isUnfold = '' |
| | | examination.isCollapse = false |
| | | } else { |
| | | citem.questionType == 'shortAnswer' ? (citem.isUnfold = true) : (citem.isUnfold = citem.id) |
| | | citem.questionType == 'shortAnswer' || citem.questionType == 'formula' ? (citem.isUnfold = true) : (citem.isUnfold = citem.id) |
| | | examination.isCollapse = true |
| | | } |
| | | } |
| | |
| | | examination.submitStatus = true |
| | | } |
| | | // 题目收藏按钮,收藏和取消同一接口,取消数组减去该项id |
| | | const setCollect = (num: number, number: number) => { |
| | | const item = examination.cardList[num].infoList[number] |
| | | const setCollect = (num: number, number?: number) => { |
| | | let item = null |
| | | if(number) { |
| | | item = examination.cardList[num].infoList[number] |
| | | } else { |
| | | item = examination.cardList[num] |
| | | } |
| | | item.isCollect = !item.isCollect |
| | | if (item.isJson) { |
| | | // json题目收藏取消 |
| | |
| | | } |
| | | // 获取收藏夹 |
| | | const getCollectDataList = async () => { |
| | | console.log('收藏id',examination.allCollect) |
| | | // 开始请求 |
| | | let oldData = null |
| | | let oldList:any = [] |
| | |
| | | isSubmit: false, // 查看解析 |
| | | isRight: null, // 是否正确 |
| | | isComplete: false, |
| | | isCollect: examination.collectList.indexOf(item.id) > -1 ? true : false, |
| | | isCollect: true, |
| | | isUnfold: '' |
| | | } |
| | | // 多选和填空答案肯为数组,要转换JSON格式 |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | console.log('收藏json',jsonCollectList); |
| | | for (let index = 0; index < jsonCollectList.length; index++) { |
| | | const item = jsonCollectList[index] |
| | | if (item.questionType == 'singleChoice') { |
| | |
| | | examination.cardList[2].infoList.push(item) |
| | | } else if (item.questionType == 'completion') { |
| | | examination.cardList[3].infoList.push(item) |
| | | } else if (item.questionType == 'shortAnswer') { |
| | | } else if (item.questionType == 'shortAnswer' || item.questionType == 'formula') { |
| | | examination.cardList[4].infoList.push(item) |
| | | } else if (item.type && item.type == 'material') { |
| | | examination.cardList[examination.cardList.length] = item |
| | | } |
| | | } |
| | | } |
| | | examination.cardList = examination.cardList.filter((item) => item.infoList.length > 0) |
| | | console.log('拼接题', examination.cardList) |
| | |
| | | } else if (item.Embedded_QuestionBank_QuestionType == 'completion') { |
| | | questionObj.type = '填空题' |
| | | completionArr.push(questionObj) |
| | | } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer') { |
| | | } else if (item.Embedded_QuestionBank_QuestionType == 'shortAnswer' ) { |
| | | questionObj.type = '简答题' |
| | | shortArr.push(questionObj) |
| | | } |
| | |
| | | examination.cardList[2].infoList.push(item) |
| | | } else if (item.questionType == 'completion') { |
| | | examination.cardList[3].infoList.push(item) |
| | | } else if (item.questionType == 'shortAnswer') { |
| | | } else if (item.questionType == 'shortAnswer' || item.questionType == 'formula') { |
| | | examination.cardList[4].infoList.push(item) |
| | | } else if (item.type && item.type == 'material') { |
| | | examination.cardList[examination.cardList.length] = item |
| | |
| | | } else if (citem.questionType == 'singleChoice' || citem.questionType == 'judge') { |
| | | if (citem.id == '63825') console.log('i', item) |
| | | citem.isRight = citem.answer == citem.userAnswer |
| | | } else if (citem.questionType == 'shortAnswer') { |
| | | } else if (citem.questionType == 'shortAnswer' || item.questionType == 'formula') { |
| | | // 简答 翻译 |
| | | citem.isRight = null |
| | | } else if (citem.questionType == 'completion') { |
| | |
| | | } |
| | | } |
| | | } |
| | | if (!citem.isRight && citem.questionType != 'shortAnswer') { |
| | | if (!citem.isRight && citem.questionType != 'shortAnswer' && citem.questionType != 'formula') { |
| | | |
| | | // 客观题回答错误 记录错题 |
| | | if (citem.isJson) { |
| | |
| | | console.log('错题已清空') |
| | | }) |
| | | } |
| | | const onChangeInput = (value:any,index:number,cindex:number,dindex:number) => { |
| | | examination.cardList[index].infoList[cindex].userAnswer[dindex] = value |
| | | } |
| | | defineExpose({ handleExaminationDialog }) |
| | | </script> |
| | | |