From 6666c37d36588a93d50d9e29fdcfe2879d86b0c3 Mon Sep 17 00:00:00 2001 From: Francesc Busquets Date: Sun, 6 Feb 2022 10:18:16 +0100 Subject: [PATCH] :sparkles: Allow inverse resolution in WordSearch --- CHANGELOG.md | 1 + src/activities/textGrid/WordSearch.js | 4 ++-- test/jclic-demo/demo.jclic | 5 ++++- test/jclic-demo/demo.jclic.json | 10 +++++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f4a283..87ec1fcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### v2.1.8 (not yet released) #### Improvements - Upgraded dependencies +- Allow "inverse resolution" in word search activities: clues are initially shown, and hidden as they are found on the grid. ### v2.1.7 (2022-01-24) #### Improvements diff --git a/src/activities/textGrid/WordSearch.js b/src/activities/textGrid/WordSearch.js index 3f43c02d..8b3668d2 100644 --- a/src/activities/textGrid/WordSearch.js +++ b/src/activities/textGrid/WordSearch.js @@ -206,7 +206,7 @@ export class WordSearchPanel extends ActivityPanel { this.bgAlt.clearAllBoxes(); if (this.act.shuffleB) this.shuffle([this.bgAlt], true, true); - this.bgAlt.setVisible(this.$animatedBg !== null); + this.bgAlt.setVisible(this.$animatedBg !== null || this.act.invAss); } this.setAndPlayMsg('initial', 'start'); @@ -386,7 +386,7 @@ export class WordSearchPanel extends ActivityPanel { if (k >= 0 && k < this.bgAlt.getNumCells()) { const bx = this.bgAlt.getActiveBox(this.act.clueItems[c]); if (bx) { - bx.setVisible(this.$animatedBg === null); + bx.setVisible(this.$animatedBg === null && !this.act.invAss); m = bx.playMedia(this.ps, delayedActions); } } diff --git a/test/jclic-demo/demo.jclic b/test/jclic-demo/demo.jclic index 49ed2e15..ae6a8a1c 100644 --- a/test/jclic-demo/demo.jclic +++ b/test/jclic-demo/demo.jclic @@ -3406,7 +3406,7 @@ - +

Scrambled letters with MIDI files

@@ -3451,12 +3451,15 @@ +

BACH

+

MOZART

+

BRAHMS

diff --git a/test/jclic-demo/demo.jclic.json b/test/jclic-demo/demo.jclic.json index a95a0928..02664237 100644 --- a/test/jclic-demo/demo.jclic.json +++ b/test/jclic-demo/demo.jclic.json @@ -6588,6 +6588,7 @@ "sop03.sop": { "name": "sop03.sop", "className": "@textGrid.WordSearch", + "invAss": true, "showSolution": true, "boxGridPos": "AB", "messages": { @@ -6615,19 +6616,22 @@ "mediaContent": { "type": "PLAY_MIDI", "file": "bach.mid" - } + }, + "text": "BACH" }, { "mediaContent": { "type": "PLAY_MIDI", "file": "mozart.mid" - } + }, + "text": "MOZART" }, { "mediaContent": { "type": "PLAY_MIDI", "file": "bressol.mid" - } + }, + "text": "BRAHMS" } ] }