Commit 9952f25d authored by 李维's avatar 李维

修复某些题型分数计算出错的问题

parent 91ce9d18
......@@ -655,7 +655,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
result.detail.correctSelect.push(option.isCorrect);
if(option.isCorrect == currentCheckList[index].checked) {
// 正确 返回分数
result.score = option.score && !isNaN(Number(option.score)) ? Number(option.score) : 2;
result.score += option.score && !isNaN(Number(option.score)) ? Number(option.score) : 2;
} else {
// 错误
result.detail.right = false;
......@@ -973,9 +973,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
// 多选题如果有选择错误的 则为0分
if(!reuslt.allRight) {
reuslt.score = 0;
}
// if(!reuslt.allRight) {
// reuslt.score = 0;
// }
return [reuslt];
};
......@@ -2506,6 +2506,13 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 图标太大 缩小一半
errIcon.scale = rightIcon.scale = 0.5;
// 找到对应的组 计算该组得分
resultData.scoreCconfigArr.forEach(item=>{
if(item.linkHotZoneIndexArr.indexOf(result.configIndex) != -1) {
item.score += result.score;
}
})
if(result.allRight) {
// 回答正确
if(result.rect != null) {
......@@ -2523,12 +2530,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
rect.rect.addChild(rect.right ? _rightIcon : _errIcon);
});
}
// 找到对应的组 计算该组得分
resultData.scoreCconfigArr.forEach(item=>{
if(item.linkHotZoneIndexArr.indexOf(result.configIndex) != -1) {
item.score += result.score;
}
})
} else {
// 回答错误
if(result.rect != null) {
......
This diff is collapsed.
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