| | |
| | | <!-- 多选题 --> |
| | | <template> |
| | | <div class="answer-container w-full h-full"> |
| | | <el-scrollbar> |
| | |
| | | |
| | | const answerClick = (item) => { |
| | | if (item) { |
| | | // resetAnswer(); |
| | | item.isActive = !item.isActive; |
| | | const answerList = filterAnswer(); |
| | | examStore.setQuestionAnswer(currentType.value, currentIndex.value, answerList.join(',')); |
| | | |
| | | examStore.setQuestionAnswerList(currentType.value, currentIndex.value, answerList); |
| | | } |
| | | }; |
| | | |
| | | const answerState = (item) => { |
| | | if(Array.isArray(activeQuestion.value.answerList) && activeQuestion.value.answerList.includes(item.prefix)) { |
| | | item.isActive = true; |
| | | } |
| | | return { |
| | | active: item.isActive |
| | | }; |
| | | }; |
| | | |
| | | const filterAnswer = () => { |
| | | return activeQuestion.value.questionItemList.filter(item => item.isActive); |
| | | return activeQuestion.value.questionItemList.filter(item => item.isActive).map(item => item.prefix); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |