Commit a09c7206 authored by 李维's avatar 李维

修复问题

1. 修复音频可以叠加播放的问题
2. 分数部分可以配置不显示
parent ba9261eb
...@@ -209,50 +209,58 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -209,50 +209,58 @@ export default class SceneComponent extends MyCocosSceneComponent {
subScorePanels = []; subScorePanels = [];
totalScorePanel = null; totalScorePanel = null;
initScorePanel() { initScorePanel() {
// 总分节点 // 设置总分节点
// this.totalScorePanel = let totalScore = 0;
if(!isNaN(this.data.totalScoreHotZoneIndex)) { // 若果索引不是数字 或者 索引小于0 则认为是没有配置索引
const totalNode = this.setScorePanel(this.data.hotZoneItemArr[this.data.totalScoreHotZoneIndex], 15); if(isNaN(Number(this.data.totalScoreHotZoneIndex)) || Number(this.data.totalScoreHotZoneIndex) < 0) {
totalNode.score = 0;
totalNode.totalScore = 0;
this.totalScorePanel = totalNode;
} else {
this.totalScorePanel = { this.totalScorePanel = {
node: null, node: null,
setScore: ()=>{0}, setScore: (score)=>{},
score: 0, initTotalScore: (score)=>{}
totalScore: 0,
} }
} else {
this.totalScorePanel = this.setScorePanel(this.data.hotZoneItemArr[this.data.totalScoreHotZoneIndex]);
} }
// 计算每个分数显示区的数据 // 计算每个分数显示区的数据
this.subScorePanels = []; this.subScorePanels = [];
this.data.scoreConfigArr.forEach(scoreConfig => { this.data.scoreConfigArr.forEach(scoreConfig => {
if(isNaN(Number(scoreConfig.linkHotZoneIndex))) { // 若果索引不是数字 或者 索引小于0 则认为是没有配置索引
if(isNaN(Number(scoreConfig.linkHotZoneIndex)) || Number(scoreConfig.linkHotZoneIndex) < 0) {
this.subScorePanels.push({
node: null,
setScore: (score)=>{},
initTotalScore: (score)=>{}
});
return return
} }
const config = this.setScorePanel(this.data.hotZoneItemArr[scoreConfig.linkHotZoneIndex], 15); const config = this.setScorePanel(this.data.hotZoneItemArr[Number(scoreConfig.linkHotZoneIndex)]);
config.score = 0; let subTotalScore = 0;
config.totalScore = 0;
scoreConfig.linkHotZoneIndexArr.forEach(scoreItemIndex => { scoreConfig.linkHotZoneIndexArr.forEach(scoreItemIndex => {
const contentItem = this.data.hotZoneConfigArr[scoreItemIndex]; const contentItem = this.data.hotZoneConfigArr[scoreItemIndex];
// 类型4 热区多选组 分数存储在选项中 -- 其他类型存储在contentItem中 // 类型4 热区多选组 分数存储在选项中 -- 其他类型存储在contentItem中
if(contentItem.hotZoneType == "4") { if(contentItem.hotZoneType == "4") {
contentItem.contentList.forEach(item => { contentItem.contentList.forEach(item => {
if(item.score && !isNaN(Number(item.score))) { if(item.score && !isNaN(Number(item.score))) {
config.totalScore += Number(item.score); subTotalScore += Number(item.score);
} }
}); });
} else { } else {
if(contentItem.score && !isNaN(Number(contentItem.score))) { if(contentItem.score && !isNaN(Number(contentItem.score))) {
config.totalScore += Number(contentItem.score); subTotalScore += Number(contentItem.score);
} }
} }
}); });
// 设置分数区域总分 - 显示
config.initTotalScore(subTotalScore);
// 统计全部总分 // 统计全部总分
this.totalScorePanel.totalScore += config.totalScore; totalScore += subTotalScore;
// 存全局数组 在提交时设置分时 // 存全局数组 在提交时设置分时
this.subScorePanels.push(config); this.subScorePanels.push(config);
}); });
// 设置总分 - 显示
this.totalScorePanel.initTotalScore(totalScore);
} }
// 检查是否可以提交 - 完成全部配置的问题 // 检查是否可以提交 - 完成全部配置的问题
...@@ -564,15 +572,20 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -564,15 +572,20 @@ export default class SceneComponent extends MyCocosSceneComponent {
currentAudioPlay = null; currentAudioPlay = null;
setOneAudioBtn(contentData, hotZoneItemData) { setOneAudioBtn(contentData, hotZoneItemData) {
const {sprNode} = this.newSprNodeByResName(hotZoneItemData, "icon_play_audio"); const {sprNode} = this.newSprNodeByResName(hotZoneItemData, "icon_play_audio");
sprNode.on("click", () => { sprNode.on("click", async () => {
if(this.submitted) { if(this.submitted) {
return; return;
} }
let audioClip = asyncLoadRemote(contentData.audio_url); // 如果当前正在播放音频 则停止音频
if(this.currentAudioPlay != null) {
cc.audioEngine.stop(this.currentAudioPlay);
}
let audioClip = await asyncLoadRemote(contentData.audio_url);
// 需要判断音频是否存在 // 需要判断音频是否存在
if(audioClip) { if(audioClip) {
this.currentAudioPlay = cc.audioEngine.play(audioClip, false, 0.8); this.currentAudioPlay = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(this.currentAudioPlay, () => { cc.audioEngine.setFinishCallback(audioClip, () => {
this.currentAudioPlay = null; this.currentAudioPlay = null;
}); });
} }
...@@ -580,16 +593,29 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -580,16 +593,29 @@ export default class SceneComponent extends MyCocosSceneComponent {
}; };
// 生成一个分数板 // 生成一个分数板
setScorePanel(data, totalScore, debugMode=false) { setScorePanel(data, debugMode=false) {
const rect = this.newRectNode(data, debugMode); const rect = this.newRectNode(data, debugMode);
const node = this.newTextNode(` /${totalScore}`); const node = this.newTextNode("");
const setScore = (score) => { const config = {
node.getComponent(cc.Label).string = `${score}/${totalScore}` node: null,
setScore: (score)=>{},
initTotalScore: (score)=>{}
}
let totalScore = "";
config.setScore = (score) => {
node.getComponent(cc.Label).string = `${score}/${totalScore}`;
}
config.initTotalScore = (score) => {
totalScore = score;
node.getComponent(cc.Label).string = `/${totalScore}`;
} }
config.node = node;
node.x = rect.width / 2; node.x = rect.width / 2;
node.y = rect.height / 2; node.y = rect.height / 2;
rect.addChild(node); rect.addChild(node);
return {node, setScore} return config
} }
// 新建矩形区域 // 新建矩形区域
......
...@@ -135,4 +135,4 @@ ...@@ -135,4 +135,4 @@
// "typeArr": [] // "typeArr": []
// } // }
export const defaultData = {"header_image_url":"http://staging-teach.cdn.ireadabc.com/a4427e34c15b3360ff0554071d676455.png","footer_image_url":"http://staging-teach.cdn.ireadabc.com/bac2bf6c1a9acb0abdeddde3289442e6.png","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/2eb612acb0f6e1e45ceb5b1f2df19c16.png","rect":{"x":83.34504132231405,"y":0,"width":1184.309917355372,"height":1466}},"hotZoneItemArr":[{"index":0,"itemType":"rect","itemName":"1-音频","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":441.65,"y":72.5,"width":49,"height":49}},{"index":1,"itemType":"rect","itemName":"1-选项1","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":230.15,"y":309,"width":38,"height":38}},{"index":2,"itemType":"rect","itemName":"1-选项2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":400.15,"y":309,"width":38,"height":38}},{"index":3,"itemType":"rect","itemName":"1-选项3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":569.15,"y":307,"width":40,"height":40}},{"index":4,"itemType":"rect","itemName":"1-选项4","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":736.65,"y":307.5,"width":43,"height":43}},{"index":5,"itemType":"rect","itemName":"1-选项5","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":906.65,"y":306.5,"width":41,"height":41}},{"index":6,"itemType":"rect","itemName":"1-选项6","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1078.15,"y":308,"width":38,"height":38}},{"index":7,"itemType":"rect","itemName":"2-音频","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":640.15,"y":382,"width":38,"height":38}},{"index":8,"itemType":"rect","itemName":"2-1-Alex","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":166.65,"y":434,"width":61,"height":40}},{"index":9,"itemType":"rect","itemName":"2-1-Anna","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":236.65,"y":436,"width":81,"height":36}},{"index":10,"itemType":"rect","itemName":"2-2-Hello","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":131.65,"y":486,"width":73,"height":40}},{"index":11,"itemType":"rect","itemName":"2-2-Hi","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":212.65,"y":485.5,"width":39,"height":39}},{"index":12,"itemType":"rect","itemName":"2-3-Please","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":233.65,"y":535,"width":87,"height":40}},{"index":13,"itemType":"rect","itemName":"2-3-Thank you","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":335.65,"y":537,"width":119,"height":42}},{"index":14,"itemType":"rect","itemName":"2-4-teacher","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":284.65,"y":594,"width":101,"height":32}},{"index":15,"itemType":"rect","itemName":"2-4-brother","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":397.65,"y":591,"width":97,"height":40}},{"index":16,"itemType":"rect","itemName":"2-5-He","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":131.15,"y":638,"width":44,"height":44}},{"index":17,"itemType":"rect","itemName":"2-5-She","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":190.15,"y":639,"width":46,"height":46}},{"index":18,"itemType":"rect","itemName":"2-6-store","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":308.65,"y":692,"width":71,"height":42}},{"index":19,"itemType":"rect","itemName":"class","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":393.65,"y":692,"width":65,"height":46}},{"index":20,"itemType":"rect","itemName":"3-how are you?","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":555.65,"y":1048,"width":231,"height":50}},{"index":21,"itemType":"rect","itemName":"3-fine, thank you.","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":495.65,"y":918,"width":213,"height":40}},{"index":22,"itemType":"rect","itemName":"分数1","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1041.65,"y":81,"width":83,"height":34}},{"index":23,"itemType":"rect","itemName":"分数2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1047.65,"y":380,"width":75,"height":46}},{"index":24,"itemType":"rect","itemName":"分数3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1043.65,"y":845,"width":81,"height":36}},{"index":25,"itemType":"rect","itemName":"总分","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":970.65,"y":1369,"width":153,"height":58}},{"index":26,"itemType":"rect","itemName":"提交按钮","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":448.15,"y":1362,"width":200,"height":76}},{"index":27,"itemType":"rect","itemName":"重新开始按钮","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":713.15,"y":1365,"width":200,"height":70}}],"hotZoneConfigArr":[{"linkHotZoneIndex":1,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":2,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":3,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":4,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":5,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":6,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":0,"contentList":[],"hotZoneType":"2","audio_url":"http://staging-teach.cdn.ireadabc.com/908ae03284c2e6113191d03cf27c9bc0.mp3"},{"linkHotZoneIndex":7,"contentList":[],"hotZoneType":"2","audio_url":"http://staging-teach.cdn.ireadabc.com/1c7c36844a070048875016e09538f7a0.mp3"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":8},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":9}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":10},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":11}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":12},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":13}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":14},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":15}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":16},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":17}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":18},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":19}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":20,"contentList":[],"hotZoneType":"5","inputText":"how are you?","score":"1"},{"linkHotZoneIndex":21,"contentList":[],"hotZoneType":"5","inputText":"fine, thank you.","score":"1"}],"totalScoreHotZoneIndex":25,"submitHotZoneIndex":26,"replayHotZoneIndex":27,"scoreConfigArr":[{"linkHotZoneIndex":22,"linkHotZoneIndexArr":[0,1,2,3,4,5]},{"linkHotZoneIndex":23,"linkHotZoneIndexArr":[8,9,10,11,12,13]},{"linkHotZoneIndex":24,"linkHotZoneIndexArr":[14,15]}]} export const defaultData = {"header_image_url":"http://staging-teach.cdn.ireadabc.com/a4427e34c15b3360ff0554071d676455.png","footer_image_url":"http://staging-teach.cdn.ireadabc.com/bac2bf6c1a9acb0abdeddde3289442e6.png","bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/2eb612acb0f6e1e45ceb5b1f2df19c16.png","rect":{"x":83.34504132231405,"y":0,"width":1184.309917355372,"height":1466}},"hotZoneItemArr":[{"index":0,"itemType":"rect","itemName":"1-音频","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":441.65,"y":72.5,"width":49,"height":49}},{"index":1,"itemType":"rect","itemName":"1-选项1","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":230.15,"y":309,"width":38,"height":38}},{"index":2,"itemType":"rect","itemName":"1-选项2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":400.15,"y":309,"width":38,"height":38}},{"index":3,"itemType":"rect","itemName":"1-选项3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":569.15,"y":307,"width":40,"height":40}},{"index":4,"itemType":"rect","itemName":"1-选项4","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":736.65,"y":307.5,"width":43,"height":43}},{"index":5,"itemType":"rect","itemName":"1-选项5","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":906.65,"y":306.5,"width":41,"height":41}},{"index":6,"itemType":"rect","itemName":"1-选项6","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1078.15,"y":308,"width":38,"height":38}},{"index":7,"itemType":"rect","itemName":"2-音频","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":640.15,"y":382,"width":38,"height":38}},{"index":8,"itemType":"rect","itemName":"2-1-Alex","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":166.65,"y":434,"width":61,"height":40}},{"index":9,"itemType":"rect","itemName":"2-1-Anna","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":236.65,"y":436,"width":81,"height":36}},{"index":10,"itemType":"rect","itemName":"2-2-Hello","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":131.65,"y":486,"width":73,"height":40}},{"index":11,"itemType":"rect","itemName":"2-2-Hi","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":212.65,"y":485.5,"width":39,"height":39}},{"index":12,"itemType":"rect","itemName":"2-3-Please","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":233.65,"y":535,"width":87,"height":40}},{"index":13,"itemType":"rect","itemName":"2-3-Thank you","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":335.65,"y":537,"width":119,"height":42}},{"index":14,"itemType":"rect","itemName":"2-4-teacher","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":284.65,"y":594,"width":101,"height":32}},{"index":15,"itemType":"rect","itemName":"2-4-brother","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":397.65,"y":591,"width":97,"height":40}},{"index":16,"itemType":"rect","itemName":"2-5-He","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":131.15,"y":638,"width":44,"height":44}},{"index":17,"itemType":"rect","itemName":"2-5-She","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":190.15,"y":639,"width":46,"height":46}},{"index":18,"itemType":"rect","itemName":"2-6-store","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":308.65,"y":692,"width":71,"height":42}},{"index":19,"itemType":"rect","itemName":"class","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":393.65,"y":692,"width":65,"height":46}},{"index":20,"itemType":"rect","itemName":"3-how are you?","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":555.65,"y":1048,"width":231,"height":50}},{"index":21,"itemType":"rect","itemName":"3-fine, thank you.","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":495.65,"y":918,"width":213,"height":40}},{"index":22,"itemType":"rect","itemName":"分数1","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1041.65,"y":81,"width":83,"height":34}},{"index":23,"itemType":"rect","itemName":"分数2","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1047.65,"y":380,"width":75,"height":46}},{"index":24,"itemType":"rect","itemName":"分数3","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":1043.65,"y":845,"width":81,"height":36}},{"index":25,"itemType":"rect","itemName":"总分","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":970.65,"y":1369,"width":153,"height":58}},{"index":26,"itemType":"rect","itemName":"提交按钮","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":448.15,"y":1362,"width":200,"height":76}},{"index":27,"itemType":"rect","itemName":"重新开始按钮","fontSize":50,"fontName":"BRLNSR_1","fontColor":"#8f3758","fontScale":1.05546875,"imgScale":1,"mapScale":1.05546875,"rect":{"x":713.15,"y":1365,"width":200,"height":70}}],"hotZoneConfigArr":[{"linkHotZoneIndex":1,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":2,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":3,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":4,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":5,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":6,"contentList":[{"text":"1","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false},{"text":"2","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"3","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"4","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"5","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false},{"text":"6","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false}],"hotZoneType":"0","score":"1"},{"linkHotZoneIndex":0,"contentList":[],"hotZoneType":"2","audio_url":"http://staging-teach.cdn.ireadabc.com/908ae03284c2e6113191d03cf27c9bc0.mp3"},{"linkHotZoneIndex":7,"contentList":[],"hotZoneType":"2","audio_url":"http://staging-teach.cdn.ireadabc.com/1c7c36844a070048875016e09538f7a0.mp3"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":8},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":9}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":10},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":11}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":12},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":13}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":14},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":15}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":16},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":17}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":-1,"contentList":[{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":false,"isCheck":false,"selectHotZoneIndex":18},{"text":"","image_url":"","hotZoneIndex":null,"score":0,"isCorrect":true,"isCheck":false,"selectHotZoneIndex":19}],"hotZoneType":"3","score":"1"},{"linkHotZoneIndex":20,"contentList":[],"hotZoneType":"5","inputText":"how are you?","score":"1"},{"linkHotZoneIndex":21,"contentList":[],"hotZoneType":"5","inputText":"fine, thank you.","score":"1"}],"totalScoreHotZoneIndex":-1,"submitHotZoneIndex":26,"replayHotZoneIndex":27,"scoreConfigArr":[{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[0,1,2,3,4,5]},{"linkHotZoneIndex":-1,"linkHotZoneIndexArr":[8,9,10,11,12,13]},{"linkHotZoneIndex":24,"linkHotZoneIndexArr":[14,15]}]}
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -50,7 +50,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -50,7 +50,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
color: '#8f3758' color: '#8f3758'
} }
@Input() @Input()
defaultItemType = 'text'; defaultItemType = 'rect';
@Input() @Input()
hotZoneImgSize = 190; hotZoneImgSize = 190;
......
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
<div style="margin: 10px 10px;"> <div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 200px;">分数显示热区:</span> <span style="display: inline-block; text-align: right; width: 200px;">分数显示热区:</span>
<nz-select [(ngModel)]="it.linkHotZoneIndex" style="width: 100px;" (ngModelChange)="save()"> <nz-select [(ngModel)]="it.linkHotZoneIndex" style="width: 100px;" (ngModelChange)="save()">
<nz-option [nzValue]="-1" nzLabel="不显示"></nz-option>
<nz-option *ngFor="let itOPtion of item.hotZoneItemArr" [nzValue]="itOPtion.index" [nzLabel]="itOPtion.index + 1"></nz-option> <nz-option *ngFor="let itOPtion of item.hotZoneItemArr" [nzValue]="itOPtion.index" [nzLabel]="itOPtion.index + 1"></nz-option>
</nz-select> </nz-select>
<span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[it.linkHotZoneIndex] ? item.hotZoneItemArr[it.linkHotZoneIndex].itemName : "未配置"}}</span> <span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[it.linkHotZoneIndex] ? item.hotZoneItemArr[it.linkHotZoneIndex].itemName : "未配置"}}</span>
...@@ -177,6 +178,7 @@ ...@@ -177,6 +178,7 @@
<div style="margin: 10px 10px;"> <div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 100px;">总分显示:</span> <span style="display: inline-block; text-align: right; width: 100px;">总分显示:</span>
<nz-select [(ngModel)]="item.totalScoreHotZoneIndex" style="width: 100px;" (ngModelChange)="save()"> <nz-select [(ngModel)]="item.totalScoreHotZoneIndex" style="width: 100px;" (ngModelChange)="save()">
<nz-option [nzValue]="-1" nzLabel="不显示"></nz-option>
<nz-option *ngFor="let itOPtion of item.hotZoneItemArr" [nzValue]="itOPtion.index" [nzLabel]="itOPtion.index + 1"></nz-option> <nz-option *ngFor="let itOPtion of item.hotZoneItemArr" [nzValue]="itOPtion.index" [nzLabel]="itOPtion.index + 1"></nz-option>
</nz-select> </nz-select>
<span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[item.totalScoreHotZoneIndex] ? item.hotZoneItemArr[item.totalScoreHotZoneIndex].itemName : "未配置"}}</span> <span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[item.totalScoreHotZoneIndex] ? item.hotZoneItemArr[item.totalScoreHotZoneIndex].itemName : "未配置"}}</span>
...@@ -188,13 +190,6 @@ ...@@ -188,13 +190,6 @@
</nz-select> </nz-select>
<span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[item.submitHotZoneIndex] ? item.hotZoneItemArr[item.submitHotZoneIndex].itemName : "未配置"}}</span> <span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[item.submitHotZoneIndex] ? item.hotZoneItemArr[item.submitHotZoneIndex].itemName : "未配置"}}</span>
</div> </div>
<div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 100px;">重做按钮:</span>
<nz-select [(ngModel)]="item.replayHotZoneIndex" style="width: 100px;" (ngModelChange)="save()">
<nz-option *ngFor="let itOPtion of item.hotZoneItemArr" [nzValue]="itOPtion.index" [nzLabel]="itOPtion.index + 1"></nz-option>
</nz-select>
<span style="margin-left: 10px;">热区名:{{item.hotZoneItemArr && item.hotZoneItemArr[item.replayHotZoneIndex] ? item.hotZoneItemArr[item.replayHotZoneIndex].itemName : "未配置"}}</span>
</div>
<button nz-button nzType="dashed" (click)="addScoreConfig()" class="add-btn"> <button nz-button nzType="dashed" (click)="addScoreConfig()" class="add-btn">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加分数组配置 添加分数组配置
......
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