Commit 8ff370a0 authored by 李维's avatar 李维

点击切换题目

parent b59c9ccd
...@@ -672,7 +672,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -672,7 +672,9 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
container.activeStatus = false
container.active = (status=false) => { container.active = (status=false) => {
container.activeStatus = status
if(status) { if(status) {
container.switchStatus("focus") container.switchStatus("focus")
} else { } else {
...@@ -734,6 +736,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -734,6 +736,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
container.blockDisabl = false;
container.checkWhenSwitchQuestion = (withRed, fromIndex, groupIndex, contentSaved?) => { container.checkWhenSwitchQuestion = (withRed, fromIndex, groupIndex, contentSaved?) => {
// container.active(false); // container.active(false);
if(groupIndex!= this.m_currentQuestionIndex) { if(groupIndex!= this.m_currentQuestionIndex) {
...@@ -741,7 +744,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -741,7 +744,10 @@ export class PlayComponent implements OnInit, OnDestroy {
// container.switchStatus("init") // container.switchStatus("init")
} else { } else {
if(this.m_submitedTimes == 0) { if(this.m_submitedTimes == 0) {
container.switchStatus("disable") if(!container.blockDisable) {
container.switchStatus("disable")
} else {
}
} else { } else {
if(container.isCorrect || container.modified) { if(container.isCorrect || container.modified) {
container.switchStatus("disable") container.switchStatus("disable")
...@@ -756,6 +762,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -756,6 +762,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if(!this.m_hasActiveBlock) { if(!this.m_hasActiveBlock) {
this.m_hasActiveBlock = true; this.m_hasActiveBlock = true;
container.active(true) container.active(true)
container.blockDisable = true;
} }
} else { } else {
if(container.isCorrect || container.modified) { if(container.isCorrect || container.modified) {
...@@ -778,7 +785,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -778,7 +785,7 @@ export class PlayComponent implements OnInit, OnDestroy {
return return
} }
if(this.m_currentQuestionIndex != questionIndex) { if(this.m_currentQuestionIndex != questionIndex) {
// this.switchQuestion(this.m_currentQuestionIndex, questionIndex) this.switchQuestion(this.m_currentQuestionIndex, questionIndex)
} else { } else {
if(container.canSetActive()) { if(container.canSetActive()) {
if(this.m_currentInput) { if(this.m_currentInput) {
...@@ -1547,7 +1554,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1547,7 +1554,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.playAudio("sm_switch") this.g_cartoon.playAudio("sm_switch")
if(toIndex.toString().indexOf("-") != -1) { if(toIndex.toString().indexOf("-") != -1) {
let indexArr = toIndex.split("-") let indexArr = toIndex.split("-")
fromIndex = indexArr[0] fromIndex = this.m_currentQuestionIndex // indexArr[0]
indexArr.some(itemIndex => { indexArr.some(itemIndex => {
if(fromIndex == itemIndex) { if(fromIndex == itemIndex) {
return false return false
...@@ -1557,6 +1564,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1557,6 +1564,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
} }
toIndex = Number(toIndex)
this.m_currentQuestionIndex = toIndex; this.m_currentQuestionIndex = toIndex;
this.m_currentInputIndex = 0; this.m_currentInputIndex = 0;
this.m_hasActiveBlock = false; this.m_hasActiveBlock = false;
...@@ -1681,6 +1689,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1681,6 +1689,7 @@ export class PlayComponent implements OnInit, OnDestroy {
resetAllBlockStatus() { resetAllBlockStatus() {
this.m_blockGroup.forEach(group => { this.m_blockGroup.forEach(group => {
group.forEach(block => { group.forEach(block => {
block.blockDisable = false;
block.switchStatus("init") block.switchStatus("init")
}); });
}); });
......
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