Commit f42644eb authored by 李维's avatar 李维

添加二级连线题型

parent f93e3ab1
......@@ -30,6 +30,7 @@ const TEXTINPUT_GROUP = "12";
const VIDEO_PLAY = "13";
const DRAWING = "14";
const DRAWING_CHECK = "15";
const CONNECTION_2LEVEL = "16";
// 评分体系
const RS_15_5L_FAF = "0";
......@@ -625,7 +626,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
validater = this.setHotZoneCheckboxGroup(configItem, isDebug);
this.scoreValidater.push(validater);
break;
// 连线
// 连线
case CONNECTION:
validater = this.setConnectionGroup(configItem, isDebug);
this.scoreValidater.push(validater);
......@@ -664,10 +665,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
case DRAWING:
this.setDrawingArea(configItem, this.data.hotZoneItemArr[configItem.linkHotZoneIndex]);
break;
// 画图题(评分)
case DRAWING_CHECK:
validater = this.setDrawingAreaWithCheck(configItem, this.data.hotZoneItemArr[configItem.linkHotZoneIndex]);
this.scoreValidater.push(validater);
break;
case CONNECTION_2LEVEL:
validater = this.setConnectionGroup2L(configItem, isDebug);
this.scoreValidater.push(validater);
break;
}
});
......@@ -1477,6 +1483,375 @@ export default class SceneComponent extends MyCocosSceneComponent {
return validater;
}
// 设置2级连线组
setConnectionGroup2L(contentData, debugMode=false) {
const uid_1 = getUUID();
const uid_2 = getUUID();
this.allConnectionEndPoints[uid_1] = [];
this.allConnectionEndPoints[uid_2] = [];
// 该题型需要配置一个显示正确错误符号的热区
const resultIconShowData = this.data.hotZoneItemArr[contentData.linkResultShowHotZoneIndex];
const resultIconRect = this.newRectNode(resultIconShowData, layer_2, debugMode);
// 存储所有连线
let currentConnectionList1 = [];
let currentConnectionList2 = [];
// 设置校验器
let validater = () => {
const result = {
detail: {
contentType: CONNECTION,
configIndex: contentData.index,
contentIndex: -1,
results: []
},
configIndex: contentData.index,
rect: resultIconRect,
allRight: true,
score: 0
};
contentData.contentList.forEach((option, index) => {
const detailItem = {
start1Index: index,
// start1Text: option.startTextShow ? option.startTextShow : "",
start2Index: index,
// start2Text: option.startTextShow ? option.startTextShow : "",
correct1EndIndex: index,
// correct1EndText: option.endTextShow ? option.endTextShow : "",
correct2EndIndex: index,
// correct2EndText: option.endTextShow ? option.endTextShow : "",
current1EndIndex: currentConnectionList1[index].linkedIndex,
// current1EndText: currentConnectionList1[index].textShow,
current2EndIndex: currentConnectionList2[index].linkedIndex,
// current2EndText: currentConnectionList2[index].textShow,
right: true
}
if(currentConnectionList1[index].linkedIndex == index && currentConnectionList2[index].linkedIndex == index) {
// 正确 返回分数
result.score += (option.score != null && !isNaN(Number(option.score))) ? Number(option.score) : 0;
} else {
// 错误
detailItem.right = false;
result.allRight = false;
}
result.detail.results.push(detailItem)
});
return [result];
};
contentData.contentList.forEach((option, index) => {
// 开始和结束点
const startHotZoneData1 = this.data.hotZoneItemArr[option.selectStartHotZoneIndex_1];
const startRect1 = this.newRectNode(startHotZoneData1, layer_4, debugMode);
const startHotZoneData2 = this.data.hotZoneItemArr[option.selectStartHotZoneIndex_2];
const startRect2 = this.newRectNode(startHotZoneData2, layer_4, debugMode);
const endHotZoneData1 = this.data.hotZoneItemArr[option.selectEndHotZoneIndex_1];
const endRect1 = this.newRectNode(endHotZoneData1, layer_5, debugMode);
const endHotZoneData2 = this.data.hotZoneItemArr[option.selectEndHotZoneIndex_2];
const endRect2 = this.newRectNode(endHotZoneData2, layer_5, debugMode);
// 第一级连线
const iconStart1 = this.getSprNode("icon_connect_start");
const iconEndActive1 = this.getSprNode("icon_connect_start");
const iconEnd1 = this.getSprNode("icon_connect_end");
iconStart1.zIndex = layer_2;
iconEnd1.zIndex = layer_2;
iconEndActive1.zIndex = layer_2;
iconStart1.x = startRect1.width / 2;
iconStart1.y = startRect1.height / 2;
iconEnd1.x = endRect1.width / 2;
iconEnd1.y = endRect1.height / 2;
iconEndActive1.x = endRect1.width / 2;
iconEndActive1.y = endRect1.height / 2;
iconEndActive1.active = false;
endRect1.addChild(iconEnd1);
endRect1.addChild(iconEndActive1);
startRect1.addChild(iconStart1);
// 第二级连线
const iconStart2 = this.getSprNode("icon_connect_start");
const iconEndActive2 = this.getSprNode("icon_connect_start");
const iconEnd2 = this.getSprNode("icon_connect_end");
iconStart2.zIndex = layer_2;
iconEnd2.zIndex = layer_2;
iconEndActive2.zIndex = layer_2;
iconStart2.x = startRect2.width / 2;
iconStart2.y = startRect2.height / 2;
iconEnd2.x = endRect2.width / 2;
iconEnd2.y = endRect2.height / 2;
iconEndActive2.x = endRect2.width / 2;
iconEndActive2.y = endRect2.height / 2;
iconEndActive2.active = false;
endRect2.addChild(iconEnd2);
endRect2.addChild(iconEndActive2);
startRect2.addChild(iconStart2);
// 第一级连线
// 中心点 左下角 右下角 正确索引
this.allConnectionEndPoints[uid_1].push({
parentNode: endRect1,
endActiveNode: iconEndActive1,
centerPos: endRect1.parent.convertToWorldSpaceAR(cc.v2(endRect1.x + endRect1.width / 2, endRect1.y + endRect1.height / 2)),
leftBottomPos: endRect1.parent.convertToWorldSpaceAR(cc.v2(endRect1.x, endRect1.y)),
rightTopPos: endRect1.parent.convertToWorldSpaceAR(cc.v2(endRect1.x + endRect1.width, endRect1.y + endRect1.height)),
connectionIndex: index,
linkedIndex: -1,
getEndShowText: () => ""
})
// 第二级连线
// 中心点 左下角 右下角 正确索引
this.allConnectionEndPoints[uid_2].push({
parentNode: endRect2,
endActiveNode: iconEndActive2,
centerPos: endRect2.parent.convertToWorldSpaceAR(cc.v2(endRect2.x + endRect2.width / 2, endRect2.y + endRect2.height / 2)),
leftBottomPos: endRect2.parent.convertToWorldSpaceAR(cc.v2(endRect2.x, endRect2.y)),
rightTopPos: endRect2.parent.convertToWorldSpaceAR(cc.v2(endRect2.x + endRect2.width, endRect2.y + endRect2.height)),
connectionIndex: index,
linkedIndex: -1,
getEndShowText: () => ""
})
// 第一级连线
// 新建节点 放置线条
const lineNode1 = new cc.Node();
lineNode1.name = 'connect1_' + index;
startRect1.addChild(lineNode1)
const ctx1 = lineNode1.addComponent(cc.Graphics);
ctx1.lineWidth = 4;
// 第二级连线
// 新建节点 放置线条
const lineNode2 = new cc.Node();
lineNode2.name = 'connect2_' + index;
startRect2.addChild(lineNode2)
const ctx2 = lineNode2.addComponent(cc.Graphics);
ctx2.lineWidth = 4;
// 临时存储连接所用 手指在移动时保存上一次命中的索引
let tempConnectResultIndex1 = -1;
let tempConnectResultIndex2 = -1;
// 第一级连线
// 手点击连线起点 发起连线
startRect1.on(cc.Node.EventType.TOUCH_START, () => {
if(this.submitted) {
return
}
// 因为页面滚动 所以在发起连线时要更新所有终点坐标
this.updateAllConnectionEndPoint();
// 显示所有终点高亮
this.setActiveEndPointsByUID(true, uid_1);
// 禁用滚动 开始连线
this.disableScroll();
// console.log("触摸开始")
})
// 松手 离开屏幕
startRect1.on(cc.Node.EventType.TOUCH_CANCEL, () => {
if(this.submitted) {
return
}
// 启用页面滚动
this.enableScroll();
// 检查是否可以提交
// this.checkCanSubmit();
// 隐藏所有终点高亮
this.setActiveEndPointsByUID(false, uid_1);
// 把命中的节点的连接索引更新
if(tempConnectResultIndex1 >= 0) {
currentConnectionList1[tempConnectResultIndex1].linkedIndex = index;
tempConnectResultIndex1 = -1;
} else {
ctx1.clear()
}
// console.log("触摸取消")
})
startRect1.on(cc.Node.EventType.TOUCH_END, () => {
if(this.submitted) {
return
}
// 启动页面滚动
this.enableScroll();
// 检查是否可以提交
// this.checkCanSubmit();
// 隐藏所有终点高亮
this.setActiveEndPointsByUID(false, uid_1);
// 把命中的节点的连接索引更新
if(tempConnectResultIndex1 >= 0) {
currentConnectionList1[tempConnectResultIndex1].linkedIndex = index;
tempConnectResultIndex1 = -1;
} else {
ctx1.clear()
}
// console.log("触摸结束")
})
startRect1.on(cc.Node.EventType.TOUCH_MOVE, (e) => {
if(this.submitted) {
return
}
// 获取点击的世界坐标
const worldPos = e.getLocation();
// 本地坐标
let localPos = null;
// 遍历所有终点坐标 找到是否命中某一个终点
let hitSomeone = false;
this.allConnectionEndPoints[uid_1].forEach(endPoint => {
if(hitSomeone) {
// 找到命中点 不再处理其他点
return
}
const checkResult = this.checkHitEndPoint(endPoint, worldPos);
if(checkResult.hit) {
hitSomeone = true;
// 命中终点 把线段终点定为热区中心 会产生吸附效果
localPos = lineNode1.parent.convertToNodeSpaceAR(checkResult.centerPos);
// 保存信息 当用户抬手时再判断是否命中
tempConnectResultIndex1 = checkResult.connectionIndex;
} else {
// 没有命中任何终点 线段终点为实际手指位置
localPos = lineNode1.parent.convertToNodeSpaceAR(worldPos);
// 清空保存的连接索引
tempConnectResultIndex1 = -1;
}
})
// 清除上一次的痕迹
ctx1.clear()
// 移动到当前开始节点的中心开始画线
ctx1.moveTo(startRect1.width / 2, startRect1.height / 2);
// 终点坐标在上面已经计算好了 这里使用
ctx1.lineTo(localPos.x, localPos.y);
// 画线
ctx1.stroke();
})
// 第二级连线
// 手点击连线起点 发起连线
startRect2.on(cc.Node.EventType.TOUCH_START, () => {
if(this.submitted) {
return
}
// 因为页面滚动 所以在发起连线时要更新所有终点坐标
this.updateAllConnectionEndPoint();
// 显示所有终点高亮
this.setActiveEndPointsByUID(true, uid_2);
// 禁用滚动 开始连线
this.disableScroll();
// console.log("触摸开始")
})
// 松手 离开屏幕
startRect2.on(cc.Node.EventType.TOUCH_CANCEL, () => {
if(this.submitted) {
return
}
// 启用页面滚动
this.enableScroll();
// 检查是否可以提交
// this.checkCanSubmit();
// 隐藏所有终点高亮
this.setActiveEndPointsByUID(false, uid_2);
// 把命中的节点的连接索引更新
if(tempConnectResultIndex2 >= 0) {
currentConnectionList2[tempConnectResultIndex2].linkedIndex = index;
tempConnectResultIndex2 = -1;
} else {
ctx2.clear()
}
// console.log("触摸取消")
})
startRect2.on(cc.Node.EventType.TOUCH_END, () => {
if(this.submitted) {
return
}
// 启动页面滚动
this.enableScroll();
// 检查是否可以提交
// this.checkCanSubmit();
// 隐藏所有终点高亮
this.setActiveEndPointsByUID(false, uid_2);
// 把命中的节点的连接索引更新
if(tempConnectResultIndex2 >= 0) {
currentConnectionList2[tempConnectResultIndex2].linkedIndex = index;
tempConnectResultIndex2 = -1;
} else {
ctx2.clear()
}
// console.log("触摸结束")
})
startRect2.on(cc.Node.EventType.TOUCH_MOVE, (e) => {
if(this.submitted) {
return
}
// 获取点击的世界坐标
const worldPos = e.getLocation();
// 本地坐标
let localPos = null;
// 遍历所有终点坐标 找到是否命中某一个终点
let hitSomeone = false;
this.allConnectionEndPoints[uid_2].forEach(endPoint => {
if(hitSomeone) {
// 找到命中点 不再处理其他点
return
}
const checkResult = this.checkHitEndPoint(endPoint, worldPos);
if(checkResult.hit) {
hitSomeone = true;
// 命中终点 把线段终点定为热区中心 会产生吸附效果
localPos = lineNode2.parent.convertToNodeSpaceAR(checkResult.centerPos);
// 保存信息 当用户抬手时再判断是否命中
tempConnectResultIndex2 = checkResult.connectionIndex;
} else {
// 没有命中任何终点 线段终点为实际手指位置
localPos = lineNode2.parent.convertToNodeSpaceAR(worldPos);
// 清空保存的连接索引
tempConnectResultIndex2 = -1;
}
})
// 清除上一次的痕迹
ctx2.clear()
// 移动到当前开始节点的中心开始画线
ctx2.moveTo(startRect2.width / 2, startRect2.height / 2);
// 终点坐标在上面已经计算好了 这里使用
ctx2.lineTo(localPos.x, localPos.y);
// 画线
ctx2.stroke();
})
// 第一级连线
currentConnectionList1.push({
rect: startRect1,
linkedIndex: -1,
textShow: option.textShow ? option.textShow : "",
})
// 第二级连线
currentConnectionList2.push({
rect: startRect2,
linkedIndex: -1,
textShow: option.textShow ? option.textShow : "",
})
});
return validater;
}
// 设置连线选择 和联系组的区别是:一个起点可以连接多个终点 、 需要单独为每一个起点配置一个
setConnectionChoice(contentData, debugMode=false) {
const uid = getUUID();
......@@ -2636,15 +3011,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
// 验证答案
console.log("====> 画板", drawingBoard);
const boardScript = drawingBoard.getComponent("DrawingBoard_DG_FAF");
const colorsExist = boardScript.getColors();
result.detail.currentInputText = colorsExist;
console.log("====> 正确", contentData.drawingCheckCorrectColors);
console.log("====> 存在", colorsExist);
let sameColorCount = 0;
for (let i = 0; i < contentData.drawingCheckCorrectColors.length; i++) {
if (colorsExist.includes(contentData.drawingCheckCorrectColors[i])) {
......@@ -3388,7 +3759,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
userStr = this.adaptContraction(userStr);
configStr = this.adaptContraction(configStr);
}
console.log(userStr, configStr)
// 如果是大小写不敏感则统一转换成小写
if(isCaseInsensitive) {
......
export const defaultData = {"hotZoneConfigArr":[{"hotZoneType":"16","linkHotZoneIndex":-1,"audio_url":"","video_url":"","score":"0","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":false,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false,"selectOptionList":[],"contentList":[{"uuid":"b6cd8072-9f74-40d0-9f89-bd67b52060f7","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"6","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"selectStartHotZoneIndex_1":0,"selectEndHotZoneIndex_1":1,"selectStartHotZoneIndex_2":2,"selectEndHotZoneIndex_2":3,"inputText":"","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false}],"linkResultShowHotZoneIndex":4},{"hotZoneType":"15","linkHotZoneIndex":6,"audio_url":"","video_url":"","score":"66","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":false,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false,"selectOptionList":[],"contentList":[],"drawingCheckCorrectColors":["color_red","color_orange","color_yellow","color_green","color_blue","color_purple","color_pink"],"drawingCheckStrictEqual":true}],"bgItem":{"rect":{"x":124.37271750805587,"y":0,"width":1073.2545649838883,"height":4996},"url":"http://staging-teach.cdn.ireadabc.com/d82192902671c1567c237f8b8b6c17b0.jpg"},"hotZoneItemArr":[],"hotZoneBgSliceList":[{"image_url":"http://staging-teach.cdn.ireadabc.com/0e8c2d62dd2c2ce008a931ec24d87db9.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/6c9238d99ab6613e74e76cf817baae45.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/3a159494342e25e0f4513108b065c22d.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/2f9451ae09101f0d0f30568814a30a53.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/5594532559d5cd73f2c08b8badbb25d9.png"}],"scoreConfigArr":[{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[0,1]}]}
\ No newline at end of file
export const defaultData = {"hotZoneConfigArr":[{"hotZoneType":"16","linkHotZoneIndex":-1,"audio_url":"","video_url":"","score":"0","unselectedStyle":"none","selectedStyle":"border","rightOrWrongStyleType":"symbol","inputText":"","keyWordMatch":false,"isCaseInsensitive":false,"openAnswer":false,"useSelectOptionList":false,"keyWordMatchInOrder":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false,"selectOptionList":[],"contentList":[{"uuid":"b6cd8072-9f74-40d0-9f89-bd67b52060f7","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":"6","isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"selectStartHotZoneIndex_1":0,"selectEndHotZoneIndex_1":1,"selectStartHotZoneIndex_2":2,"selectEndHotZoneIndex_2":3,"inputText":"","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false},{"uuid":"298f6e4b-639c-461d-a72b-1b57b0008cb7","text":"","optionShowText":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"linkedShowText":"","selectStartHotZoneIndex":null,"selectEndHotZoneIndex":null,"selectEndHotZoneShowIndex":null,"selectStartHotZoneIndex_1":4,"selectEndHotZoneIndex_1":5,"selectStartHotZoneIndex_2":6,"selectEndHotZoneIndex_2":7,"inputText":"","keyWordMatch":false,"keyWordMatchInOrder":false,"isCaseInsensitive":false,"openAnswer":false,"capitalizedFirstLetter":false,"notAdaptContraction":false,"textAlignLeft":false,"drawingCheckCorrectColors":[],"drawingCheckStrictEqual":false}],"linkResultShowHotZoneIndex":8}],"bgItem":{"rect":{"x":138.37271750805587,"y":0,"width":1073.2545649838883,"height":4996},"url":"http://staging-teach.cdn.ireadabc.com/d82192902671c1567c237f8b8b6c17b0.jpg"},"hotZoneItemArr":[{"index":0,"itemType":"rect","itemName":"1","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":221.63,"y":1235,"width":28,"height":28}},{"index":1,"itemType":"rect","itemName":"2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":274.63,"y":1208,"width":26,"height":26}},{"index":2,"itemType":"rect","itemName":"3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":356.63,"y":1206,"width":26,"height":26}},{"index":3,"itemType":"rect","itemName":"4","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":404.63,"y":1207,"width":26,"height":26}},{"index":4,"itemType":"rect","itemName":"5","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":219.63,"y":1266,"width":32,"height":32}},{"index":5,"itemType":"rect","itemName":"6","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":266.63,"y":1249,"width":34,"height":34}},{"index":6,"itemType":"rect","itemName":"7","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":344.63,"y":1252,"width":32,"height":32}},{"index":7,"itemType":"rect","itemName":"8","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":396.63,"y":1246,"width":38,"height":38}},{"index":8,"itemType":"rect","itemName":"9","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.0546875,"imgScale":1,"mapScale":1.0546875,"rect":{"x":75.63,"y":1197,"width":42,"height":42}}],"hotZoneBgSliceList":[{"image_url":"http://staging-teach.cdn.ireadabc.com/0e8c2d62dd2c2ce008a931ec24d87db9.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/6c9238d99ab6613e74e76cf817baae45.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/3a159494342e25e0f4513108b065c22d.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/2f9451ae09101f0d0f30568814a30a53.png"},{"image_url":"http://staging-teach.cdn.ireadabc.com/5594532559d5cd73f2c08b8badbb25d9.png"}],"scoreConfigArr":[{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[0]}]}
\ No newline at end of file
......@@ -8800,6 +8800,38 @@ let FormComponent = /*@__PURE__*/ (() => {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1}: 结果显示热区为空`);
}
break;
// 2级连线组
case this.CONNECTION_2LEVEL:
hotZoneConfg.contentList.forEach((contentItem, contentIndex) => {
// 分数检查
if (contentItem.score != null && !isNaN(Number(contentItem.score)) && Number(contentItem.score) > 0) {
totalScore += Number(contentItem.score);
}
else {
scoreConfigErr.push(`内容${hotZoneConfigIndex + 1} - 内容清单${contentIndex + 1}: 分数配置为0或者有异常`);
}
// 起点1热区配置检查
if (contentItem.selectStartHotZoneIndex_1 == null || contentItem.selectStartHotZoneIndex_1 == undefined || contentItem.selectStartHotZoneIndex_1 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1} - 内容清单${contentIndex + 1}: 连线起点1热区为空`);
}
// 终点1热区配置检查
if (contentItem.selectEndHotZoneIndex_1 == null || contentItem.selectEndHotZoneIndex_1 == undefined || contentItem.selectEndHotZoneIndex_1 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1} - 内容清单${contentIndex + 1}: 连线终点1热区为空`);
}
// 起点2热区配置检查
if (contentItem.selectStartHotZoneIndex_2 == null || contentItem.selectStartHotZoneIndex_2 == undefined || contentItem.selectStartHotZoneIndex_2 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1} - 内容清单${contentIndex + 1}: 连线起点2热区为空`);
}
// 终点2热区配置检查
if (contentItem.selectEndHotZoneIndex_2 == null || contentItem.selectEndHotZoneIndex_2 == undefined || contentItem.selectEndHotZoneIndex_2 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1} - 内容清单${contentIndex + 1}: 连线终点2热区为空`);
}
});
// 结果显示热区配置检查
if (hotZoneConfg.linkResultShowHotZoneIndex == null || hotZoneConfg.linkResultShowHotZoneIndex == undefined || hotZoneConfg.linkResultShowHotZoneIndex < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex + 1}: 结果显示热区为空`);
}
break;
// 判断对错
case this.RIGHT_OR_WRONG:
hotZoneConfg.contentList.forEach((contentItem, contentIndex) => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15681,6 +15681,43 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, ": \u7ED3\u679C\u663E\u793A\u70ED\u533A\u4E3A\u7A7A"));
}
break;
// 2级连线组
case _this55.CONNECTION_2LEVEL:
hotZoneConfg.contentList.forEach(function (contentItem, contentIndex) {
// 分数检查
if (contentItem.score != null && !isNaN(Number(contentItem.score)) && Number(contentItem.score) > 0) {
totalScore += Number(contentItem.score);
} else {
scoreConfigErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, " - \u5185\u5BB9\u6E05\u5355").concat(contentIndex + 1, ": \u5206\u6570\u914D\u7F6E\u4E3A0\u6216\u8005\u6709\u5F02\u5E38"));
} // 起点1热区配置检查
if (contentItem.selectStartHotZoneIndex_1 == null || contentItem.selectStartHotZoneIndex_1 == undefined || contentItem.selectStartHotZoneIndex_1 < 0) {
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, " - \u5185\u5BB9\u6E05\u5355").concat(contentIndex + 1, ": \u8FDE\u7EBF\u8D77\u70B91\u70ED\u533A\u4E3A\u7A7A"));
} // 终点1热区配置检查
if (contentItem.selectEndHotZoneIndex_1 == null || contentItem.selectEndHotZoneIndex_1 == undefined || contentItem.selectEndHotZoneIndex_1 < 0) {
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, " - \u5185\u5BB9\u6E05\u5355").concat(contentIndex + 1, ": \u8FDE\u7EBF\u7EC8\u70B91\u70ED\u533A\u4E3A\u7A7A"));
} // 起点2热区配置检查
if (contentItem.selectStartHotZoneIndex_2 == null || contentItem.selectStartHotZoneIndex_2 == undefined || contentItem.selectStartHotZoneIndex_2 < 0) {
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, " - \u5185\u5BB9\u6E05\u5355").concat(contentIndex + 1, ": \u8FDE\u7EBF\u8D77\u70B92\u70ED\u533A\u4E3A\u7A7A"));
} // 终点2热区配置检查
if (contentItem.selectEndHotZoneIndex_2 == null || contentItem.selectEndHotZoneIndex_2 == undefined || contentItem.selectEndHotZoneIndex_2 < 0) {
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, " - \u5185\u5BB9\u6E05\u5355").concat(contentIndex + 1, ": \u8FDE\u7EBF\u7EC8\u70B92\u70ED\u533A\u4E3A\u7A7A"));
}
}); // 结果显示热区配置检查
if (hotZoneConfg.linkResultShowHotZoneIndex == null || hotZoneConfg.linkResultShowHotZoneIndex == undefined || hotZoneConfg.linkResultShowHotZoneIndex < 0) {
hotZoneIndexErr.push("\u5185\u5BB9".concat(hotZoneConfigIndex + 1, ": \u7ED3\u679C\u663E\u793A\u70ED\u533A\u4E3A\u7A7A"));
}
break;
// 判断对错
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -453,6 +453,37 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1}: 结果显示热区为空`)
}
break;
// 2级连线组
case this.CONNECTION_2LEVEL:
hotZoneConfg.contentList.forEach((contentItem, contentIndex) => {
// 分数检查
if(contentItem.score != null && !isNaN(Number(contentItem.score)) && Number(contentItem.score) > 0) {
totalScore += Number(contentItem.score);
} else {
scoreConfigErr.push(`内容${hotZoneConfigIndex+1} - 内容清单${contentIndex+1}: 分数配置为0或者有异常`)
}
// 起点1热区配置检查
if(contentItem.selectStartHotZoneIndex_1 == null || contentItem.selectStartHotZoneIndex_1 == undefined || contentItem.selectStartHotZoneIndex_1 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1} - 内容清单${contentIndex+1}: 连线起点1热区为空`)
}
// 终点1热区配置检查
if(contentItem.selectEndHotZoneIndex_1 == null || contentItem.selectEndHotZoneIndex_1 == undefined || contentItem.selectEndHotZoneIndex_1 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1} - 内容清单${contentIndex+1}: 连线终点1热区为空`)
}
// 起点2热区配置检查
if(contentItem.selectStartHotZoneIndex_2 == null || contentItem.selectStartHotZoneIndex_2 == undefined || contentItem.selectStartHotZoneIndex_2 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1} - 内容清单${contentIndex+1}: 连线起点2热区为空`)
}
// 终点2热区配置检查
if(contentItem.selectEndHotZoneIndex_2 == null || contentItem.selectEndHotZoneIndex_2 == undefined || contentItem.selectEndHotZoneIndex_2 < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1} - 内容清单${contentIndex+1}: 连线终点2热区为空`)
}
});
// 结果显示热区配置检查
if(hotZoneConfg.linkResultShowHotZoneIndex == null || hotZoneConfg.linkResultShowHotZoneIndex == undefined || hotZoneConfg.linkResultShowHotZoneIndex < 0) {
hotZoneIndexErr.push(`内容${hotZoneConfigIndex+1}: 结果显示热区为空`)
}
break;
// 判断对错
case this.RIGHT_OR_WRONG:
hotZoneConfg.contentList.forEach((contentItem, contentIndex) => {
......
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