Commit 595be320 authored by 章红平's avatar 章红平

提示信息

parent b2c8c214
......@@ -744,7 +744,7 @@
"__id__": 10
},
"_enabled": true,
"alignMode": 1,
"alignMode": 2,
"_target": null,
"_alignFlags": 9,
"_left": 20,
......
......@@ -96,11 +96,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
.to(0.3, { x: -550 })
.start();
}
moveOutCandle1(cb=null) {
moveOutCandle1(cb = null) {
cc.tween(this.candle1)
.to(0.3, { x: -850 })
.call(()=>{
if(cb)cb();
.call(() => {
if (cb) cb();
})
.start();
}
......@@ -143,7 +143,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
startTalking() {
console.log("startText:", this.data.questions[this.questionIndex].text)
if ((<any>window).courseware&&(<any>window).courseware.stopTest) {
if ((<any>window).courseware && (<any>window).courseware.stopTest) {
(<any>window).courseware.startTest(this.data.questions[this.questionIndex].text);
}
this.talking = true;
......@@ -157,28 +157,38 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this.initRedBtn();
this.moveOutCandle2();
this.nowPanel.showBlock();
if ((<any>window).courseware&&(<any>window).courseware.stopTest) {
let fail = () => {
this.answerList[this.questionIndex] = -1
this.stickers.changOneSticker(this.questionIndex, false)
this.nowPanel.showResult(false)
}
// let stopTestOut=setTimeout(()=>{
// },3000)
let timeOut=false;
if ((<any>window).courseware && (<any>window).courseware.stopTest) {
let stopTestOut=setTimeout(()=>{
timeOut=true;
fail();
},3000);
(<any>window).courseware.stopTest((res) => {
res=JSON.parse(res)
console.log("res=========",res.scores,res.result)
if(res.result.overall>=80){
if(!timeOut){
clearTimeout(stopTestOut);
res = JSON.parse(res)
console.log("res=========", res.scores, res.result)
if (res.result.overall >= 80) {
console.log("语音测评成功")
this.answerList[this.questionIndex]=1
this.stickers.changOneSticker(this.questionIndex,true)
this.answerList[this.questionIndex] = 1
this.stickers.changOneSticker(this.questionIndex, true)
this.nowPanel.showResult(true)
}else{
console.log("语音测评失败")
this.answerList[this.questionIndex]=-1
this.stickers.changOneSticker(this.questionIndex,false)
this.nowPanel.showResult(false)
} else {
fail();
}
}
})
}else{
this.answerList[this.questionIndex]=-1
this.nowPanel.showResult(false)
this.stickers.changOneSticker(this.questionIndex,false)
} else {
fail();
}
this.clearTimeouts()
}
......@@ -187,7 +197,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this.initData();;
this.initListener();
}
dataCallBack(){
dataCallBack() {
super.dataCallBack();
this.stickers.node.active = false;
this.nowPanel = this.addPanel()
......@@ -244,8 +254,8 @@ export default class cake_class_1 extends MyCocosSceneComponent {
changeFalse(timeOut = false) {
this.clearTimeouts();
this.answering = false;
this.answerList[this.questionIndex]=-1
this.stickers.changOneSticker(this.questionIndex,false);
this.answerList[this.questionIndex] = -1
this.stickers.changOneSticker(this.questionIndex, false);
this.nowPanel.failPicesAction(timeOut);
console.log("选择错误")
......@@ -315,29 +325,29 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
}
nextQuestion(){
if( this.questionIndex<(this.data.questions.length-1)){
nextQuestion() {
if (this.questionIndex < (this.data.questions.length - 1)) {
this.questionIndex++;
this.nextPanel=this.addPanel();
this.nextPanel.node.x= this.nextPanel.node.width;
this.nextPanel = this.addPanel();
this.nextPanel.node.x = this.nextPanel.node.width;
cc.tween(this.nowPanel.node)
.to(1,{x:-this.nowPanel.node.width})
.call((e)=>{
console.log("e=====",e)
.to(1, { x: -this.nowPanel.node.width })
.call((e) => {
console.log("e=====", e)
e.destroy();
})
.start();
this.nowPanel=this.nextPanel;
this.nowPanel = this.nextPanel;
this.answerList[this.questionIndex] = 0;
this.updateUi()
this.showPanel();
cc.tween(this.nowPanel.node)
.to(1,{x:0})
.call(()=>{
.to(1, { x: 0 })
.call(() => {
})
.start();
}else{
} else {
this.nowPanel.over(this.answerList)
}
......
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