Commit aa27271b authored by chenzihui's avatar chenzihui

提交

parent e2bb69df
This diff is collapsed.
......@@ -504,9 +504,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
startTalking() {
if ((<any>window).courseware && (<any>window).courseware.stopTest) {
(<any>window).courseware.startTest(this.data.questions[this.level - 1].text);
}
// if ((<any>window).courseware && (<any>window).courseware.stopTest) {
// (<any>window).courseware.startTest(this.data.questions[this.level - 1].text);
// }
window['courseware'].startTest(this.data.questions[this.level - 1].text);
}
stopTalking() {
......@@ -516,27 +518,34 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.moveOutOkBtn();
this.showWhiteNode();
let timeout = false
if ((<any>window).courseware && (<any>window).courseware.stopTest) {
this.scheduleOnce(()=>{
timeout = true;
this.reviewFail();
},3);
(<any>window).courseware.stopTest((res) => {
if(!timeout)
{
this.unscheduleAllCallbacks();
res = JSON.parse(res)
if (res.result && res.result.overall >= 80) {
this.reviewSuccess();
} else {
this.reviewFail();
}
}
})
} else {
this.reviewFail();
}
window['courseware'].stopTest((res) =>{
if (res.result && res.result.overall >= 80) {
this.reviewSuccess();
} else {
this.reviewFail();
}
})
// let timeout = false
// if ((<any>window).courseware && (<any>window).courseware.stopTest) {
// this.scheduleOnce(()=>{
// timeout = true;
// this.reviewFail();
// },3);
// (<any>window).courseware.stopTest((res) => {
// if(!timeout)
// {
// this.unscheduleAllCallbacks();
// res = JSON.parse(res)
// if (res.result && res.result.overall >= 80) {
// this.reviewSuccess();
// } else {
// this.reviewFail();
// }
// }
// })
// } else {
// this.reviewFail();
// }
}
playLocalAudio(audioName: string){
......
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