diff --git a/README.md b/README.md index 16af8bd..68b70f5 100644 --- a/README.md +++ b/README.md @@ -94,5 +94,6 @@ TODO: installation instructions ```bash blaze run //src/deploy -- \ --alsologtostderr \ - --collection_path=/home/agentydragon/dropbox/anki/agentydragon/collection.anki2 + --collection_path=/home/agentydragon/dropbox/anki/agentydragon/collection.anki2 \ + --anki_path=/home/agentydragon/repos/anki/pylib/anki ``` diff --git a/src/models/permuted_cloze/test.py b/src/models/permuted_cloze/test.py index 72ba839..5b0e5a6 100644 --- a/src/models/permuted_cloze/test.py +++ b/src/models/permuted_cloze/test.py @@ -62,6 +62,9 @@ def test_report_error_on_no_container(self): self.load_front_card(text='Hello World!') self.assertIn('No permuted container', self.get_log()) + # TODO(prvak): Test that front and back permutation for the same card is + # the same. + if __name__ == "__main__": absltest.main() diff --git a/src/shared_styles/common_header.html b/src/shared_styles/common_header.html index 01eddb6..8baf167 100644 --- a/src/shared_styles/common_header.html +++ b/src/shared_styles/common_header.html @@ -6,5 +6,6 @@ {{Log}} {{Type}} {{Card}} + {{text:Text}}
diff --git a/src/shared_styles/note.js b/src/shared_styles/note.js index 08481d5..bd7d946 100644 --- a/src/shared_styles/note.js +++ b/src/shared_styles/note.js @@ -9,8 +9,12 @@ class Note { * @param {?string} logEnabled * @param {?string} noteType * @param {?string} card + * @param {?string} textUnclozed Text field with clozes replaced by their + * exposed content. Used for seeding the PRNG based on card content for + * Permuted Cloze. */ - constructor(heading, deck, tags, seed, logEnabled, noteType, card) { + constructor(heading, deck, tags, seed, logEnabled, noteType, card, + textUnclozed) { this.heading_ = heading; this.deck_ = deck; this.tags_ = tags; @@ -18,6 +22,7 @@ class Note { this.logEnabled_ = logEnabled; this.noteType_ = noteType; this.card_ = card; + this.textUnclozed_ = textUnclozed; } /** @return {?string} */ @@ -34,6 +39,8 @@ class Note { get noteType() { return this.noteType_; } /** @return {?string} */ get card() { return this.card_; } + /** @return {?string} */ + get textUnclozed() { return this.textUnclozed_; } } /** @@ -59,7 +66,8 @@ function obtainNote() { return value; }; return new Note(find("Heading"), find("Deck"), find("Tags"), find("Seed"), - find("Log"), find("Type"), find("Card")); + find("Log"), find("Type"), find("Card"), + find("textUnclozed")); } exports = { diff --git a/src/shared_styles/rng.js b/src/shared_styles/rng.js index 86339a5..abbc651 100644 --- a/src/shared_styles/rng.js +++ b/src/shared_styles/rng.js @@ -77,7 +77,7 @@ function computeRngSeed(note) { hash = addHash(hash, today.getDay()); // Add more fields, including specifically dedicated extra seed. for (const field of [note.heading, note.deck, note.tags, note.seed, - note.noteType, note.card]) { + note.noteType, note.card, note.textUnclozed]) { hash = addHashString(hash, field); } // It would be nice if we could include something about the content of the