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

点击切换题目

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