Commit aa27271b authored by chenzihui's avatar chenzihui

提交

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