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) { if (res.result && res.result.overall >= 80) {
this.scheduleOnce(()=>{ this.reviewSuccess();
timeout = true; } else {
this.reviewFail(); this.reviewFail();
},3); }
(<any>window).courseware.stopTest((res) => { })
if(!timeout) // let timeout = false
{ // if ((<any>window).courseware && (<any>window).courseware.stopTest) {
this.unscheduleAllCallbacks(); // this.scheduleOnce(()=>{
res = JSON.parse(res) // timeout = true;
if (res.result && res.result.overall >= 80) { // this.reviewFail();
this.reviewSuccess(); // },3);
} else { // (<any>window).courseware.stopTest((res) => {
this.reviewFail(); // if(!timeout)
} // {
} // this.unscheduleAllCallbacks();
}) // res = JSON.parse(res)
} else { // if (res.result && res.result.overall >= 80) {
this.reviewFail(); // 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