From aea7000917a2be637cad55055ff9aeabcd272a19 Mon Sep 17 00:00:00 2001 From: apple502j Date: Sun, 9 Dec 2018 13:14:42 +0900 Subject: [PATCH 1/5] Clear ask bubble when stopForTarget --- src/blocks/scratch3_sensing.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/blocks/scratch3_sensing.js b/src/blocks/scratch3_sensing.js index ee4a009b4..1200786e5 100644 --- a/src/blocks/scratch3_sensing.js +++ b/src/blocks/scratch3_sensing.js @@ -143,11 +143,8 @@ class Scratch3SensingBlocks { )); if (currentlyAsking) { - if (this._questionList.length > 0) { - this._askNextQuestion(); - } else { - this.runtime.emit('QUESTION', null); - } + this.runtime.emit('SAY', stopTarget, null, ''); + this.runtime.emit('QUESTION', null); } } From 73968895d8e39ab303e94d24b416705cc33a4334 Mon Sep 17 00:00:00 2001 From: apple502j Date: Tue, 11 Dec 2018 18:39:09 +0900 Subject: [PATCH 2/5] Display the next ask --- src/blocks/scratch3_sensing.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/blocks/scratch3_sensing.js b/src/blocks/scratch3_sensing.js index 1200786e5..9689e76c6 100644 --- a/src/blocks/scratch3_sensing.js +++ b/src/blocks/scratch3_sensing.js @@ -143,8 +143,12 @@ class Scratch3SensingBlocks { )); if (currentlyAsking) { - this.runtime.emit('SAY', stopTarget, null, ''); - this.runtime.emit('QUESTION', null); + this.runtime.emit('SAY', stopTarget, 'say', null); + if (this._questionList.length > 0) { + this._askNextQuestion(); + } else { + this.runtime.emit('QUESTION', null); + } } } From 6c1031c534cab5d7bc63a3f7c3ab6245d3fa7741 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Fri, 14 Dec 2018 17:35:07 +0900 Subject: [PATCH 3/5] Use '' instead of null Co-Authored-By: apple502j <33279053+apple502j@users.noreply.github.com> --- src/blocks/scratch3_sensing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/scratch3_sensing.js b/src/blocks/scratch3_sensing.js index 9689e76c6..bd5956a60 100644 --- a/src/blocks/scratch3_sensing.js +++ b/src/blocks/scratch3_sensing.js @@ -143,7 +143,7 @@ class Scratch3SensingBlocks { )); if (currentlyAsking) { - this.runtime.emit('SAY', stopTarget, 'say', null); + this.runtime.emit('SAY', stopTarget, 'say', ''); if (this._questionList.length > 0) { this._askNextQuestion(); } else { From e11ff6ba1968595d59215acd1ac4afb5a43d85b6 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Sat, 22 Dec 2018 16:56:45 +0900 Subject: [PATCH 4/5] Fix test --- test/unit/blocks_sensing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/blocks_sensing.js b/test/unit/blocks_sensing.js index 130b27d0b..f1911e4e9 100644 --- a/test/unit/blocks_sensing.js +++ b/test/unit/blocks_sensing.js @@ -67,7 +67,7 @@ test('ask and stop all dismisses question', t => { test('ask and stop other scripts dismisses if it is the last question', t => { const rt = new Runtime(); const s = new Sensing(rt); - const util = {target: {visible: false, sprite: {}}, thread: {}}; + const util = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}}; const expectedQuestion = 'a question'; From 87df9610a62c4882a06382d7f41b4d59c47521c1 Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Sat, 22 Dec 2018 16:57:20 +0900 Subject: [PATCH 5/5] Also here and there --- test/unit/blocks_sensing.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/blocks_sensing.js b/test/unit/blocks_sensing.js index f1911e4e9..a7d9b8ac5 100644 --- a/test/unit/blocks_sensing.js +++ b/test/unit/blocks_sensing.js @@ -94,8 +94,8 @@ test('ask and stop other scripts dismisses if it is the last question', t => { test('ask and stop other scripts asks next question', t => { const rt = new Runtime(); const s = new Sensing(rt); - const util = {target: {visible: false, sprite: {}}, thread: {}}; - const util2 = {target: {visible: false, sprite: {}}, thread: {}}; + const util = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}}; + const util2 = {target: {visible: false, sprite: {}, getCustomState: () => ({})}, thread: {}}; const expectedQuestion = 'a question'; const nextQuestion = 'a followup';