Commit 2d850903 authored by limingzhe's avatar limingzhe

feat: 传图才出现选项

parent c2c41863
...@@ -2369,6 +2369,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2369,6 +2369,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if (formula && isRight) { if (formula && isRight) {
this.changeAnswerBg('rightPic'); this.changeAnswerBg('rightPic');
this.gameEnd();
} else { } else {
...@@ -2378,6 +2379,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2378,6 +2379,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if (!this.isFirstQues) { if (!this.isFirstQues) {
this.gameEnd();
return; return;
} }
this.isFirstQues = false; this.isFirstQues = false;
...@@ -2536,6 +2538,16 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2536,6 +2538,16 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
gameEnd() {
const c = window['courseware'];
if (!c) {
return;
}
c.nextPage();
}
optionRight(opItem) { optionRight(opItem) {
this.changeOpItemBg(opItem, 'rightPic'); this.changeOpItemBg(opItem, 'rightPic');
...@@ -2550,6 +2562,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2550,6 +2562,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}, 2000); }, 2000);
} }
this.gameEnd();
} }
...@@ -2559,6 +2572,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2559,6 +2572,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = false; this.canTouch = false;
if (this.quesNum >= 3) { if (this.quesNum >= 3) {
this.gameEnd();
return; return;
} }
setTimeout(() => { setTimeout(() => {
...@@ -4013,7 +4027,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -4013,7 +4027,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const baseY = subH * 2.5; const baseY = subH * 2.5;
for (let i=0; i<4; i++) { for (let i=0; i<4; i++) {
if (optionArr[i]) { if (optionArr[i] && optionArr[i].pic_url) {
const opItem = this.getOneOpItem(optionArr[i]); const opItem = this.getOneOpItem(optionArr[i]);
const sx = w / opItem.width; const sx = w / opItem.width;
const sy = subH / opItem.height; const sy = subH / opItem.height;
...@@ -4168,7 +4182,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -4168,7 +4182,7 @@ export class PlayComponent implements OnInit, OnDestroy {
const baseY = subH * 2.5; const baseY = subH * 2.5;
for (let i=0; i<optionArr.length; i++) { 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 opItem = this.getOneOpItem(optionArr[i]);
const sx = w / opItem.width; const sx = w / opItem.width;
const sy = subH / opItem.height; const sy = subH / opItem.height;
......
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