diff --git a/index.html b/index.html index 2b307fe..a5636b8 100644 --- a/index.html +++ b/index.html @@ -49,14 +49,16 @@
-
- {{ store_text(item_idx) }} +
+
+ {{ store_text(item_idx) }} +
diff --git a/quiz.js b/quiz.js index b9390bc..f764c3f 100644 --- a/quiz.js +++ b/quiz.js @@ -277,6 +277,25 @@ var app = new Vue({ solution_correct: function() { return this.solution_revealed && this.all_inserted && !this.incorrects.includes(true); }, + reduced_store: function() { + let width = 2; + let reduced_list = []; + for (let row_begin = 0; row_begin < this.store.items.length; row_begin += width) { + let row = []; + let needed = false; + for (let cell = row_begin; cell < this.store.items.length && cell - row_begin < width; cell++) { + let item_idx = this.store.items[cell]; + row.push(item_idx); + if (this.store_card_visible(item_idx)) { + needed = true; + } + } + if (needed) { + reduced_list.push(row); + } + } + return reduced_list; + }, }, methods: { store_text: function(idx) {