diff --git a/src/app/play/play.component.ts b/src/app/play/play.component.ts index 67f07dc09f12661025bddddad52d5fbe6914979e..18ef7d7717dd66f5a710f80e416a0b9e1a87c1a7 100644 --- a/src/app/play/play.component.ts +++ b/src/app/play/play.component.ts @@ -2369,6 +2369,7 @@ export class PlayComponent implements OnInit, OnDestroy { if (formula && isRight) { this.changeAnswerBg('rightPic'); + this.gameEnd(); } else { @@ -2378,6 +2379,7 @@ export class PlayComponent implements OnInit, OnDestroy { if (!this.isFirstQues) { + this.gameEnd(); return; } this.isFirstQues = false; @@ -2536,6 +2538,16 @@ export class PlayComponent implements OnInit, OnDestroy { } } + gameEnd() { + const c = window['courseware']; + if (!c) { + return; + } + + c.nextPage(); + + } + optionRight(opItem) { this.changeOpItemBg(opItem, 'rightPic'); @@ -2550,6 +2562,7 @@ export class PlayComponent implements OnInit, OnDestroy { }, 2000); } + this.gameEnd(); } @@ -2559,6 +2572,7 @@ export class PlayComponent implements OnInit, OnDestroy { this.canTouch = false; if (this.quesNum >= 3) { + this.gameEnd(); return; } setTimeout(() => { @@ -4013,7 +4027,7 @@ export class PlayComponent implements OnInit, OnDestroy { const baseY = subH * 2.5; for (let i=0; i<4; i++) { - if (optionArr[i]) { + if (optionArr[i] && optionArr[i].pic_url) { const opItem = this.getOneOpItem(optionArr[i]); const sx = w / opItem.width; const sy = subH / opItem.height; @@ -4168,7 +4182,7 @@ export class PlayComponent implements OnInit, OnDestroy { const baseY = subH * 2.5; for (let i=0; i<optionArr.length; i++) { - if (optionArr[i]) { + if (optionArr[i] && optionArr[i].pic_url) { const opItem = this.getOneOpItem(optionArr[i]); const sx = w / opItem.width; const sy = subH / opItem.height;