Skip to content

Commit

Permalink
✨ Allow inverse resolution in WordSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
frncesc committed Feb 6, 2022
1 parent 2481407 commit 6666c37
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/activities/textGrid/WordSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}
}
Expand Down
5 changes: 4 additions & 1 deletion test/jclic-demo/demo.jclic
Original file line number Diff line number Diff line change
Expand Up @@ -3406,7 +3406,7 @@
</cells>
<layout position="AB" />
</activity>
<activity class="@textGrid.WordSearch" name="sop03.sop">
<activity class="@textGrid.WordSearch" name="sop03.sop" inverse="true">
<description>
<p>Scrambled letters with MIDI files</p>
</description>
Expand Down Expand Up @@ -3451,12 +3451,15 @@
</style>
<shaper class="@Rectangular" cols="1" rows="3" />
<cell>
<p>BACH</p>
<media type="PLAY_MIDI" level="1" file="bach.mid" />
</cell>
<cell>
<p>MOZART</p>
<media type="PLAY_MIDI" level="1" file="mozart.mid" />
</cell>
<cell>
<p>BRAHMS</p>
<media type="PLAY_MIDI" level="1" file="bressol.mid" />
</cell>
</cells>
Expand Down
10 changes: 7 additions & 3 deletions test/jclic-demo/demo.jclic.json
Original file line number Diff line number Diff line change
Expand Up @@ -6588,6 +6588,7 @@
"sop03.sop": {
"name": "sop03.sop",
"className": "@textGrid.WordSearch",
"invAss": true,
"showSolution": true,
"boxGridPos": "AB",
"messages": {
Expand Down Expand Up @@ -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"
}
]
}
Expand Down

0 comments on commit 6666c37

Please sign in to comment.