Commit 5c4ff2d8 authored by 李维's avatar 李维

修复多选题判卷逻辑错误的问题

parent 36c04a00
......@@ -3853,7 +3853,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
let selectedLabels = [];
selectData.forEach(opItem => {
if(opItem.selected) {
selectedLabels.push(opItem.label)
selectedLabels.push(opItem.value)
}
});
......@@ -3885,7 +3885,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// rect - 用于放置正确和错误的符号
const result = {
detail: {
contentType: TEXT_SELECT,
contentType: MULTIPLE_TEXT_SELECT,
configIndex: contentData.index,
contentIndex: index,
currentSelectIndex: [],
......@@ -3904,29 +3904,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
let right = false;
if(contentData.useSelectOptionList) {
// TODO:
// option.selectOptionListIndexArr - 在表单中设定的正确序号数组
// selectData.indexArr - 当前用户选择的序号数组
// 需要修改线面的这行代码的逻辑,判断两个数组的元素完全相同 right = true
// right = selectData.indexArr == option.selectOptionListIndexArr;
let allRight = true;
option.selectOptionListIndexArr.forEach(opIndex => {
if(selectData[opIndex]) {
if(!selectData[opIndex].selected) {
allRight = false;
}
correctSelectTextArr.push(selectData[opIndex].label)
}
});
const selectedIndexArr = [];
selectData.forEach((selItem, index) => {
if(selItem.selected) {
selectedIndexArr.push(index);
currentSelectIndexArr.push(index)
}
});
right = allRight;
option.selectOptionListIndexArr.forEach(opIndex => {
if(selectData[opIndex]) {
correctSelectTextArr.push(selectData[opIndex].value)
}
});
right = selectedIndexArr.every(item=>option.selectOptionListIndexArr.includes(item));
} else {
right = selectData.index == index
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment