Commit 509f152dcea09ca0dee06bad66f9f3b650dcff8b
1 parent
2428c457
参数命名修改
Showing
1 changed file
with
19 additions
and
19 deletions
src/views/examinationPaper/add.vue
... | ... | @@ -1653,47 +1653,47 @@ export default { |
1653 | 1653 | this.formatQuestionList(); |
1654 | 1654 | this.form.questionList?.map((item) => { |
1655 | 1655 | let types = [{}]; |
1656 | - let addndex = 0; | |
1656 | + let addIndex = 0; | |
1657 | 1657 | item.subQuestions?.map((sub, index) => { |
1658 | 1658 | if (!!sub.questionType) { |
1659 | 1659 | if ( |
1660 | - sub.questionType == types[addndex].qusType && | |
1660 | + sub.questionType == types[addIndex].qusType && | |
1661 | 1661 | sub.questionType != 5 |
1662 | 1662 | ) { |
1663 | 1663 | //同类型批量答案+1 |
1664 | - types[addndex].subNum += 1; | |
1664 | + types[addIndex].subNum += 1; | |
1665 | 1665 | if ( |
1666 | - types[addndex].answerOptions.length < sub.answerOptions.length | |
1666 | + types[addIndex].answerOptions.length < sub.answerOptions.length | |
1667 | 1667 | ) { |
1668 | - types[addndex].answerOptions = sub.answerOptions; | |
1668 | + types[addIndex].answerOptions = sub.answerOptions; | |
1669 | 1669 | } |
1670 | 1670 | |
1671 | - // types[addndex].answerList += this.setAnswer( | |
1671 | + // types[addIndex].answerList += this.setAnswer( | |
1672 | 1672 | // sub.questionType, |
1673 | 1673 | // sub.correctAnswer |
1674 | 1674 | // ); |
1675 | - types[addndex].answerList = ""; | |
1675 | + types[addIndex].answerList = ""; | |
1676 | 1676 | if (index == item.subQuestions.length - 1) { |
1677 | 1677 | //循环最后类型数量大于等于5,保存批量答案 |
1678 | - if (types[addndex].subNum && types[addndex].subNum >= 5) { | |
1679 | - types[addndex].endIndex = sub.questionIndex; | |
1680 | - types[addndex].index = index; | |
1678 | + if (types[addIndex].subNum && types[addIndex].subNum >= 5) { | |
1679 | + types[addIndex].endIndex = sub.questionIndex; | |
1680 | + types[addIndex].index = index; | |
1681 | 1681 | } |
1682 | 1682 | } |
1683 | 1683 | } else { |
1684 | - if (types[addndex].subNum && types[addndex].subNum >= 5) { | |
1684 | + if (types[addIndex].subNum && types[addIndex].subNum >= 5) { | |
1685 | 1685 | //不同类型时如果原有类型数量大于等于5,保存批量答案 |
1686 | - types[addndex].endIndex = | |
1686 | + types[addIndex].endIndex = | |
1687 | 1687 | item.subQuestions[index - 1].questionIndex; |
1688 | - types[addndex].index = index - 1; | |
1689 | - addndex += 1; | |
1690 | - types[addndex] = {}; | |
1688 | + types[addIndex].index = index - 1; | |
1689 | + addIndex += 1; | |
1690 | + types[addIndex] = {}; | |
1691 | 1691 | } |
1692 | 1692 | //不同类型初始化批量答案 |
1693 | - types[addndex].qusType = sub.questionType; | |
1694 | - types[addndex].subNum = 1; | |
1695 | - types[addndex].answerOptions = sub.answerOptions; | |
1696 | - types[addndex].answerList = ""; | |
1693 | + types[addIndex].qusType = sub.questionType; | |
1694 | + types[addIndex].subNum = 1; | |
1695 | + types[addIndex].answerOptions = sub.answerOptions; | |
1696 | + types[addIndex].answerList = ""; | |
1697 | 1697 | } |
1698 | 1698 | } |
1699 | 1699 | }); | ... | ... |