Compare commits
28
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08c11b2108 | ||
|
|
0264b6084f | ||
|
|
f13f32052b | ||
|
|
6c6fd723bf | ||
|
|
ce4aacb4bc | ||
|
|
5d626dc890 | ||
|
|
9693ed6c79 | ||
|
|
2211d0f4cb | ||
|
|
9ab490e520 | ||
|
|
60bcd2c9fb | ||
|
|
db87a6d33b | ||
|
|
2c580ccaae | ||
|
|
aae09befcd | ||
|
|
9c8e294021 | ||
|
|
3532e82d86 | ||
|
|
fc9c5ea3c1 | ||
|
|
f311e71bde | ||
|
|
061b4f48b5 | ||
|
|
7bf6d5804b | ||
|
|
4ae4ece10f | ||
|
|
bc513810ec | ||
|
|
5934c396c2 | ||
|
|
d37f165c19 | ||
|
|
768ca344c9 | ||
|
|
d5873748cf | ||
|
|
6745f98c27 | ||
|
|
f45d6036e4 | ||
|
|
ee9c531ea6 |
@@ -75,3 +75,6 @@ dmypy.json
|
||||
*.swp
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# PyInstaller spec files
|
||||
*.spec
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes of the flash card program. The format follows
|
||||
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); the version follows
|
||||
[Semantic Versioning](https://semver.org/).
|
||||
|
||||
## [0.1.0] - 2026-10-15
|
||||
|
||||
First release. The solution of day 31 of Udemy's *100 Days of Code: The Complete
|
||||
Python Pro Bootcamp*, for Malay words with Danish translations.
|
||||
|
||||
### Added
|
||||
|
||||
- The four assignment steps: the window with a card and two buttons, a random
|
||||
card on every press, the flip to the translation after 3 seconds, and the
|
||||
progress file `data/words_to_learn.csv`.
|
||||
- A choice of level before learning: the first 100 words, the first 1000 words
|
||||
or all words of the frequency ordered word list; `--level 100|1000|all`.
|
||||
- The spoken Malay word through the optional extra `speech` (gTTS and
|
||||
playsound); `--no-speech`.
|
||||
- A single Windows executable built with PyInstaller (`python
|
||||
tools/build_executable.py`); the progress is kept in a `data/` folder next to
|
||||
it, and a `data/ms-da.csv` next to it replaces the word list inside it.
|
||||
- README, a wiki in English, Danish and Bahasa Malaysia, and Doxygen comments.
|
||||
|
||||
### Known limits
|
||||
|
||||
- The executable is not signed; Windows SmartScreen may warn about it.
|
||||
- The executable is not attached to the release: the upload limit of the server rejects a file of its size. Build it with `python tools/build_executable.py`.
|
||||
- The executable is built for Windows (x64); on Linux and macOS run the program
|
||||
from source or build it on that system.
|
||||
- The Danish column of the word list is machine translated.
|
||||
|
||||
[0.1.0]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases/tag/v0.1.0
|
||||
@@ -15,7 +15,7 @@ A flash card program for learning the most frequent Malay words with their Danis
|
||||
|
||||
## 🧭 Overview
|
||||
|
||||
The program shows a Malay word on a card. After three seconds the card turns over and shows the Danish translation. You press the green tick when you know the word and the red cross when you do not. A known word is removed from the words to learn, and the words still to learn are saved, so the next start continues where you stopped.
|
||||
The program first asks for a level: the first 100 words, the first 1000 words or all words of the word list, which is ordered from the most to the least frequent word. Then it shows a Malay word on a card. After three seconds the card turns over and shows the Danish translation. You press the green tick when you know the word and the red cross when you do not. A known word is removed from the words to learn, and the words still to learn are saved, so the next start continues where you stopped.
|
||||
|
||||
| Part | What it is for |
|
||||
| --- | --- |
|
||||
@@ -23,16 +23,16 @@ The program shows a Malay word on a card. After three seconds the card turns ove
|
||||
| `tests/` | `pytest` tests: `unit`, `integration`, `e2e` |
|
||||
| `data/` | The word list `ms-da.csv` and, after the first known word, your own `words_to_learn.csv` |
|
||||
| `docs/` | Project documents (business case, plan, design, review records), `docs/wiki/` and `docs/images/` |
|
||||
| `tools/` | Helper scripts: `generate_images.py` and `capture_screenshots.py` |
|
||||
| `tools/` | Helper scripts: `generate_images.py`, `capture_screenshots.py` and `build_executable.py` |
|
||||
| `Doxyfile` | Doxygen configuration for the source code documentation |
|
||||
|
||||
The core program uses only the Python standard library. Spoken Malay words are an optional extra.
|
||||
|
||||
### Screenshots
|
||||
|
||||
| Front: the Malay word | Back: the Danish translation after 3 seconds |
|
||||
| --- | --- |
|
||||
| ![The front of a card][screenshot-front] | ![The back of a card][screenshot-back] |
|
||||
| Choose your level | Front: the Malay word | Back: the Danish translation after 3 seconds |
|
||||
| --- | --- | --- |
|
||||
| ![The level screen][screenshot-level] | ![The front of a card][screenshot-front] | ![The back of a card][screenshot-back] |
|
||||
|
||||
### Where is each assignment step?
|
||||
|
||||
@@ -42,6 +42,7 @@ The core program uses only the Python standard library. Spoken Malay words are a
|
||||
| 2. New flash cards | `CsvVocabularyRepository` (the standard library `csv` instead of `pandas`), `Deck.draw`, `StudySession.next_card`, `FlashCardView.next_card` |
|
||||
| 3. Flip the cards | `FlashCardView.flip_card` and `FlashCardView.flip_timer` (`after`, `after_cancel`), `FlashCardViewModel.flip_card` |
|
||||
| 4. Save your progress | `FlashCardView.is_known`, `StudySession.mark_known`, `CsvProgressRepository` |
|
||||
| Extra: level choice | `LevelView`, `LevelViewModel`, `Level`, `Deck.within`, `StudySession.next_card`, `open_study_session` |
|
||||
| Extra: spoken word | `GttsSpeech`, `NullSpeech`, `build_speech` in `presentation/app.py` |
|
||||
|
||||
The wiki ([English][wiki-en], [Dansk][wiki-da], [Bahasa Malaysia][wiki-ms]) explains the same in three languages.
|
||||
@@ -57,6 +58,7 @@ The wiki ([English][wiki-en], [Dansk][wiki-da], [Bahasa Malaysia][wiki-ms]) expl
|
||||
| Python 3.13 or later, with Tkinter | The program and its window (Tkinter is part of the standard Python installers for Windows and macOS; on Debian or Ubuntu install `python3-tk`) |
|
||||
| `git` | To clone the repository |
|
||||
| Doxygen (optional) | To build the source code documentation |
|
||||
| `pyinstaller` (optional, extra `build`) | To build a single executable file (see Run) |
|
||||
| `gTTS` and `playsound==1.2.2` (optional, extra `speech`) | To hear the Malay word; needs a network connection |
|
||||
|
||||
## 🛠️ Setup
|
||||
@@ -92,14 +94,40 @@ python -m pip install -e ".[dev]"
|
||||
python -m flash_card
|
||||
```
|
||||
|
||||
The program is run from the activated `.venv`. The window opens with a card. Press the green tick for a word you know and the red cross for a word you do not. Options:
|
||||
The program is run from the activated `.venv`. The window opens with the level screen: choose 100 words, 1000 words or All words. Then a card appears. Press the green tick for a word you know and the red cross for a word you do not. Options:
|
||||
|
||||
| Option | Meaning |
|
||||
| --- | --- |
|
||||
| `--data-dir <folder>` | Folder with `ms-da.csv` and `words_to_learn.csv` |
|
||||
| `--level {100,1000,all}` | Start at that level and skip the level screen |
|
||||
| `--no-speech` | Do not speak the Malay word |
|
||||
|
||||
To start again, delete `data/words_to_learn.csv`.
|
||||
Known words stay known at every level: the level only limits which of the words you do not know yet come up. To start again, delete `data/words_to_learn.csv` or use the menu.
|
||||
|
||||
### Menu bar
|
||||
|
||||
![The window with the menu bar][screenshot-menu]
|
||||
|
||||
| Menu | Command | What it does |
|
||||
| --- | --- | --- |
|
||||
| File | Open... | Opens another word list from a CSV file (header with two language codes, for example `en;da`). Progress is kept apart for each list |
|
||||
| File | Change level... | Shows the level choice again without a restart; known words stay known |
|
||||
| File | Reset word list... | After a confirmation removes the progress of the open list, so all its words are to learn again; the list file is not changed |
|
||||
| File | Exit | Closes the program |
|
||||
| About | Contact | The author, Jens Tirsvad Nielsen, Software engineer; opens the LinkedIn page in your browser |
|
||||
|
||||
The progress of the delivered `ms-da.csv` is `data/words_to_learn.csv`; another list gets `data/words_to_learn_<name>.csv`. The opened list is not remembered after a restart.
|
||||
|
||||
### Executable (Windows, no Python needed to run it)
|
||||
|
||||
The [release page][release-0-1-0] of v0.1.0 has the release notes. The executable is not attached there yet, because the server's upload limit rejects a file of this size (HTTP 413). Build it yourself:
|
||||
|
||||
```powershell
|
||||
python -m pip install -e ".[build,speech]"
|
||||
python tools/build_executable.py
|
||||
```
|
||||
|
||||
The script builds `dist/flash-card.exe`: one file, no console window, with the images, the word list and the spoken word inside. Open it by double-clicking. It keeps your progress in a `data/` folder next to the executable (`data/words_to_learn.csv`); a `data/ms-da.csv` next to it replaces the word list inside. Add `--no-speech` to the build script to leave the speech packages out. The executable is a build output and is not committed; build it on the system you want to run it on (Windows, Linux or macOS).
|
||||
|
||||
## 🧪 Tests
|
||||
|
||||
@@ -128,6 +156,7 @@ GNU Affero General Public License v3.0 or later. See [LICENSE][license].
|
||||
- [Repository][repository]
|
||||
- [Documentation][documentation]
|
||||
- [Issue tracker][issues]
|
||||
- [Releases][releases] (v0.1.0: release notes; the executable is built from source, see Run)
|
||||
|
||||
## 📎 Appendix: Project documents
|
||||
|
||||
@@ -149,7 +178,9 @@ The documents a newcomer needs, in reading order.
|
||||
---
|
||||
|
||||
[license]: ./LICENSE
|
||||
[screenshot-level]: ./docs/images/screenshot-level.png
|
||||
[screenshot-front]: ./docs/images/screenshot-front.png
|
||||
[screenshot-menu]: ./docs/images/screenshot-menu.png
|
||||
[screenshot-back]: ./docs/images/screenshot-back.png
|
||||
[wiki-en]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/wiki/Home
|
||||
[wiki-da]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/wiki/Home-da
|
||||
@@ -158,6 +189,8 @@ The documents a newcomer needs, in reading order.
|
||||
[repository]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card
|
||||
[documentation]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/wiki
|
||||
[issues]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/issues
|
||||
[releases]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases
|
||||
[release-0-1-0]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases/tag/v0.1.0
|
||||
[agents]: ./AGENTS.md
|
||||
[BC-001]: ./docs/business-case.md
|
||||
[SA-001]: ./docs/stakeholder-analysis.md
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# ADR-0004: Windows executable built with PyInstaller
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | ADR-0004 |
|
||||
| CrossReference | [BC-001], [US-001], [DCD-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
Allowed Status values: `Proposed`, `Accepted`, `Rejected`, `Deprecated`, `Superseded by ADR-NNNN`.
|
||||
|
||||
---
|
||||
|
||||
## Context
|
||||
|
||||
The Product Owner (S01) wants an executable file, so that the program can be started without a Python installation (US-001.07). The program has images, a word list, a progress file that must survive restarts, and an optional speech extra. Options:
|
||||
|
||||
1. A one-directory build (a folder with the executable and its libraries): starts faster and the data can sit beside the files, but it is a folder of hundreds of files to hand over.
|
||||
2. A one-file build (a single `flash-card.exe` that unpacks itself to a temporary folder): one file to hand over, slower start; resources are in a temporary folder, so progress needs a place beside the executable.
|
||||
3. Another packager (Nuitka, cx_Freeze) or an installer: more tooling and a larger change for the same result.
|
||||
|
||||
## Decision
|
||||
|
||||
Build a one-file, windowed (no console) Windows executable with PyInstaller by `tools/build_executable.py`. The images and the word list are inside the executable. The progress file and an optional word list are in a `data/` folder beside the executable (found with `sys.executable` when `sys.frozen` is set), and `--data-dir` still overrides it. PyInstaller is only in the optional extra `build`, so `dependencies` stays empty (ADR-0001). The executable is a build output and is not committed.
|
||||
|
||||
## Consequences
|
||||
|
||||
**Positive:**
|
||||
|
||||
- One file to hand over, and no Python, `.venv` or pip needed to run it.
|
||||
- The source run is unchanged; only the path rule differs when frozen, and it is tested without PyInstaller.
|
||||
- The word list stays editable beside the executable.
|
||||
|
||||
**Negative:**
|
||||
|
||||
- PyInstaller cannot cross-compile: the executable must be built on Windows (and on Linux or macOS for those systems).
|
||||
- A one-file executable unpacks to a temporary folder at each start and is larger with the speech packages; unsigned executables can trigger Windows SmartScreen or antivirus warnings.
|
||||
- The Windows Store Python can cause Tcl/Tk path problems with PyInstaller; a build with it must be checked by a real start.
|
||||
|
||||
## Affected Artifacts
|
||||
|
||||
- [BC-001] — scope: the executable is in scope; installer, signing and release upload are out
|
||||
- [US-001] — US-001.07 Start without Python
|
||||
- [DCD-001] — packaging support and the choice of the word list file in the composition root
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../business-case.md
|
||||
[US-001]: ../user-stories.md
|
||||
[DCD-001]: ../dcd.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -14,7 +14,7 @@ document of a type. `Primary File` may contain a glob (e.g.
|
||||
| BC | Business Case | docs/business-case.md | 002 |
|
||||
| SA | Stakeholder Analysis | docs/stakeholder-analysis.md | 002 |
|
||||
| PP | Project Plan | docs/project-plan.md | 002 |
|
||||
| MIL | Milestone / Gateway | docs/milestones/*.md | 009 |
|
||||
| MIL | Milestone / Gateway | docs/milestones/*.md | 013 |
|
||||
| UCD | Use Case Diagram | docs/use-case-diagram.md | 002 |
|
||||
| US | User Story | docs/user-stories.md | 002 |
|
||||
| UC | Use Case | docs/uc-*/uc.md | 002 |
|
||||
@@ -24,8 +24,8 @@ document of a type. `Primary File` may contain a glob (e.g.
|
||||
| SSD | System Sequence Diagram | docs/uc-*/ssd.md | 002 |
|
||||
| DCD | Design Class Diagram | docs/dcd.md | 002 |
|
||||
| DICT | Domain Dictionary | docs/dictionary.md | 002 |
|
||||
| ADR | Architecture Decision Record | docs/adr/adr-NNNN-*.md | 0004 |
|
||||
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 041 |
|
||||
| ADR | Architecture Decision Record | docs/adr/adr-NNNN-*.md | 0005 |
|
||||
| RC | SQA Review Record | docs/sqa/reviews/rc-*.md | 071 |
|
||||
| TM | Traceability Matrix | docs/sqa/traceability-matrix.md | 002 |
|
||||
|
||||
## Languages
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | In Scope: choice of level (new request of S01) | [0b983b7] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | In Scope: menu bar (new request of S01) | [2211d0f] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Scope: tagged releases v0.1.0 and v0.2.0 (new request of S01) | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
@@ -54,6 +54,9 @@ A small, well-structured reference solution gives the Product Owner a language l
|
||||
- Saving the words still to learn to `data/words_to_learn.csv` and using that file on the next start.
|
||||
- Optional spoken Malay word (text to speech) as an extra that can be installed.
|
||||
- A choice of level (the first 100 words, the first 1000 words or all words of the frequency ordered word list) before learning starts.
|
||||
- A menu bar with the commands to open another word list (CSV), change the level, reset a word list, exit, and the author's contact.
|
||||
- A single Windows executable file, built with PyInstaller by a script of this repository, that runs without an installed Python.
|
||||
- Tagged releases of the repository (`v0.1.0`, `v0.2.0`), each with release notes and, when the git host accepts the upload, the executable and its SHA-256 checksum attached.
|
||||
- `pyproject.toml`, `.gitignore`, `Doxyfile`, virtual environment instructions, `pytest` tests and `constants.py`.
|
||||
- README from the framework template, screenshots, and a wiki in English, Danish and Bahasa Malaysia.
|
||||
- Repository description and topics on the git host.
|
||||
@@ -63,7 +66,7 @@ A small, well-structured reference solution gives the Product Owner a language l
|
||||
|
||||
- Other languages: the user interface labels are Malay and Danish only; another word list works by changing the data file but is not delivered.
|
||||
- Spaced repetition scheduling, statistics, accounts, cloud synchronisation and mobile apps.
|
||||
- Packaging for distribution on PyPI or as an installer.
|
||||
- Packaging for distribution on PyPI, an installer and a signed executable (the executable built with PyInstaller and its release on the git host are in scope; the file itself is not committed to the repository).
|
||||
- Redistribution of the course's own image files; the card and button images are generated for this project.
|
||||
- A translation quality review of the word list.
|
||||
|
||||
@@ -148,5 +151,5 @@ Proceed — the scope is small, the risks are mitigated, and the result serves t
|
||||
---
|
||||
|
||||
[SA-001]: ./stakeholder-analysis.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
|
||||
+48
-8
@@ -4,19 +4,19 @@
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | DCD-001 |
|
||||
| CrossReference | [DM-001], [SD-001], [DICT-001], [ADR-0002] |
|
||||
| CrossReference | [DM-001], [SD-001], [DICT-001], [ADR-0002], [ADR-0004] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added Level, Deck.within, the level argument and the level screen | [0b983b7] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Scope note: runtime path rules and the executable build are packaging support, not design classes | [768ca34] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the menu classes, Application and ProgressRepository.reset | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose and Scope
|
||||
|
||||
The design classes of the program in `src/flash_card/`, in four layers (domain, application, infrastructure, presentation) with the presentation pattern MVVM ([ADR-0002]). The classes refine the concepts of [DM-001]; names are the IT terms of [DICT-001]. Methods trace to the operation contracts of [OC-001] and the sequence diagrams of [SD-001] (the SSD messages are in [SSD-001]).
|
||||
The design classes of the program in `src/flash_card/`, in four layers (domain, application, infrastructure, presentation) with the presentation pattern MVVM ([ADR-0002]). The classes refine the concepts of [DM-001]; names are the IT terms of [DICT-001]. Methods trace to the operation contracts of [OC-001] and the sequence diagrams of [SD-001] (the SSD messages are in [SSD-001]). The module `flash_card/runtime.py` (where the resources and the data folder are when the program is frozen by PyInstaller) and the scripts in `tools/` are packaging support ([ADR-0004]): they have no system operation and are not design classes; `app.main` is still the only place that names the adapters, and it chooses the word list file.
|
||||
|
||||
## Diagram
|
||||
|
||||
@@ -55,6 +55,7 @@ package domain {
|
||||
interface ProgressRepository {
|
||||
+load() : Deck | None
|
||||
+save(deck : Deck) : None
|
||||
+reset() : None
|
||||
}
|
||||
class VocabularyError
|
||||
class VocabularyFormatError
|
||||
@@ -101,6 +102,29 @@ package infrastructure {
|
||||
}
|
||||
}
|
||||
package presentation {
|
||||
class MenuEntry <<frozen>> {
|
||||
+label : str
|
||||
+command : str
|
||||
}
|
||||
class MenuViewModel {
|
||||
+file_entries : tuple[MenuEntry, ...]
|
||||
+contact_label : str
|
||||
+contact_url : str
|
||||
}
|
||||
class MenuView {
|
||||
+open_word_list() : None
|
||||
+change_level() : None
|
||||
+reset_word_list() : None
|
||||
+show_contact() : None
|
||||
+exit_program() : None
|
||||
}
|
||||
class Application {
|
||||
+start(level : Level) : None
|
||||
+open_word_list(path : Path) : None
|
||||
+change_level() : None
|
||||
+reset_word_list() : None
|
||||
+exit_application() : None
|
||||
}
|
||||
class LevelChoice <<frozen>> {
|
||||
+label : str
|
||||
+level : Level
|
||||
@@ -161,6 +185,12 @@ Main ..> CsvVocabularyRepository : composes
|
||||
Main ..> CsvProgressRepository : composes
|
||||
Main ..> GttsSpeech : composes
|
||||
Main ..> FlashCardView : composes
|
||||
Main ..> Application : creates
|
||||
Main ..> MenuView : composes
|
||||
MenuView "1" --> "1" MenuViewModel
|
||||
MenuViewModel "1" *-- "5" MenuEntry
|
||||
MenuView "1" --> "1" Application
|
||||
Application ..> ProgressRepository : resets
|
||||
@enduml
|
||||
```
|
||||
|
||||
@@ -182,6 +212,9 @@ Main ..> FlashCardView : composes
|
||||
| `GttsSpeech`, `NullSpeech` | (none) | Adapters for speech: the gTTS service, and silence | none | `speak` |
|
||||
| `FlashCardViewModel` | Study Session | Exposes the side, language name and text of the card shown, and the three commands | `_session`, `side`, `language_name`, `text` | `next_card`, `flip_card`, `is_known` |
|
||||
| `LevelChoice`, `LevelViewModel` | Level | Plain data and view model of the level screen: the title and the three choices with their labels | `title`, `choices` | none |
|
||||
| `MenuEntry`, `MenuViewModel` | (none: user interface) | Plain data and view model of the menu bar: the labels and the order of the File entries, the contact label and link | `file_entries`, `contact_label`, `contact_url` | none |
|
||||
| `MenuView` | (none: user interface) | Draws the menu bar, asks the dialogs (file, confirmation, messages) and forwards the command | menus | `open_word_list`, `change_level`, `reset_word_list`, `show_contact`, `exit_program` |
|
||||
| `Application` | Study Session | Holds the window, the word list and the progress in use; starts, drops and replaces sessions on level choice and menu commands | `root`, `view`, `exit_code` | `start`, `open_word_list`, `change_level`, `reset_word_list`, `exit_application` |
|
||||
| `LevelView` | (none: user interface) | Draws the level screen and forwards the chosen level | buttons | `choose` |
|
||||
| `FlashCardView` | (none: user interface) | Draws the window, forwards the buttons, owns the 3000 ms timer | `flip_timer`, widgets | `next_card`, `flip_card`, `is_known` |
|
||||
|
||||
@@ -192,6 +225,11 @@ Main ..> FlashCardView : composes
|
||||
| `open_study_session(vocabulary_repository, progress_repository, speech, choose, level) -> StudySession` | [OC-001] `chooseLevel`, [SD-001] sequence chooseLevel (loads the words to learn and the level's cards) |
|
||||
| `Level.first(cards) -> tuple[Card, ...]`, `Deck.within(cards) -> tuple[Card, ...]` | [OC-001] `chooseLevel` postcondition (the level's cards); [SD-001] |
|
||||
| `LevelViewModel.choices -> tuple[LevelChoice, ...]` | [OC-001] `startStudySession`; [SD-001] sequence startStudySession |
|
||||
| `Application.open_word_list(path) -> None` | [OC-001] `openWordList`; [SD-001] sequence openWordList |
|
||||
| `Application.change_level() -> None` | [OC-001] `changeLevel` |
|
||||
| `Application.reset_word_list() -> None`, `ProgressRepository.reset() -> None` | [OC-001] `resetWordList`; [SD-001] sequence resetWordList |
|
||||
| `MenuView.show_contact() -> None` | [OC-001] `showContact` |
|
||||
| `Application.exit_application() -> None`, `MenuView.exit_program() -> None` | [OC-001] `exit` |
|
||||
| `LevelView.choose(level) -> None` | [OC-001] `chooseLevel` (forwards the level to the composition root) |
|
||||
| `StudySession.next_card() -> CardDto \| None` | [OC-001] `chooseLevel` (first card), `markUnknown`; [SD-001] |
|
||||
| `StudySession.mark_known() -> None` | [OC-001] `markKnown` (remove and save); [SD-001] |
|
||||
@@ -207,8 +245,9 @@ Main ..> FlashCardView : composes
|
||||
| Repository | `VocabularyRepository`, `ProgressRepository`, CSV adapters | The domain does not know the CSV file |
|
||||
| Ports and adapters | `SpeechPort`, `GttsSpeech`, `NullSpeech` | Speech is an optional extra; the core runs without it |
|
||||
| Null Object | `NullSpeech` | No `if speech:` checks in the use case |
|
||||
| MVVM | `FlashCardView`, `FlashCardViewModel`, `LevelView`, `LevelViewModel` | Behaviour is tested without Tkinter ([ADR-0002]) |
|
||||
| Composition root | `app.main` | The one place that names the adapters and shows the level screen |
|
||||
| MVVM | `FlashCardView`, `FlashCardViewModel`, `LevelView`, `LevelViewModel`, `MenuView`, `MenuViewModel` | Behaviour is tested without Tkinter ([ADR-0002]) |
|
||||
| Composition root | `app.main` | The one place that names the adapters, shows the level screen and chooses the word list file (beside the executable, else inside it) |
|
||||
| Controller (GRASP) | `Application` | One object receives the menu and level commands and coordinates repositories and sessions |
|
||||
| Value object | `Level`, `Card`, `LanguagePair` | Immutable data with its own rule (`Level.first`) |
|
||||
|
||||
## Dependency Check
|
||||
@@ -223,5 +262,6 @@ Imports point inward: `domain` imports nothing from the other packages; `applica
|
||||
[OC-001]: ./uc-001/oc.md
|
||||
[SD-001]: ./uc-001/sd.md
|
||||
[ADR-0002]: ./adr/adr-0002-clean-architecture-and-mvvm.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[ADR-0004]: ./adr/adr-0004-pyinstaller-executable.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
+4
-3
@@ -11,8 +11,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the term Level | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the term Level | [0b983b7] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the term Reset | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
@@ -31,6 +31,7 @@ Maps each Product Owner (PO) term to its professional IT term. PO language: Engl
|
||||
| Level | en | `Level` | The number of the most frequent words of the word list that a study session uses: 100, 1000 or all. | DM, UC, US | DCD |
|
||||
| Language pair | en | `LanguagePair` | The two languages of a word list, the language learned and the language of the translation. | DM, UC | DCD |
|
||||
| Progress file | en | `ProgressRepository` | The file `words_to_learn.csv` that keeps the words to learn between runs. | UC, US | DCD |
|
||||
| Reset | en | `reset` | Removing the kept progress of a word list so that all its words are to learn again. | UC, US | DCD, OC |
|
||||
| Spoken word | en | `SpeechPort` | The Malay word read aloud when its card is shown. | UC, US | DCD |
|
||||
|
||||
## Rules
|
||||
@@ -44,5 +45,5 @@ Maps each Product Owner (PO) term to its professional IT term. PO language: Engl
|
||||
[BC-001]: ./business-case.md
|
||||
[SA-001]: ./stakeholder-analysis.md
|
||||
[DM-001]: ./domain-model.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,86 @@
|
||||
# MIL-009: Executable with PyInstaller
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | MIL-009 |
|
||||
| CrossReference | [BC-001], [US-001], [UC-001], [DCD-001] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added task 9 (fix a flaky unit test found after the merge) | [061b4f4] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
Decide whether the Learner can start the program from one executable file without a Python installation: the program is packaged with PyInstaller by a script of this repository, and behaves in the executable as it does from the source.
|
||||
|
||||
## Deliverable
|
||||
|
||||
`python tools/build_executable.py` builds `dist/flash-card.exe` (one file, no console window, an icon, the images and the word list inside, the speech extra included). The executable shows the level screen, keeps the progress in `data/words_to_learn.csv` next to it and prefers a `data/ms-da.csv` next to it over the word list inside. The executable itself is not committed to git; README and wiki (English, Danish, Bahasa Malaysia) explain how to build and use it.
|
||||
|
||||
## Go / No-Go Criteria
|
||||
|
||||
| # | Criterion (objectively checkable) | Go | No-Go |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | `python tools/build_executable.py` ends with exit code 0 and produces `dist/flash-card.exe` | File exists and is larger than 1 MB | No file or a build error |
|
||||
| 2 | The executable starts on this machine with the virtual environment not activated and shows the level screen without a console window | A window titled "Flashy" exists after 5 seconds and the process is a Windows GUI program | The process ends or shows a console |
|
||||
| 3 | With a `data/ms-da.csv` copied next to the executable it uses that file; without it the word list inside the executable is used | Smoke test with a marked list of two words, then without | The wrong list is used |
|
||||
| 4 | Marking a word known in the executable writes `data/words_to_learn.csv` next to it and the next start continues from it | Smoke test reads the file after the run | No file or progress lost |
|
||||
| 5 | The four images and the icon are inside the executable and are found when frozen | Card and button images are visible in a captured screenshot of the executable | A missing image or an exception |
|
||||
| 6 | Path resolution when frozen (`sys.frozen`, `sys._MEIPASS`) is tested without PyInstaller | Unit tests pass | Not covered |
|
||||
| 7 | `dependencies` in `pyproject.toml` is still empty; PyInstaller is only in the extra `build` | File check | A runtime dependency was added |
|
||||
| 8 | BC-001, DCD-001 and ADR-0004 are updated and reviewed `Go`; README and wiki in three languages describe the build | Review records `Go`; `check-readme.sh` exit 0 | A document is missing |
|
||||
| 9 | Code review against QC-PY-001 has no failed Mandatory criterion; `pytest`, `ruff`, `mypy --strict`, `lint-imports` and `doxygen` are clean | `RC-*` verdict Go and exit codes 0 | Otherwise |
|
||||
|
||||
## Dependencies
|
||||
|
||||
| Depends on | Reason |
|
||||
| --- | --- |
|
||||
| MIL-008 | The finished program, with the level screen, that is packaged |
|
||||
|
||||
## Traceability
|
||||
|
||||
| Business Case objective / KPI / user story | Reference |
|
||||
| --- | --- |
|
||||
| Objective 4 (a repository others can use), extended by the new request of S01; success criterion 4 (time to run) | [BC-001] |
|
||||
| US-001.07 Start without Python | [US-001] |
|
||||
|
||||
## Ownership
|
||||
|
||||
| Role | Stakeholder ID (SA) |
|
||||
| --- | --- |
|
||||
| Owner | S01 |
|
||||
| Approving reviewer | S01 (AI as stand-in in autonomous mode) |
|
||||
|
||||
## Target Date
|
||||
|
||||
2026-10-16 — within the delivery window that ends 2026-10-21 ([BC-001] constraint).
|
||||
|
||||
## Tasks
|
||||
|
||||
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 | Update the documents for the executable | Amend BC-001 (In Scope: an executable built with PyInstaller; Out of Scope: an installer and a signed release stay out), add ADR-0004 (PyInstaller one-file windowed build, word list inside and a `data` folder beside the executable for progress, Windows only), and add the runtime path resolution to DCD-001. Every changed document gets a Version History row and a review. | No | BC-001, DCD-001 |
|
||||
| 2 | Resolve resource and data paths when frozen | The images are found under `sys._MEIPASS` and the default data folder is `data/` next to the executable when `sys.frozen` is set; the source run keeps its paths. The rule is one function used by `constants.py`, tested by simulating the frozen state. | Yes | US-001.07 |
|
||||
| 3 | Prefer the word list next to the executable | When the data folder has no `ms-da.csv` the program uses the copy inside the executable; the progress file is always written to the data folder; `--data-dir` still overrides both. | Yes | US-001.07 |
|
||||
| 4 | Add the build script and the build extra | `tools/build_executable.py` calls PyInstaller (one file, windowed, name `flash-card`, the assets and the word list as data, the icon, the speech packages as hidden imports); `pyproject.toml` gets the extra `build`; `build/`, `dist/` and `*.spec` are ignored. | No | ADR-0004 |
|
||||
| 5 | Generate the application icon | `tools/generate_images.py` also writes `flash_card.ico` (the card with the tick) from the same drawing code, so no external asset is used. | No | |
|
||||
| 6 | Build and smoke-test the executable | Build it, start it with the virtual environment not active, check the window, the images, the level choice, the progress file next to it, the word list override and the speech import; record the result in the review record. | Yes | US-001.07 |
|
||||
| 7 | Test the path rules and the build arguments | Unit tests for the frozen and source path rules and for the argument list the build script gives PyInstaller (without running PyInstaller). | No | |
|
||||
| 8 | Update README and wiki | README and the Install page of the wiki in English, Danish and Bahasa Malaysia: how to build, where the executable and the data folder are, that Python is not needed to run it. The wiki is republished after the merge. | No | |
|
||||
| 9 | Fix a flaky unit test | After the merge a unit test of `app.main` failed in about 1 of 6 full runs because it created a real Tk root; it uses the module's fake root instead, so the unit tests never need a display. Found by running the suite repeatedly. | No | RC-049 |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../business-case.md
|
||||
[US-001]: ../user-stories.md
|
||||
[UC-001]: ../uc-001/uc.md
|
||||
[DCD-001]: ../dcd.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
[061b4f4]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/061b4f48b5d49e6800656c95d79df707e07ec0f3
|
||||
@@ -0,0 +1,79 @@
|
||||
# MIL-010: Release v0.1.0
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | MIL-010 |
|
||||
| CrossReference | [BC-001], [US-001], [UC-001], [ADR-0004] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [9c8e294] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
Decide whether the project can be handed out as a release: the version 0.1.0 is tagged, and the executable built from exactly that commit is attached to a release page with its checksum and release notes.
|
||||
|
||||
## Deliverable
|
||||
|
||||
A tag `v0.1.0` on the head of `main`, and a release on the git host with the assets `flash-card.exe` and `flash-card.exe.sha256`, and release notes. `CHANGELOG.md` holds the same notes. The README and the wiki (English, Danish, Bahasa Malaysia) link to the release page.
|
||||
|
||||
## Go / No-Go Criteria
|
||||
|
||||
| # | Criterion (objectively checkable) | Go | No-Go |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The executable is rebuilt from the head of `main` that gets the tag, in a clean build folder, and passes the smoke test of MIL-009 (window, embedded list, progress file beside it, list override) | Smoke test output recorded in the review record | A failing case |
|
||||
| 2 | The tag `v0.1.0` is an annotated tag on that commit and `pyproject.toml` and `flash_card.__version__` say `0.1.0` | `git show v0.1.0` and the two files agree | A different version or commit |
|
||||
| 3 | The release has the assets `flash-card.exe` and `flash-card.exe.sha256` | Listed by the host API | An asset is missing |
|
||||
| 4 | The SHA-256 of the file downloaded from the release equals the value in `flash-card.exe.sha256` and in the release notes | Hash compared after a download | A difference |
|
||||
| 5 | The release notes say that the file is an unsigned Windows build, what the `data` folder next to it holds, the SHA-256, and how to build it | Notes read back from the API | A statement is missing |
|
||||
| 6 | `CHANGELOG.md`, README and the Install page of the wiki in three languages link the release; `check-readme.sh` exit 0 | Exit code 0 | A link is missing |
|
||||
| 7 | BC-001, US-001 and PP-001 are updated (the release upload leaves Out of Scope) and reviewed `Go` | Review records `Go` | A document is not updated |
|
||||
|
||||
## Dependencies
|
||||
|
||||
| Depends on | Reason |
|
||||
| --- | --- |
|
||||
| MIL-009 | The executable and its build script |
|
||||
|
||||
## Traceability
|
||||
|
||||
| Business Case objective / KPI / user story | Reference |
|
||||
| --- | --- |
|
||||
| Objective 4 (a repository others can use), extended by the new request of S01 | [BC-001] |
|
||||
| US-001.08 Download the executable | [US-001] |
|
||||
|
||||
## Ownership
|
||||
|
||||
| Role | Stakeholder ID (SA) |
|
||||
| --- | --- |
|
||||
| Owner | S01 |
|
||||
| Approving reviewer | S01 (AI as stand-in in autonomous mode) |
|
||||
|
||||
## Target Date
|
||||
|
||||
2026-10-16 — within the delivery window that ends 2026-10-21 ([BC-001] constraint).
|
||||
|
||||
## Tasks
|
||||
|
||||
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 | Update the documents for the release | Amend BC-001 (the upload of the executable to a release leaves Out of Scope and the release becomes In Scope; signing and an installer stay out), add US-001.08 and the gateway to PP-001; each changed document gets a Version History row and a review. | No | BC-001, US-001 |
|
||||
| 2 | Write the release notes and CHANGELOG.md | `CHANGELOG.md` (Keep a Changelog layout) with the version 0.1.0: what the program does, the four assignment steps, the level choice, the executable, known limits (unsigned, Windows only, Python 3.13 or later to build); the notes are reused for the release body. | No | |
|
||||
| 3 | Rebuild and smoke-test the executable from the tagged commit | Build `dist/flash-card.exe` from a clean tree of the head of `main`, run the smoke test of MIL-009, compute the SHA-256 and write `flash-card.exe.sha256` (not committed). | Yes | US-001.08 |
|
||||
| 4 | Tag v0.1.0 | Create an annotated tag `v0.1.0` on the head of `main` and push it; a tag cannot be undone without deleting it on the host, so it is made only after the documents are merged. | No | |
|
||||
| 5 | Create the release and attach the files | Create the release `v0.1.0` through the host API with the notes, attach `flash-card.exe` and `flash-card.exe.sha256`, download the asset again and compare the hash. The token is read from `.env` and is never printed or put on a command line. | Yes | US-001.08 |
|
||||
| 6 | Link the release | README, the Install page of the wiki in English, Danish and Bahasa Malaysia and `CHANGELOG.md` link the release page; the wiki is republished. | No | |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../business-case.md
|
||||
[US-001]: ../user-stories.md
|
||||
[UC-001]: ../uc-001/uc.md
|
||||
[ADR-0004]: ../adr/adr-0004-pyinstaller-executable.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
@@ -0,0 +1,84 @@
|
||||
# MIL-011: Menu bar
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | MIL-011 |
|
||||
| CrossReference | [BC-001], [US-001], [UC-001], [DCD-001] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
Decide whether the program has the classic menu bar the Product Owner asked for: a File menu (open a word list, change the level, reset a word list, exit) and an About menu (contact), and whether the commands keep the progress of every word list safe.
|
||||
|
||||
## Deliverable
|
||||
|
||||
The window has a menu bar. File: Open (a CSV word list), Change level, Reset word list, Exit. About: Contact with the author's name and title and a link to the author's LinkedIn page. The progress of each word list is kept in its own file. README, the Usage page of the wiki in three languages and a screenshot show the menu.
|
||||
|
||||
## Go / No-Go Criteria
|
||||
|
||||
| # | Criterion (objectively checkable) | Go | No-Go |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The menu bar has File (Open, Change level, Reset word list, separator, Exit) and About (Contact, LinkedIn entry) with the labels of the wireframe | e2e test reads the menu entries and their order | A different structure |
|
||||
| 2 | Opening a valid CSV word list switches the cards to it after the level choice; opening an invalid file shows a message and keeps the earlier list; cancelling changes nothing | Unit and e2e tests with a faked file dialog and message box | A wrong list in use or a crash |
|
||||
| 3 | The progress of each word list is a file of its own: `words_to_learn.csv` for the delivered `ms-da.csv` and `words_to_learn_<name>.csv` for another list; known words of one list never appear in another | Integration test with two lists | Progress mixed or lost |
|
||||
| 4 | Change level shows the level choice again without a restart and keeps the known words | Unit and e2e tests | Restart needed or progress lost |
|
||||
| 5 | Reset word list asks to confirm; on yes only the progress file of the open list is deleted and the level choice is shown; on no nothing changes; the word list file is never changed | Unit, integration and e2e tests | Another file touched |
|
||||
| 6 | About, Contact opens `https://www.linkedin.com/in/tirsvad74` through `webbrowser` and shows "Jens Tirsvad Nielsen, Software engineer" | Unit test with a faked `webbrowser.open` | Another address |
|
||||
| 7 | Exit closes the window, cancels the pending timer and ends the program with exit code 0 | e2e test | A leftover timer or an error |
|
||||
| 8 | The menu logic is in a view model without Tkinter; the commands are one use case or application call each | View model unit tests without a display | A rule in the view |
|
||||
| 9 | The documents of the plan (BC-001, US-001, UC-001, SSD-001, OC-001, SD-001, DCD-001, DICT-001, wireframe, PP-001) and README and wiki in three languages describe the menu, each reviewed `Go` | Review records `Go`; `check-readme.sh` exit 0 | A document is missing |
|
||||
| 10 | Code review against QC-PY-001 has no failed Mandatory criterion; `pytest`, `ruff`, `mypy --strict`, `lint-imports` and `doxygen` are clean | `RC-*` verdict Go and exit codes 0 | Otherwise |
|
||||
|
||||
## Dependencies
|
||||
|
||||
| Depends on | Reason |
|
||||
| --- | --- |
|
||||
| MIL-009 | The program with the level screen, the executable and the data folder rules; MIL-010 (release) is independent and may be done before or after |
|
||||
|
||||
## Traceability
|
||||
|
||||
| Business Case objective / KPI / user story | Reference |
|
||||
| --- | --- |
|
||||
| Objective 1 and 2 (learning with word lists), extended by the new request of S01 | [BC-001] |
|
||||
| US-001.09 to US-001.12 | [US-001] |
|
||||
|
||||
## Ownership
|
||||
|
||||
| Role | Stakeholder ID (SA) |
|
||||
| --- | --- |
|
||||
| Owner | S01 |
|
||||
| Approving reviewer | S01 (AI as stand-in in autonomous mode) |
|
||||
|
||||
## Target Date
|
||||
|
||||
2026-10-17 — within the delivery window that ends 2026-10-21 ([BC-001] constraint).
|
||||
|
||||
## Tasks
|
||||
|
||||
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 | Update the documents for the menu bar | Amend BC-001 (In Scope: a menu bar with the commands), UC-001 (the menu commands as extensions at any card), SSD-001, OC-001 and SD-001 (`openWordList`, `changeLevel`, `resetWordList`, `exit`), DCD-001 (`ProgressRepository.reset`, the menu classes, `Application` commands), DICT-001 and the wireframe (menu bar and dialogs); each changed document gets a Version History row and a review. | No | UC-001, DCD-001 |
|
||||
| 2 | Keep the progress of every word list apart | `progress_file_name(list_path)` in one place (`words_to_learn.csv` for `ms-da.csv`, `words_to_learn_<name>.csv` for another list) and `ProgressRepository.reset()` with its CSV adapter (deletes the file, no error when it is absent). | Yes | US-001.09, US-001.11 |
|
||||
| 3 | Open another word list | The application loads a CSV chosen in the file dialog (starting in the data folder), validates it before it replaces the list in use, and shows the level choice for it; an invalid file gives a message and no change. | Yes | US-001.09 |
|
||||
| 4 | Change level while learning | The application shows the level choice again on the same window and starts the session at the chosen level with the progress kept. | Yes | US-001.10 |
|
||||
| 5 | Reset a word list | After a confirmation the application resets the progress of the open list and shows the level choice; the word list file is never changed. | Yes | US-001.11 |
|
||||
| 6 | Add the menu bar and the About menu | `MenuViewModel` (entries, labels, order, no Tkinter) and `MenuView` (the Tk menu bar on the window, mnemonics, Exit that cancels the timer, About, Contact entry that opens the LinkedIn page); the contact data and labels are constants. | Yes | US-001.12 |
|
||||
| 7 | Test the menu and the commands | Unit tests (progress file names, reset, view model, application commands with faked dialogs and `webbrowser`), integration tests with two word lists, e2e test of the real menu bar. | No | |
|
||||
| 8 | Update README, wiki and screenshots | README and the Usage page of the wiki in English, Danish and Bahasa Malaysia, and a screenshot that includes the menu bar; the wiki is republished after the merge. | No | |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../business-case.md
|
||||
[US-001]: ../user-stories.md
|
||||
[UC-001]: ../uc-001/uc.md
|
||||
[DCD-001]: ../dcd.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,84 @@
|
||||
# MIL-012: Release v0.2.0
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | MIL-012 |
|
||||
| CrossReference | [BC-001], [US-001], [UC-001], [ADR-0004] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose
|
||||
|
||||
Decide whether the project can be handed out as version 0.2.0: the version is raised, the tag `v0.2.0` is made on the commit that is built, and the release page has notes and, when the git host accepts the upload, the executable with its checksum. Version 0.2.0 is the minor release that adds the menu bar and the progress per word list to 0.1.0.
|
||||
|
||||
## Deliverable
|
||||
|
||||
`pyproject.toml`, `flash_card.__version__` and the `Doxyfile` say `0.2.0`; `CHANGELOG.md` has the entry for 0.2.0; the annotated tag `v0.2.0` is on the head of `main`; the release `v0.2.0` exists with notes; `flash-card.exe` and `flash-card.exe.sha256` are attached if the upload limit of the git host allows it, otherwise the notes say how to build the executable and the open issue stays open.
|
||||
|
||||
## Go / No-Go Criteria
|
||||
|
||||
| # | Criterion (objectively checkable) | Go | No-Go |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The three version places say `0.2.0` and a test fails when `flash_card.__version__` and `pyproject.toml` differ | Test passes; grep shows the same version | A different version |
|
||||
| 2 | `CHANGELOG.md` has a `[0.2.0]` entry listing the menu bar, the progress per word list and the message for a file that is not UTF-8, and `[0.1.0]` is unchanged | File read in the review record | A missing or changed entry |
|
||||
| 3 | The upload limit of the git host is probed before the build with a draft release that is deleted afterwards, and the result is recorded | Result in the review record | No probe |
|
||||
| 4 | The executable is built with `--clean` from the commit to be tagged and passes the smoke test of MIL-009 (window, embedded list, progress beside it, list override) | Smoke test output in the review record | A failing case |
|
||||
| 5 | The tag `v0.2.0` is an annotated tag on that commit; `v0.1.0` is not moved | `git show v0.2.0` and `git rev-parse v0.1.0` | A moved or lightweight tag |
|
||||
| 6 | The release `v0.2.0` is published with notes that state what is new, that the file is unsigned, the `data` folder rule and how to build | Notes read back from the API | A statement is missing |
|
||||
| 7 | When the probe allowed it: the release has `flash-card.exe` and `flash-card.exe.sha256`, and the SHA-256 of the downloaded file equals the checksum; when the probe did not allow it: the notes say so and the issue "attach the files" stays open | Hash compared, or the statement is present | A wrong or unverifiable hash |
|
||||
| 8 | README, CHANGELOG and the Install page of the wiki in three languages link `v0.2.0` and say whether the executable is attached; `check-readme.sh` exit 0 | Exit code 0 | A link is missing |
|
||||
| 9 | `pytest`, `ruff`, `mypy --strict`, `lint-imports` and `doxygen` are clean after the version change; BC-001, US-001 and PP-001 are reviewed `Go` | `RC-*` verdict Go and exit codes 0 | Otherwise |
|
||||
|
||||
## Dependencies
|
||||
|
||||
| Depends on | Reason |
|
||||
| --- | --- |
|
||||
| MIL-011 | The menu bar that makes this release |
|
||||
| MIL-010 | The release procedure and its open issue about the upload limit |
|
||||
|
||||
## Traceability
|
||||
|
||||
| Business Case objective / KPI / user story | Reference |
|
||||
| --- | --- |
|
||||
| Objective 4 (a repository others can use) | [BC-001] |
|
||||
| US-001.08 Download the executable | [US-001] |
|
||||
|
||||
## Ownership
|
||||
|
||||
| Role | Stakeholder ID (SA) |
|
||||
| --- | --- |
|
||||
| Owner | S01 |
|
||||
| Approving reviewer | S01 (AI as stand-in in autonomous mode) |
|
||||
|
||||
## Target Date
|
||||
|
||||
2026-10-18 — within the delivery window that ends 2026-10-21 ([BC-001] constraint).
|
||||
|
||||
## Tasks
|
||||
|
||||
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 | Update the documents for the release | BC-001 (releases in plural), US-001.08 (the latest release instead of v0.1.0) and PP-001; each changed document gets a Version History row and a review. | No | BC-001, US-001 |
|
||||
| 2 | Raise the version to 0.2.0 | `pyproject.toml`, `flash_card.__version__` in `src/flash_card/__init__.py` and `PROJECT_NUMBER` of the `Doxyfile`; one unit test compares the version of the package with `pyproject.toml`, so the places cannot drift. | No | |
|
||||
| 3 | Write the CHANGELOG entry and the release notes | `[0.2.0]` with Added (menu bar: open another word list, change level, reset word list, exit, contact; progress kept apart for each word list), Fixed (a file that is not UTF-8 gives a message) and the known limits; the same text is the release body. | No | |
|
||||
| 4 | Probe the upload limit of the git host | Create a draft release, try uploads of 1, 5, 10 and 30 MB random files one after another and stop at the first refusal, delete the draft and its tag; record the largest accepted size. The token is read inside the script. | No | |
|
||||
| 5 | Build and smoke-test the executable from the tagged commit | `python tools/build_executable.py --clean` from a clean tree of the head of `main` after the version change, the smoke test, and the SHA-256. | Yes | US-001.08 |
|
||||
| 6 | Tag v0.2.0 | Annotated tag `v0.2.0` on the head of `main` and push it; `v0.1.0` stays where it is. | No | |
|
||||
| 7 | Create the release and attach the files | Create the release `v0.2.0` with the notes through the API; attach `flash-card.exe` and `flash-card.exe.sha256` when the probe allows it and compare the hash after a download; otherwise say so in the notes and leave the issue open. | Yes | US-001.08 |
|
||||
| 8 | Link the release | README, CHANGELOG and the Install page of the wiki in English, Danish and Bahasa Malaysia link `v0.2.0`; the wiki is republished. | No | |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../business-case.md
|
||||
[US-001]: ../user-stories.md
|
||||
[UC-001]: ../uc-001/uc.md
|
||||
[ADR-0004]: ../adr/adr-0004-pyinstaller-executable.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
+26
-6
@@ -4,15 +4,15 @@
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | PP-001 |
|
||||
| CrossReference | [BC-001], [SA-001], [US-001], [MIL-001], [MIL-002], [MIL-003], [MIL-004], [MIL-005], [MIL-006], [MIL-007], [MIL-008] |
|
||||
| CrossReference | [BC-001], [SA-001], [US-001], [MIL-001], [MIL-002], [MIL-003], [MIL-004], [MIL-005], [MIL-006], [MIL-007], [MIL-008], [MIL-009], [MIL-010], [MIL-011], [MIL-012] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added gateway MIL-008 Choose level (new request of S01) | [0b983b7] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added gateway MIL-011 Menu bar (new request of S01) | [2211d0f] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added gateway MIL-012 Release v0.2.0 (new request of S01) | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
@@ -40,6 +40,10 @@ This plan schedules the seven phases (gateways) that deliver the flash card prog
|
||||
| Spoken Malay word | [MIL-006] | 2026-10-19 | 2026-10-19 | S01 | US-001.05 | Text to speech as optional extra | [Milestone MIL-006][MS-006] |
|
||||
| Documentation and publication | [MIL-007] | 2026-10-19 to 2026-10-21 | 2026-10-21 | S01 | none | README, screenshots, wiki in 3 languages, description and topics | [Milestone MIL-007][MS-007] |
|
||||
| Choose level | [MIL-008] | 2026-10-20 | 2026-10-20 | S01 | US-001.06 | A level choice (100, 1000, all words) before the cards; documents, wiki and screenshots updated | |
|
||||
| Executable with PyInstaller | [MIL-009] | 2026-10-16 | 2026-10-16 | S01 | US-001.07 | One Windows executable that runs without Python, built by a script; documents, wiki and README updated | |
|
||||
| Release v0.1.0 | [MIL-010] | 2026-10-16 | 2026-10-16 | S01 | US-001.08 | Tag v0.1.0 and a release with `flash-card.exe`, its checksum and release notes | |
|
||||
| Menu bar | [MIL-011] | 2026-10-17 | 2026-10-17 | S01 | US-001.09 to US-001.12 | File menu (open word list, change level, reset word list, exit) and About menu (contact); documents, wiki and screenshots updated | |
|
||||
| Release v0.2.0 | [MIL-012] | 2026-10-18 | 2026-10-18 | S01 | US-001.08 | Version 0.2.0, tag `v0.2.0` and a release with the menu bar, notes and, if the host accepts it, the executable | |
|
||||
|
||||
```plantuml
|
||||
@startgantt
|
||||
@@ -60,6 +64,14 @@ Project starts 2026-10-14
|
||||
[Documentation Go/No-Go] happens 2026-10-21
|
||||
[Choose level] starts 2026-10-20 and ends 2026-10-20
|
||||
[Choose level Go/No-Go] happens 2026-10-20
|
||||
[Executable] starts 2026-10-16 and ends 2026-10-16
|
||||
[Executable Go/No-Go] happens 2026-10-16
|
||||
[Release] starts 2026-10-16 and ends 2026-10-16
|
||||
[Release Go/No-Go] happens 2026-10-16
|
||||
[Menu bar] starts 2026-10-17 and ends 2026-10-17
|
||||
[Menu bar Go/No-Go] happens 2026-10-17
|
||||
[Release 0.2.0] starts 2026-10-18 and ends 2026-10-18
|
||||
[Release 0.2.0 Go/No-Go] happens 2026-10-18
|
||||
@endgantt
|
||||
```
|
||||
|
||||
@@ -75,12 +87,16 @@ Project starts 2026-10-14
|
||||
| README, screenshots, wiki in three languages | MIL-007 |
|
||||
| Repository description and topics | MIL-007 |
|
||||
| Choice of level (new request after MIL-007) | MIL-008 |
|
||||
| Executable built with PyInstaller (new request after MIL-008) | MIL-009 |
|
||||
| Release with the executable attached (new request after MIL-009) | MIL-010 |
|
||||
| Menu bar with File and About menus (new request after MIL-009) | MIL-011 |
|
||||
| Release v0.2.0 with the menu bar (new request after MIL-011) | MIL-012 |
|
||||
| Framework documents of the baseline | Baseline pull request before MIL-001 |
|
||||
|
||||
## Dependencies
|
||||
|
||||
```
|
||||
Baseline → MIL-001 → MIL-002 → MIL-003 → MIL-004 → MIL-005 → MIL-006 → MIL-007 → MIL-008
|
||||
Baseline → MIL-001 → MIL-002 → MIL-003 → MIL-004 → MIL-005 → MIL-006 → MIL-007 → MIL-008 → MIL-009 → MIL-010 → MIL-011 → MIL-012
|
||||
```
|
||||
|
||||
A No-Go on a phase moves every later date by the days the rework takes; MIL-008 was added after MIL-007 and takes the unplanned day 2026-10-20, so no buffer is left inside the window; a No-Go moves the end date past 2026-10-21 and S01 decides whether to accept that.
|
||||
@@ -111,7 +127,10 @@ A No-Go on a phase moves every later date by the days the rework takes; MIL-008
|
||||
[MIL-006]: ./milestones/mil-006-malay-speech.md
|
||||
[MIL-007]: ./milestones/mil-007-documentation-and-publication.md
|
||||
[MIL-008]: ./milestones/mil-008-choose-level.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[MIL-009]: ./milestones/mil-009-executable.md
|
||||
[MIL-010]: ./milestones/mil-010-release.md
|
||||
[MIL-011]: ./milestones/mil-011-menu-bar.md
|
||||
[MIL-012]: ./milestones/mil-012-release-0-2-0.md
|
||||
[MS-001]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/165
|
||||
[MS-002]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/166
|
||||
[MS-003]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/167
|
||||
@@ -119,4 +138,5 @@ A No-Go on a phase moves every later date by the days the rework takes; MIL-008
|
||||
[MS-005]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/169
|
||||
[MS-006]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/170
|
||||
[MS-007]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/milestone/171
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
# RC-041: Review of PY-MIL-008
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-041 |
|
||||
| CrossReference | [PY-MIL-008], [QC-PY-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [f45d603] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PY-MIL-008]
|
||||
- Checklist used: [QC-PY-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | PEP 8 casing holds in all new modules (`level.py`, `level_view.py`, `window.py`); ruff rule set N passes. |
|
||||
| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose and are the dictionary's IT terms (`Level`, `Deck.within`, `LevelViewModel`, `LevelChoice`, `Application.start`). |
|
||||
| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff check` and `ruff format --check` pass on 67 files with no suppressions. |
|
||||
| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | Every signature is annotated; `mypy --strict` passes on 44 source files and on `tools/capture_screenshots.py`. |
|
||||
| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | `Level` raises `ValueError` for a limit below 1; a failed session start after a click is logged, closes the window with exit code 1 and never swallows silently; no bare `except`. |
|
||||
| 6 | No mutable default arguments and no shadowed builtins | Pass | No mutable defaults, no builtin shadowed. |
|
||||
| 7 | Files, locks and connections are managed with context managers | Pass | No new file handling beyond the existing context managers. |
|
||||
| 8 | Public modules, classes and functions have docstrings that say what, not how | Pass | New and changed members have Doxygen docstrings; `doxygen Doxyfile` ends with 0 warnings. |
|
||||
| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | Pass | No `print`; failures are logged with `logging`; no personal data is logged. |
|
||||
| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Pass | `Level`, `Deck.within`, `Deck.draw(among)`, `StudySession(level_cards)`, `open_study_session(..., level)`, `LevelChoice`, `LevelViewModel`, `LevelView` and `Application` match the revised DCD-001, OC-001 `chooseLevel` and SD-001. Deviations: `Application` (root, repositories, speech) with `start`, `show_level_screen` and `exit_code` is the composition root detail that DCD-001 shows as `app.main`; `StudySession.remaining_in_level` and `LevelView.frame` are additions. |
|
||||
| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | 191 tests (3 consecutive full runs green) cover `Level`, `Deck.within`, the level filter, the cross-level progress rules on the real word list, the view model, `--level` and the real level window flow; none uses the network. |
|
||||
| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | `mypy --strict` reports no issue; no `Any`. |
|
||||
| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Pass | `dependencies` stays empty; no new package. |
|
||||
| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Pass | The level rule exists only in `Level.first` and `Deck.within`; the choices, labels and sizes exist once in `constants.py`; both views use `configure_window`. |
|
||||
| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Pass | `lint-imports` reports `Layers point inward` kept; a grep finds no `tkinter`, `csv` or `random` import in `domain` or `application`; the level view model imports no Tkinter. |
|
||||
| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Pass | The view model owns the choices and the view draws them; the composition root only wires; the session depends on protocols and receives its collaborators. |
|
||||
| 17 | Source is laid out in the layers and folders of the clean architecture folder structure (`domain`, `application`, `infrastructure`, `presentation` packages under `src/`, and `unit`, `integration` and `e2e` under `tests/`), in `snake_case`, and imports between the layers point inward | Pass | `presentation/features/level/` and `presentation/shared/` follow the clean-architecture folder structure; tests stay in `unit`, `integration`, `e2e` (with a session-scoped `tk_root` in `tests/e2e/conftest.py`). |
|
||||
| 18 | File and folder names are English, contain no space and no character outside letters, digits, `-`, `_` and `.`, and follow the casing of the language for files | Pass | File and folder names follow the rule. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Milestone MIL-008 Go criteria: 1 level 100 draws exactly the first 100 rows over a full run of the real list (integration test); 2 levels 1000 and All use all 1000 words, and a shorter list is used whole (unit and integration tests); 3 words known at level 100 stay known at All and the progress file keeps every unknown word, also outside the level (integration test); 4 a level with nothing left gives the finished message and no failure (unit and e2e tests); 5 the level view model has no Tkinter import and its tests pass without a display; 6 `--level 100|1000|all` skips the screen and an unknown value exits with 2 (unit tests); 7 UC-001, DM-001, DICT-001, SSD-001, OC-001, SD-001, DCD-001, BC-001, US-001, PP-001 and MIL-008 were re-reviewed `Go` (RC-030 to RC-040), the wireframe has Screen 1, and the README and the wiki in en, da and ms describe the level; 8 this record, `pytest` 191 passed, ruff, mypy, lint-imports and doxygen clean. A real screenshot of the level screen was captured and inspected after fixing a too-small window. The Danish and Malay wiki additions were written by the AI and are not read by a native speaker. All Go.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[PY-MIL-008]: ../../../src/flash_card
|
||||
[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md
|
||||
[f45d603]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/f45d6036e4210e1fbe52f6a582c540a6e1877056
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-042: Review of BC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-042 |
|
||||
| CrossReference | [BC-001], [QC-BC-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [BC-001]
|
||||
- Checklist used: [QC-BC-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | ROI/Cost-Benefit analysis is quantitative, or where qualitative, is explicitly justified | Pass | The Cost-Benefit table is qualitative and says why: no revenue is expected, so a quantitative return does not apply. |
|
||||
| 2 | Risks are identified with documented impact and mitigation | Pass | The Risks table has 5 risks, each with an impact and a mitigation. |
|
||||
| 3 | Success criteria are measurable, stating explicit targets rather than vague aspirations | Pass | The Success Criteria table has 8 rows with numeric targets and a measure each (for example 0 third-party packages; 5 commands or fewer). |
|
||||
| 4 | Scope explicitly separates In Scope vs Out of Scope | Pass | Scope has `### In Scope` and `### Out of Scope`; the executable is added to In Scope and the installer, signing and release upload are named in Out of Scope. |
|
||||
| 5 | Stakeholders are cross-referenced to Stakeholder Analysis IDs rather than re-described inline | Pass | The Stakeholders table cites S01, S02 and S03 and does not re-describe their roles. |
|
||||
| 6 | Methodology and quality-standard foundation are stated explicitly (e.g. ISO/IEC 25010, Larman) | Pass | Methodological and Standards Foundation names the framework, Larman, ISO/IEC 25010:2023 and PEP 8. |
|
||||
| 7 | Assumptions and constraints are explicit and clearly distinguished from one another | Pass | Assumptions and Constraints are separate sections. |
|
||||
| 8 | Document supports executive decision-making with a clear, unambiguous recommendation | Pass | Recommendation reads `Proceed` with a one-sentence rationale. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of BC-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-009 (executable).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../../../docs/business-case.md
|
||||
[QC-BC-001]: ../../../framework/qc/artifacts/qc-business-case.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-043: Review of US-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-043 |
|
||||
| CrossReference | [US-001], [QC-US-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [US-001]
|
||||
- Checklist used: [QC-US-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Follows INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable) | Pass | INVEST Check section confirms the six properties for all seven stories and states one dependency exception. |
|
||||
| 2 | Written in "As a / I want / So that" form | Pass | All seven stories use `As a / I want / so that`. |
|
||||
| 3 | Clear, testable acceptance criteria are included | Pass | Every story, including US-001.07, has Given/When/Then acceptance criteria. |
|
||||
| 4 | Traceable to a use case or epic | Pass | Every story traces to a milestone and to UC-001. |
|
||||
| 5 | Story is sized to fit within a single iteration | Pass | Each story is one milestone, which fits one iteration. |
|
||||
| 6 | Story statement avoids technical implementation detail | Fail | Acceptance criteria name `words_to_learn.csv`, `ms-da.csv` and 3000 ms, which are assignment-mandated names and values rather than pure behaviour. |
|
||||
| 7 | Role named in the story matches an actor defined in the Use Case Diagram | Pass | The role `Learner` is the actor of UCD-001. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of US-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-009 (executable).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion 6 (Optional) failed: Story statement avoids technical implementation detail; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[US-001]: ../../../docs/user-stories.md
|
||||
[QC-US-001]: ../../../framework/qc/artifacts/qc-user-story.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,54 @@
|
||||
# RC-044: Review of PP-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-044 |
|
||||
| CrossReference | [PP-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PP-001]
|
||||
- Checklist used: none exists for this type, and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of PP-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — no checklist exists for the Project Plan type; the plan now schedules MIL-009 on 2026-10-16 inside the Business Case constraint (delivery by 2026-10-21) and the language checklist passes. Accepted as the Product Owner's stand-in, after the Product Owner accepted the MIL-009 plan in chat. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[PP-001]: ../../../docs/project-plan.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,55 @@
|
||||
# RC-045: Review of DCD-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-045 |
|
||||
| CrossReference | [DCD-001], [QC-DCD-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [DCD-001]
|
||||
- Checklist used: [QC-DCD-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | SOLID principles applied; no god classes with excessive responsibilities | Pass | Each class has one responsibility (Class Table); view, view model, session, deck and adapters are separate. |
|
||||
| 2 | Visibility markers correct and consistent (`+` public, `-` private, `#` protected) | Pass | Visibility markers are on all members. |
|
||||
| 3 | Relationships correctly distinguished: Association vs Aggregation vs Composition vs Dependency | Pass | Composition (Vocabulary and Card), aggregation (Deck), association, dependency and realization are distinguished. |
|
||||
| 4 | Multiplicities and navigability specified on all associations | Pass | Multiplicities are on the associations; dependencies are directed. |
|
||||
| 5 | Applied design patterns are annotated explicitly (e.g. Singleton, Factory, Strategy) | Pass | Pattern Annotations table lists Repository, Ports and adapters, Null Object, MVVM, Composition root. |
|
||||
| 6 | Method signatures are traceable to Operation Contracts and/or design Sequence Diagrams | Pass | Method Traceability table is unchanged; the packaging support (`runtime.py`, `tools/`) is stated in Purpose and Scope as having no system operation and not being a design class, so it needs no row. |
|
||||
| 7 | Class names and structure remain consistent with the Domain Model concepts they refine | Pass | The Class Table has a `Refines` column; names match the dictionary's IT terms; no class was added. |
|
||||
| 8 | No circular dependencies between classes/packages unless explicitly justified | Pass | Dependency Check states there are no cycles. |
|
||||
| 9 | Dependencies between classes and packages point inward: domain classes do not depend on infrastructure, delivery or framework classes | Pass | Domain imports nothing; infrastructure and presentation point inward (Dependency Check). |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-009 (executable).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[DCD-001]: ../../../docs/dcd.md
|
||||
[QC-DCD-001]: ../../../framework/qc/artifacts/qc-dcd.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,55 @@
|
||||
# RC-046: Review of ADR-0004
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-046 |
|
||||
| CrossReference | [ADR-0004], [QC-ADR-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [ADR-0004]
|
||||
- Checklist used: [QC-ADR-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The ID (`ADR-NNNN`, 4-digit) matches the filename number and is unique and sequential | Pass | ID `ADR-0004` matches the file name number. |
|
||||
| 2 | Context states the problem, the forces (cost, risk, constraints) and the options evaluated | Pass | Context states the need (US-001.07), the forces and three options. |
|
||||
| 3 | At least two options were considered, or the absence of alternatives is justified | Pass | Three options were considered. |
|
||||
| 4 | Decision is stated in one or two unhedged sentences and matches one of the evaluated options | Pass | Decision is stated plainly and is option 2. |
|
||||
| 5 | Consequences list both Positive and Negative outcomes | Pass | Consequences have Positive and Negative lists. |
|
||||
| 6 | Quality-attribute impacts (performance, security, portability, etc.) are named where the decision affects them | Pass | Portability (Windows only, cross-compile limit), start-up time and size are named. |
|
||||
| 7 | Affected Artifacts are listed as links, and each is also in CrossReference | Pass | Affected Artifacts BC-001, US-001 and DCD-001 are listed and in CrossReference. |
|
||||
| 8 | Status changes are recorded as new Version History rows with a Change summary and Commit link; retained rows are never rewritten | Pass | First version; no status change yet. |
|
||||
| 9 | A superseded or deprecated ADR names its successor, and the successor links back | N-A | Not superseded or deprecated. |
|
||||
| 10 | Written in business or technical language of the domain, with no unexplained abbreviations | Pass | Written in plain technical English; `sys.frozen`, `sys.executable` are code names. |
|
||||
| 11 | Status is one of `Proposed`, `Accepted`, `Rejected`, `Deprecated` or `Superseded by ADR-NNNN`, and every Version History row uses only these | Pass | Status `Proposed` before this review; uses an allowed value. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[ADR-0004]: ../../../docs/adr/adr-0004-pyinstaller-executable.md
|
||||
[QC-ADR-001]: ../../../framework/qc/artifacts/qc-adr.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,66 @@
|
||||
# RC-047: Review of MIL-009
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-047 |
|
||||
| CrossReference | [MIL-009], [QC-MIL-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [768ca34] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-009]
|
||||
- Checklist used: [QC-MIL-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | A concrete deliverable is defined for every gate | Pass | A concrete Deliverable section names the output evaluated at the gate. |
|
||||
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | The Go / No-Go table has numbered criteria, each with an observable Go and No-Go. |
|
||||
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Dependencies table names the milestone or documents it needs. |
|
||||
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability table maps to Business Case objectives and the user story. |
|
||||
| 5 | Milestone owner and approving reviewer are identified | Pass | Ownership table names S01 as owner and approving reviewer. |
|
||||
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target Date lies inside the 2026-10-14 to 2026-10-21 window of the Business Case. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of MIL-009 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-009]: ../../../docs/milestones/mil-009-executable.md
|
||||
[QC-MIL-001]: ../../../framework/qc/artifacts/qc-milestones-gateways.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
@@ -0,0 +1,64 @@
|
||||
# RC-048: Review of PY-MIL-009
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-048 |
|
||||
| CrossReference | [PY-MIL-009], [QC-PY-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [bc51381] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PY-MIL-009]
|
||||
- Checklist used: [QC-PY-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | PEP 8 casing holds in `runtime.py`, `build_executable.py` and the changed modules; ruff rule set N passes. |
|
||||
| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose (`resource_root`, `executable_dir`, `build_arguments`, `resolve_data_files`). |
|
||||
| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff check` and `ruff format --check` pass on 71 files with no suppressions. |
|
||||
| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | Every signature is annotated; `mypy --strict` passes on 45 source files and on the three tool scripts. |
|
||||
| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | `main` of the build tool returns 2 with a message when PyInstaller is not installed; no bare `except`; no swallowed exception. |
|
||||
| 6 | No mutable default arguments and no shadowed builtins | Pass | No mutable defaults, no builtin shadowed. |
|
||||
| 7 | Files, locks and connections are managed with context managers | Pass | No new file handling beyond the existing context managers; the ICO file is written with `Path.write_bytes`. |
|
||||
| 8 | Public modules, classes and functions have docstrings that say what, not how | Pass | New and changed members have Doxygen docstrings; `doxygen Doxyfile` ends with 0 warnings. |
|
||||
| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | Pass | No `print` in `src`; the tools write results with `sys.stdout.write`; no secret. |
|
||||
| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Pass | The program classes are unchanged (DCD-001); `runtime.py` and `tools/` are packaging support outside the design classes, as ADR-0004 and the Scope note of DCD-001 state; `resolve_data_files` is a function of the composition root. |
|
||||
| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | 216 tests (3 consecutive runs green): pure runtime helpers for the frozen and source cases, the argument list of the build, the ICO file, the bundled word list fallback, and the level screen window title; none starts PyInstaller or uses the network. The real executable was built and smoke-tested separately (note below). |
|
||||
| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | `mypy --strict` reports no issue; `sys._MEIPASS` is read with `getattr` and no `Any` is used. |
|
||||
| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Pass | `dependencies` is still empty; PyInstaller is only in the extra `build` and Pillow only in `tools`. |
|
||||
| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Pass | The frozen rule is one definition (`runtime.py`) used by `constants.py`; file names and sizes stay in `constants.py`. |
|
||||
| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Pass | `lint-imports` reports `Layers point inward` kept; `runtime.py` imports only the standard library. |
|
||||
| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Pass | The build tool has one purpose and a pure `build_arguments` that is tested; the composition root chooses the word list file. |
|
||||
| 17 | Source is laid out in the layers and folders of the clean architecture folder structure (`domain`, `application`, `infrastructure`, `presentation` packages under `src/`, and `unit`, `integration` and `e2e` under `tests/`), in `snake_case`, and imports between the layers point inward | Pass | `tools/build_executable.py` and `runtime.py` sit outside the four layers as packaging support; layers and test folders are unchanged. |
|
||||
| 18 | File and folder names are English, contain no space and no character outside letters, digits, `-`, `_` and `.`, and follow the casing of the language for files | Pass | File and folder names follow the rule. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Milestone MIL-009 Go criteria: 1 `python tools/build_executable.py` ended with exit code 0 and wrote `dist/flash-card.exe` (25.8 MB) with PyInstaller 6.22.3 on the Windows Store Python 3.13.14; 2 started from a temporary folder without the virtual environment, the executable showed a window titled `Flashy` after about 2 seconds and has no console (windowed bootloader); 3 with `data/ms-da.csv` beside it (3 words) one tick left 2 cards in the progress file, without it the embedded list was used (1000 words); 4 one tick wrote `data/words_to_learn.csv` next to the executable with 999 cards at level 100; 5 a captured screenshot of the executable shows the card and both button images; 6 unit tests of the frozen rule pass; 7 `dependencies` empty, extra `build`; 8 BC-001, DCD-001, ADR-0004, PP-001, US-001 and MIL-009 were reviewed Go (RC-042 to RC-047), README and the Install page of the wiki in three languages describe the build; 9 this record, `pytest` 216 passed, ruff, mypy, lint-imports and doxygen clean. Defects found by the smoke test and fixed in this milestone: the level screen window had the default title `tk` and no padding because `LevelView` did not call `configure_window`. Notes: the one-file build starts a second process (the bootloader), so a tool that watches a window must not match the first process id; the first start after a build took over 20 seconds on this machine (unpacking and a virus scan) and later starts about 2 seconds; the spoken word was not tested in the executable (the speech packages are collected into it, the network call was not exercised). All Go.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[PY-MIL-009]: ../../../src/flash_card
|
||||
[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md
|
||||
[bc51381]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/bc513810ece2506d5ab63c1d4c603803c2ad415e
|
||||
@@ -0,0 +1,64 @@
|
||||
# RC-049: Review of PY-FIX-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-049 |
|
||||
| CrossReference | [PY-FIX-001], [QC-PY-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [061b4f4] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PY-FIX-001]
|
||||
- Checklist used: [QC-PY-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | The fixture and names follow PEP 8 (`fake_tk_root`). |
|
||||
| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose. |
|
||||
| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff check` and `ruff format --check` pass with no suppressions. |
|
||||
| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | The fixture is annotated `-> None`; `mypy --strict` passes on 45 source files. |
|
||||
| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | No exception handling in the change. |
|
||||
| 6 | No mutable default arguments and no shadowed builtins | Pass | No mutable defaults. |
|
||||
| 7 | Files, locks and connections are managed with context managers | N-A | No file handling in the change. |
|
||||
| 8 | Public modules, classes and functions have docstrings that say what, not how | N-A | Tests are excluded from the docstring rules; the fixture has a one-line docstring. |
|
||||
| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | Pass | No `print`, no logging in the change. |
|
||||
| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Pass | No class or operation changed; the change is in a test of `app.main`. |
|
||||
| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | The change makes the test independent of a real Tk root: 20 consecutive full runs (216 tests) were green after 2 failures in 12 runs before; real Tk stays covered by `tests/e2e`. |
|
||||
| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | `mypy --strict` reports no issue. |
|
||||
| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Pass | No dependency change. |
|
||||
| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Pass | The fake root is the module's existing `_FakeRoot`, used once by an autouse fixture instead of per test. |
|
||||
| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Pass | No source import changed; `lint-imports` kept. |
|
||||
| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Pass | One fixture with one responsibility. |
|
||||
| 17 | Source is laid out in the layers and folders of the clean architecture folder structure (`domain`, `application`, `infrastructure`, `presentation` packages under `src/`, and `unit`, `integration` and `e2e` under `tests/`), in `snake_case`, and imports between the layers point inward | Pass | Test file stays in `tests/unit`. |
|
||||
| 18 | File and folder names are English, contain no space and no character outside letters, digits, `-`, `_` and `.`, and follow the casing of the language for files | Pass | File names unchanged. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Defect fixed: an unpatched `app.main` call created a real `tk.Tk()` inside a unit test, which failed in about 1 of 6 full runs (the only Tk process limit and Tcl handle problem seen in MIL-005). Found after the MIL-009 merge, outside any milestone task, so no issue is closed. Go.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[PY-FIX-001]: ../../../tests/unit/test_app.py
|
||||
[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md
|
||||
[061b4f4]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/061b4f48b5d49e6800656c95d79df707e07ec0f3
|
||||
@@ -0,0 +1,68 @@
|
||||
# RC-050: Review of MIL-009
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-050 |
|
||||
| CrossReference | [MIL-009], [QC-MIL-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [061b4f4] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-009]
|
||||
- Checklist used: [QC-MIL-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | A concrete deliverable is defined for every gate | Pass | A concrete Deliverable section names the output evaluated at the gate. |
|
||||
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | The Go / No-Go table has numbered criteria, each with an observable Go and No-Go. |
|
||||
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Dependencies table names the milestone or documents it needs. |
|
||||
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability table maps to Business Case objectives and the user story. |
|
||||
| 5 | Milestone owner and approving reviewer are identified | Pass | Ownership table names S01 as owner and approving reviewer. |
|
||||
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target Date lies inside the 2026-10-14 to 2026-10-21 window of the Business Case. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of MIL-009 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Re-review of MIL-009 after task 9 was added (a flaky unit test fix); Go/No-Go criteria, deliverable and dates are unchanged.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-009]: ../../../docs/milestones/mil-009-executable.md
|
||||
[QC-MIL-001]: ../../../framework/qc/artifacts/qc-milestones-gateways.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[061b4f4]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/061b4f48b5d49e6800656c95d79df707e07ec0f3
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-051: Review of BC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-051 |
|
||||
| CrossReference | [BC-001], [QC-BC-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [9c8e294] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [BC-001]
|
||||
- Checklist used: [QC-BC-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | ROI/Cost-Benefit analysis is quantitative, or where qualitative, is explicitly justified | Pass | The Cost-Benefit table is qualitative and says why: no revenue is expected, so a quantitative return does not apply. |
|
||||
| 2 | Risks are identified with documented impact and mitigation | Pass | The Risks table has 5 risks, each with an impact and a mitigation. |
|
||||
| 3 | Success criteria are measurable, stating explicit targets rather than vague aspirations | Pass | The Success Criteria table has 8 rows with numeric targets and a measure each (for example 0 third-party packages; 5 commands or fewer). |
|
||||
| 4 | Scope explicitly separates In Scope vs Out of Scope | Pass | Scope has `### In Scope` and `### Out of Scope`; the release of the executable is In Scope, an installer and signing stay Out of Scope. |
|
||||
| 5 | Stakeholders are cross-referenced to Stakeholder Analysis IDs rather than re-described inline | Pass | The Stakeholders table cites S01, S02 and S03 and does not re-describe their roles. |
|
||||
| 6 | Methodology and quality-standard foundation are stated explicitly (e.g. ISO/IEC 25010, Larman) | Pass | Methodological and Standards Foundation names the framework, Larman, ISO/IEC 25010:2023 and PEP 8. |
|
||||
| 7 | Assumptions and constraints are explicit and clearly distinguished from one another | Pass | Assumptions and Constraints are separate sections. |
|
||||
| 8 | Document supports executive decision-making with a clear, unambiguous recommendation | Pass | Recommendation reads `Proceed` with a one-sentence rationale. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of BC-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-010 (release).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../../../docs/business-case.md
|
||||
[QC-BC-001]: ../../../framework/qc/artifacts/qc-business-case.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-052: Review of US-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-052 |
|
||||
| CrossReference | [US-001], [QC-US-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [9c8e294] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [US-001]
|
||||
- Checklist used: [QC-US-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Follows INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable) | Pass | INVEST Check section confirms the six properties for all eight stories and states one dependency exception. |
|
||||
| 2 | Written in "As a / I want / So that" form | Pass | All eight stories use `As a / I want / so that`. |
|
||||
| 3 | Clear, testable acceptance criteria are included | Pass | Every story, including US-001.08, has Given/When/Then acceptance criteria. |
|
||||
| 4 | Traceable to a use case or epic | Pass | Every story traces to a milestone and to UC-001. |
|
||||
| 5 | Story is sized to fit within a single iteration | Pass | Each story is one milestone, which fits one iteration. |
|
||||
| 6 | Story statement avoids technical implementation detail | Fail | Acceptance criteria name `words_to_learn.csv`, `ms-da.csv` and 3000 ms, which are assignment-mandated names and values rather than pure behaviour. |
|
||||
| 7 | Role named in the story matches an actor defined in the Use Case Diagram | Pass | The role `Learner` is the actor of UCD-001. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of US-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-010 (release).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion 6 (Optional) failed: Story statement avoids technical implementation detail; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[US-001]: ../../../docs/user-stories.md
|
||||
[QC-US-001]: ../../../framework/qc/artifacts/qc-user-story.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
@@ -0,0 +1,54 @@
|
||||
# RC-053: Review of PP-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-053 |
|
||||
| CrossReference | [PP-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [9c8e294] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PP-001]
|
||||
- Checklist used: none exists for this type, and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of PP-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — no checklist exists for the Project Plan type; the plan now schedules MIL-010 on 2026-10-16 inside the Business Case constraint (delivery by 2026-10-21) and the language checklist passes. Accepted as the Product Owner's stand-in, after the Product Owner asked for the release in chat. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[PP-001]: ../../../docs/project-plan.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
@@ -0,0 +1,66 @@
|
||||
# RC-054: Review of MIL-010
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-054 |
|
||||
| CrossReference | [MIL-010], [QC-MIL-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [9c8e294] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-010]
|
||||
- Checklist used: [QC-MIL-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | A concrete deliverable is defined for every gate | Pass | A concrete Deliverable section names the output evaluated at the gate. |
|
||||
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | The Go / No-Go table has numbered criteria, each with an observable Go and No-Go. |
|
||||
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Dependencies table names the milestone or documents it needs. |
|
||||
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability table maps to Business Case objectives and the user story. |
|
||||
| 5 | Milestone owner and approving reviewer are identified | Pass | Ownership table names S01 as owner and approving reviewer. |
|
||||
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target Date lies inside the 2026-10-14 to 2026-10-21 window of the Business Case. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of MIL-010 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-010]: ../../../docs/milestones/mil-010-release.md
|
||||
[QC-MIL-001]: ../../../framework/qc/artifacts/qc-milestones-gateways.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
@@ -0,0 +1,50 @@
|
||||
# RC-055: Review of the release v0.1.0
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-055 |
|
||||
| CrossReference | [MIL-010] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [db87a6d] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-010] (the milestone's Go / No-Go criteria, checked against the release v0.1.0)
|
||||
- Checklist used: none exists for a release; the seven criteria of MIL-010 are the checklist
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (record of results)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The executable is rebuilt from the head of `main` that gets the tag and passes the smoke test | Pass | Built with `--clean` from commit `2c580cc` after removing `build/` and `dist/`; four smoke cases passed (window "Flashy" after about 2 s, embedded list, progress file beside the exe with 999 cards, list override with a 2 word list) |
|
||||
| 2 | The tag `v0.1.0` is an annotated tag on that commit and the version files say `0.1.0` | Pass | `git show v0.1.0` shows the annotated tag on `2c580cc`; `pyproject.toml` and `__version__` say `0.1.0` |
|
||||
| 3 | The release has the assets `flash-card.exe` and `flash-card.exe.sha256` | Fail | The upload of `flash-card.exe` (25.8 MB) was rejected with `413 Request Entity Too Large` from the server's reverse proxy; a 1 MB test upload was reset as well; only an 82 byte file passed. The checksum asset alone was deleted again, because a checksum without its file is misleading |
|
||||
| 4 | The SHA-256 of the file downloaded from the release equals the checksum | Fail | There is no downloadable file; the hash of the local build was `0ac22621ecb8ddad53c5f3d2a35278bebd34cefe458510971106ec52d5bdb47d`, which cannot be verified by others because PyInstaller builds are not bit-for-bit reproducible |
|
||||
| 5 | The release notes say unsigned Windows build, the `data` folder and how to build, and give the SHA-256 | Fail | The notes say unsigned, the `data` folder and how to build, and state that the file is not attached; they give no SHA-256 because there is no file |
|
||||
| 6 | CHANGELOG, README and the Install page of the wiki link the release; `check-readme.sh` exit 0 | Pass | Links present in all five files and corrected to say the file is not attached; `check-readme.sh` exit 0 |
|
||||
| 7 | BC-001, US-001 and PP-001 are updated and reviewed `Go` | Pass | RC-051 to RC-053 |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go-with-conditions — the tag and the release page exist and the build was verified, but criteria 3, 4 and 5 fail because the server refuses the upload of the executable. The milestone MIL-010 stays open and issue "Create the release and attach the files" stays open until the executable is attached. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Raise the upload limit of the git host's reverse proxy (nginx `client_max_body_size`, and Gitea's attachment limit if set) to at least 50 MB, then ask for the attachment of `flash-card.exe` and its SHA-256 to v0.1.0 (or confirm another place to host the file) | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-010]: ../milestones/mil-010-release.md
|
||||
[db87a6d]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/db87a6d33bcaaef5a8bc62bf3f804502130b76a9
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-056: Review of BC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-056 |
|
||||
| CrossReference | [BC-001], [QC-BC-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [BC-001]
|
||||
- Checklist used: [QC-BC-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | ROI/Cost-Benefit analysis is quantitative, or where qualitative, is explicitly justified | Pass | The Cost-Benefit table is qualitative and says why: no revenue is expected, so a quantitative return does not apply. |
|
||||
| 2 | Risks are identified with documented impact and mitigation | Pass | The Risks table has 5 risks, each with an impact and a mitigation. |
|
||||
| 3 | Success criteria are measurable, stating explicit targets rather than vague aspirations | Pass | The Success Criteria table has 8 rows with numeric targets and a measure each (for example 0 third-party packages; 5 commands or fewer). |
|
||||
| 4 | Scope explicitly separates In Scope vs Out of Scope | Pass | Scope has `### In Scope` and `### Out of Scope`; the menu bar is added to In Scope. |
|
||||
| 5 | Stakeholders are cross-referenced to Stakeholder Analysis IDs rather than re-described inline | Pass | The Stakeholders table cites S01, S02 and S03 and does not re-describe their roles. |
|
||||
| 6 | Methodology and quality-standard foundation are stated explicitly (e.g. ISO/IEC 25010, Larman) | Pass | Methodological and Standards Foundation names the framework, Larman, ISO/IEC 25010:2023 and PEP 8. |
|
||||
| 7 | Assumptions and constraints are explicit and clearly distinguished from one another | Pass | Assumptions and Constraints are separate sections. |
|
||||
| 8 | Document supports executive decision-making with a clear, unambiguous recommendation | Pass | Recommendation reads `Proceed` with a one-sentence rationale. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of BC-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../../../docs/business-case.md
|
||||
[QC-BC-001]: ../../../framework/qc/artifacts/qc-business-case.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-057: Review of US-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-057 |
|
||||
| CrossReference | [US-001], [QC-US-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [US-001]
|
||||
- Checklist used: [QC-US-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Follows INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable) | Pass | INVEST Check section confirms the six properties for all twelve stories and states one dependency exception. |
|
||||
| 2 | Written in "As a / I want / So that" form | Pass | All twelve stories use `As a / I want / so that`. |
|
||||
| 3 | Clear, testable acceptance criteria are included | Pass | Every story, including US-001.09 to US-001.12, has Given/When/Then acceptance criteria. |
|
||||
| 4 | Traceable to a use case or epic | Pass | Every story traces to a milestone and to UC-001. |
|
||||
| 5 | Story is sized to fit within a single iteration | Pass | Each story is one milestone, which fits one iteration. |
|
||||
| 6 | Story statement avoids technical implementation detail | Fail | Acceptance criteria name `words_to_learn.csv`, `ms-da.csv` and 3000 ms, which are assignment-mandated names and values rather than pure behaviour. |
|
||||
| 7 | Role named in the story matches an actor defined in the Use Case Diagram | Pass | The role `Learner` is the actor of UCD-001. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of US-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion 6 (Optional) failed: Story statement avoids technical implementation detail; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[US-001]: ../../../docs/user-stories.md
|
||||
[QC-US-001]: ../../../framework/qc/artifacts/qc-user-story.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,74 @@
|
||||
# RC-058: Review of UC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-058 |
|
||||
| CrossReference | [UC-001], [QC-UC-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [UC-001]
|
||||
- Checklist used: [QC-UC-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Consists of a single, concise paragraph summarizing only the primary success scenario | N-A | The format is Fully Dressed; the Brief format criterion does not apply. |
|
||||
| 2 | Written as an informal multi-paragraph narrative; may mention some alternate flows without formal structure | N-A | The format is Fully Dressed; the Casual format criterion does not apply. |
|
||||
| 3 | All standard sections are present: actors, preconditions, postconditions, main success scenario, alternative/exception flows | Pass | Scope, level, actor, stakeholders, pre- and postconditions, main success scenario and extensions are present. |
|
||||
| 4 | Preconditions and postconditions are explicitly defined | Pass | Preconditions and postconditions are listed. |
|
||||
| 5 | Primary actor is explicitly stated | Pass | Primary actor is `Learner`. |
|
||||
| 6 | Stakeholders and their interests are stated | Pass | Stakeholders S01 and S02 and their interests are stated. |
|
||||
| 7 | Main success scenario is written as clear, numbered steps | Pass | Main success scenario has 7 numbered steps. |
|
||||
| 8 | Alternative/exception flows correctly reference `<<include>>`/`<<extend>>` use cases where relevant, per UML 2.5.1 | Pass | UCD-001 has no include or extend relationship, so no extension needs to reference one; the extensions (3a, 4a, 5a, 7a, 7b, 9a, *a) are plain alternative flows. |
|
||||
| 9 | Explicit business rules are captured per step where applicable, rather than embedded loosely in narrative text | Pass | The Business Rules table gives a rule per step. |
|
||||
| 10 | Naming of actors and use case title is consistent with the corresponding Use Case Diagram and User Stories | Pass | Title and actor match UCD-001 and US-001; the menu extension matches US-001.09 to US-001.12. |
|
||||
| 11 | Scope/level (e.g. summary, user-goal, subfunction) is explicitly stated | Pass | `Level: user-goal` and `Scope: Flash Card program`. |
|
||||
| 12 | Use case is written from the actor's goal perspective, free of UI or implementation detail | Pass | Steps are written as goals and answers; buttons, files and milliseconds are in the wireframe and milestones. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of UC-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[UC-001]: ../../../docs/uc-001/uc.md
|
||||
[QC-UC-001]: ../../../framework/qc/artifacts/qc-use-case.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,69 @@
|
||||
# RC-059: Review of SSD-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-059 |
|
||||
| CrossReference | [SSD-001], [QC-SSD-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [SSD-001]
|
||||
- Checklist used: [QC-SSD-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Input/output messages match the corresponding Use Case's main success scenario step-for-step | Pass | System Operations table maps each message to steps of the main success scenario (1 to 9) or to the menu extension *a; the timer step is the one stated deviation. |
|
||||
| 2 | Actor and System are treated strictly as black boxes (system shown as `:System`) | Pass | The system is `:System`; no internal object appears. |
|
||||
| 3 | Object creation/destruction of the System instance handled explicitly where relevant | Pass | Lifecycle Notes state that the system lives for one run. |
|
||||
| 4 | Return values are shown for operations that produce one, using dashed return arrows | Pass | Dashed return arrows are drawn for every message that returns something; `exit` returns nothing and ends the program. |
|
||||
| 5 | Alternate/exceptional flows are represented separately (or explicitly out of scope noted) | Pass | The Alternate Flows section states the extensions that add no operation and that they are out of scope. |
|
||||
| 6 | Message names are verb phrases consistent with the use case's system responsibilities | Pass | `startStudySession`, `markKnown` and `markUnknown` are verb phrases. |
|
||||
| 7 | Diagram references the specific Use Case (name and ID) it depicts | Pass | Source Use Case section names UC-001 and the scenario. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of SSD-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[SSD-001]: ../../../docs/uc-001/ssd.md
|
||||
[QC-SSD-001]: ../../../framework/qc/artifacts/qc-ssd.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,53 @@
|
||||
# RC-060: Review of OC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-060 |
|
||||
| CrossReference | [OC-001], [QC-OC-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [OC-001]
|
||||
- Checklist used: [QC-OC-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Method signature is complete: operation name, parameter types, and return type | Pass | Each contract gives name, parameter list and return type (`startStudySession(): CardDto | None`). |
|
||||
| 2 | Preconditions explicitly list required state before execution | Pass | Preconditions are listed per contract. |
|
||||
| 3 | Postconditions explicitly describe resulting state using Larman's "instance created/associated/attribute modified" style | Pass | Postconditions use created / associated / destroyed / attribute set wording. |
|
||||
| 4 | Exceptions and error conditions are documented, including the triggering precondition failure | Pass | Each contract has an Exceptions table with the failing precondition. |
|
||||
| 5 | Operation is explicitly traceable to a single SSD message | Pass | Each of the nine contracts traces to exactly one SSD message; the timer step has none and says so. |
|
||||
| 6 | Contract avoids specifying implementation/algorithmic details (declarative, not procedural) | Pass | Postconditions are declarative. |
|
||||
| 7 | Cross-references the Domain Model classes/associations affected by pre/postconditions | Pass | Domain Model concepts and IT terms are cited per contract. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[OC-001]: ../../../docs/uc-001/oc.md
|
||||
[QC-OC-001]: ../../../framework/qc/artifacts/qc-operation-contract.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,54 @@
|
||||
# RC-061: Review of SD-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-061 |
|
||||
| CrossReference | [SD-001], [QC-SD-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [SD-001]
|
||||
- Checklist used: [QC-SD-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Message passing strictly follows UML sync/async/return arrow syntax | Pass | Calls are solid arrows with dashed returns. |
|
||||
| 2 | GRASP/GoF patterns applied and explicitly annotated where used (e.g. Controller, Observer, Mediator, Factory) | Pass | Each sequence has a Pattern Annotations table (Creator, Information Expert, Null Object, MVVM, Repository). |
|
||||
| 3 | Lifelines show activation bars matching actual processing time/call nesting | Pass | Activations are drawn for the session and the view model. |
|
||||
| 4 | Object creation and destruction shown with correct UML notation (`create`/`destroy` messages, X on lifeline) | Pass | `create` is used for `Deck` and `StudySession`; no object is destroyed during the program's life and that is stated by omission, the process ends. |
|
||||
| 5 | Diagram realizes the postconditions of a specific Operation Contract | Pass | Each of the six sequences has a Postcondition Coverage table for its contract in OC-001; `changeLevel`, `showContact` and `exit` are single calls and need no sequence. |
|
||||
| 6 | Responsibility assignment favors low coupling/high cohesion (no god-object receiving all messages) | Pass | Responsibility Check notes state that no object receives all messages. |
|
||||
| 7 | Loop, alt, and opt combined fragments used correctly for conditional/repeated behavior | Pass | `alt` and `opt` fragments are used for the progress file and the empty deck. |
|
||||
| 8 | Each exception of the realized Operation Contract is shown as an `alt` or `opt` fragment, or its absence is justified | Fail | The exceptions of OC-001 (missing file, malformed file) are raised before the sequence starts and are not drawn as `alt` fragments; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion 8 (Optional) failed: Each exception of the realized Operation Contract is shown as an `alt` or `opt` fragment, ; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[SD-001]: ../../../docs/uc-001/sd.md
|
||||
[QC-SD-001]: ../../../framework/qc/artifacts/qc-sequence-diagram.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,55 @@
|
||||
# RC-062: Review of DCD-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-062 |
|
||||
| CrossReference | [DCD-001], [QC-DCD-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [DCD-001]
|
||||
- Checklist used: [QC-DCD-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | SOLID principles applied; no god classes with excessive responsibilities | Pass | Each class has one responsibility (Class Table); `Application` is the controller of the commands and does not hold card rules. |
|
||||
| 2 | Visibility markers correct and consistent (`+` public, `-` private, `#` protected) | Pass | Visibility markers are on all members. |
|
||||
| 3 | Relationships correctly distinguished: Association vs Aggregation vs Composition vs Dependency | Pass | Composition (Vocabulary and Card, MenuViewModel and MenuEntry), aggregation (Deck), association, dependency and realization are distinguished. |
|
||||
| 4 | Multiplicities and navigability specified on all associations | Pass | Multiplicities are on the associations; dependencies are directed. |
|
||||
| 5 | Applied design patterns are annotated explicitly (e.g. Singleton, Factory, Strategy) | Pass | Pattern Annotations table lists Repository, Ports and adapters, Null Object, MVVM, Composition root. |
|
||||
| 6 | Method signatures are traceable to Operation Contracts and/or design Sequence Diagrams | Pass | Method Traceability table maps every operation, including the menu and `Application` commands and `ProgressRepository.reset`, to OC-001 and SD-001. |
|
||||
| 7 | Class names and structure remain consistent with the Domain Model concepts they refine | Pass | The Class Table has a `Refines` column; names match the dictionary's IT terms (`reset` added). |
|
||||
| 8 | No circular dependencies between classes/packages unless explicitly justified | Pass | Dependency Check states there are no cycles. |
|
||||
| 9 | Dependencies between classes and packages point inward: domain classes do not depend on infrastructure, delivery or framework classes | Pass | Domain imports nothing; infrastructure and presentation point inward (Dependency Check). |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[DCD-001]: ../../../docs/dcd.md
|
||||
[QC-DCD-001]: ../../../framework/qc/artifacts/qc-dcd.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,69 @@
|
||||
# RC-063: Review of DICT-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-063 |
|
||||
| CrossReference | [DICT-001], [QC-DICT-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [DICT-001]
|
||||
- Checklist used: [QC-DICT-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Every row has a PO term, its language, an IT term and a definition | Pass | All 9 rows have PO term, language, IT term and definition. |
|
||||
| 2 | Each PO term maps to exactly one IT term and the reverse (no synonyms) | Pass | One IT term per PO term; no synonym appears. |
|
||||
| 3 | Every Domain Model concept has a row, and the Domain Model uses its PO term | Pass | The 5 concepts of DM-001 have a row and DM-001 uses the PO term; `Reset` was added. |
|
||||
| 4 | The Operation Contracts, Sequence Diagrams, Design Class Diagrams and ERD use the IT term, not the PO term | Pass | DCD-001, OC-001 and SD-001 use `Card`, `Vocabulary`, `Deck`, `StudySession`. |
|
||||
| 5 | Definitions are written in the PO language and are one sentence | Pass | Definitions are one English sentence each. |
|
||||
| 6 | "Used as PO term in" and "Used as IT term in" name artifact types that exist in the project | Pass | Artifact types named in both columns exist in the project. |
|
||||
| 7 | The dictionary's `Language` and `Domain` rows, and the language of every row, match the PO language and domain in the project registry | Pass | `Language | en` and `Domain | it` match the registry; every row says `en`. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of DICT-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-011 (menu bar).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[DICT-001]: ../../../docs/dictionary.md
|
||||
[QC-DICT-001]: ../../../framework/qc/artifacts/qc-dictionary.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,54 @@
|
||||
# RC-064: Review of PP-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-064 |
|
||||
| CrossReference | [PP-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PP-001]
|
||||
- Checklist used: none exists for this type, and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of PP-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — no checklist exists for the Project Plan type; the plan now schedules MIL-011 on 2026-10-17 inside the Business Case constraint (delivery by 2026-10-21) and the language checklist passes. Accepted as the Product Owner's stand-in, after the Product Owner accepted the MIL-011 plan in chat. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[PP-001]: ../../../docs/project-plan.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,66 @@
|
||||
# RC-065: Review of MIL-011
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-065 |
|
||||
| CrossReference | [MIL-011], [QC-MIL-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-011]
|
||||
- Checklist used: [QC-MIL-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | A concrete deliverable is defined for every gate | Pass | A concrete Deliverable section names the output evaluated at the gate. |
|
||||
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | The Go / No-Go table has numbered criteria, each with an observable Go and No-Go. |
|
||||
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Dependencies table names the milestone or documents it needs. |
|
||||
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability table maps to Business Case objectives and the user story. |
|
||||
| 5 | Milestone owner and approving reviewer are identified | Pass | Ownership table names S01 as owner and approving reviewer. |
|
||||
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target Date lies inside the 2026-10-14 to 2026-10-21 window of the Business Case. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of MIL-011 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-011]: ../../../docs/milestones/mil-011-menu-bar.md
|
||||
[QC-MIL-001]: ../../../framework/qc/artifacts/qc-milestones-gateways.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
@@ -0,0 +1,64 @@
|
||||
# RC-066: Review of PY-MIL-011
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-066 |
|
||||
| CrossReference | [PY-MIL-011], [QC-PY-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [ce4aacb] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PY-MIL-011]
|
||||
- Checklist used: [QC-PY-001]
|
||||
- Scope: full review
|
||||
- Language and domain: n/a (technical type)
|
||||
- Language reviewer: none
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Packages, modules, functions, variables, classes and constants follow PEP 8 casing (`snake_case`, `PascalCase`, `UPPER_SNAKE`) | Pass | PEP 8 casing holds in the new modules (`menu_view.py`, `menu_view_model.py`, `progress_file_name.py`); ruff rule set N passes. |
|
||||
| 2 | Names state purpose in the domain's language; no unexplained abbreviations, no single-letter names outside tiny scopes | Pass | Names state purpose and are the DCD-001 IT terms (`MenuView`, `MenuViewModel`, `Application.open_word_list`, `reset`). |
|
||||
| 3 | Code is produced by the project's formatter and passes its linter with no unexplained suppressions | Pass | `ruff check` and `ruff format --check` pass on 79 files with no suppressions. |
|
||||
| 4 | Every function and method signature is type-annotated, including `-> None` | Pass | Every signature is annotated; `mypy --strict` passes on 49 source files and on the three tool scripts. |
|
||||
| 5 | No bare `except:`, no swallowed exceptions; specific exceptions are raised and the cause is kept (`raise ... from`) | Pass | Refused files raise `VocabularyFormatError` with `from` (also for bytes that are not UTF-8), a failed reset is logged and shown, a failed browser start is logged; no bare `except`, nothing swallowed silently. |
|
||||
| 6 | No mutable default arguments and no shadowed builtins | Pass | No mutable defaults, no builtin shadowed. |
|
||||
| 7 | Files, locks and connections are managed with context managers | Pass | Reading uses `with`; the delete uses `unlink(missing_ok=True)`; the Tk root is destroyed through `exit_application`. |
|
||||
| 8 | Public modules, classes and functions have docstrings that say what, not how | Pass | New and changed members have Doxygen docstrings; `doxygen Doxyfile` ends with 0 warnings. |
|
||||
| 9 | Logging uses `logging`, not `print`; no secrets or personal data in log output | Pass | No `print`; failures use `logging`; the contact data is public author information given by S01. |
|
||||
| 10 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Pass | The new classes match the revised DCD-001 and OC-001/SD-001. Deviations: `MenuEntry` has a third field `underline`; `MenuViewModel` has `file_label` and `contact_menu_label`; `Application` has `word_list_folder` and takes a repository factory; `MenuView` depends on a small `MenuApplication` Protocol to avoid an import cycle. |
|
||||
| 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Pass | 258 tests (5 consecutive full runs green): unit with fakes only, integration with two word lists, and e2e on the real menu bar with injected dialogs; none uses the network or a real browser. |
|
||||
| 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Pass | `mypy --strict` reports no issue; no `Any`. |
|
||||
| 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Pass | `dependencies` stays empty; `webbrowser`, `tkinter.filedialog` and `tkinter.messagebox` are standard library. |
|
||||
| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Pass | The progress file rule is one function (`progress_file_name`); labels, contact data and dialog texts are constants once. |
|
||||
| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Pass | `lint-imports` reports `Layers point inward` kept; a grep finds no `tkinter`, `csv`, `random` or `webbrowser` import in `domain` or `application`; the menu view model imports no Tkinter. |
|
||||
| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Pass | The view model owns the entries and the view draws and asks dialogs; `Application` coordinates; the repositories own their files; dialogs and the browser are injected. |
|
||||
| 17 | Source is laid out in the layers and folders of the clean architecture folder structure (`domain`, `application`, `infrastructure`, `presentation` packages under `src/`, and `unit`, `integration` and `e2e` under `tests/`), in `snake_case`, and imports between the layers point inward | Pass | `presentation/features/menu/` and `infrastructure/persistence/` follow the folder structure; tests stay in `unit`, `integration`, `e2e`. |
|
||||
| 18 | File and folder names are English, contain no space and no character outside letters, digits, `-`, `_` and `.`, and follow the casing of the language for files | Pass | File and folder names follow the rule. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Milestone MIL-011 Go criteria: 1 the menu bar structure and order are read from the real `tk.Menu` (e2e); 2 open valid / invalid / cancelled covered (unit and e2e, including a Latin-1 file and invalid UTF-8 bytes); 3 two lists keep separate progress files, `ms-da.csv` keeps `words_to_learn.csv` (integration); 4 change level shows the level screen and keeps the known words (unit and e2e); 5 reset asks, deletes only the progress file of the open list, never the list file (unit, integration, e2e); 6 About, Contact opens `https://www.linkedin.com/in/tirsvad74` through an injected `webbrowser.open` (unit and e2e); 7 exit cancels the timer and destroys the window (e2e); 8 view model tested without Tkinter; 9 RC-056 to RC-065 `Go`, README and the Usage page of the wiki in three languages describe the menu; 10 this record, `pytest` 258 passed and linters clean. The executable was rebuilt with the menu and passes the smoke test (window, embedded list, list override, progress file). A real browser launch and the native file dialog were not exercised on this machine. Defect found by the reviewer and fixed in this milestone: a file that is not UTF-8 raised `UnicodeDecodeError` instead of a message. All Go.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| none | - | - |
|
||||
|
||||
---
|
||||
|
||||
[PY-MIL-011]: ../../../src/flash_card
|
||||
[QC-PY-001]: ../../../framework/qc/code/qc-programming-python.md
|
||||
[ce4aacb]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/ce4aacb4bc7ce742e3b2397e05a43572497402ef
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-067: Review of BC-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-067 |
|
||||
| CrossReference | [BC-001], [QC-BC-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [BC-001]
|
||||
- Checklist used: [QC-BC-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | ROI/Cost-Benefit analysis is quantitative, or where qualitative, is explicitly justified | Pass | The Cost-Benefit table is qualitative and says why: no revenue is expected, so a quantitative return does not apply. |
|
||||
| 2 | Risks are identified with documented impact and mitigation | Pass | The Risks table has 5 risks, each with an impact and a mitigation. |
|
||||
| 3 | Success criteria are measurable, stating explicit targets rather than vague aspirations | Pass | The Success Criteria table has 8 rows with numeric targets and a measure each (for example 0 third-party packages; 5 commands or fewer). |
|
||||
| 4 | Scope explicitly separates In Scope vs Out of Scope | Pass | Scope has `### In Scope` and `### Out of Scope`; the releases are In Scope, an installer and signing stay Out of Scope. |
|
||||
| 5 | Stakeholders are cross-referenced to Stakeholder Analysis IDs rather than re-described inline | Pass | The Stakeholders table cites S01, S02 and S03 and does not re-describe their roles. |
|
||||
| 6 | Methodology and quality-standard foundation are stated explicitly (e.g. ISO/IEC 25010, Larman) | Pass | Methodological and Standards Foundation names the framework, Larman, ISO/IEC 25010:2023 and PEP 8. |
|
||||
| 7 | Assumptions and constraints are explicit and clearly distinguished from one another | Pass | Assumptions and Constraints are separate sections. |
|
||||
| 8 | Document supports executive decision-making with a clear, unambiguous recommendation | Pass | Recommendation reads `Proceed` with a one-sentence rationale. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of BC-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-012 (release v0.2.0).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[BC-001]: ../../../docs/business-case.md
|
||||
[QC-BC-001]: ../../../framework/qc/artifacts/qc-business-case.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
@@ -0,0 +1,70 @@
|
||||
# RC-068: Review of US-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-068 |
|
||||
| CrossReference | [US-001], [QC-US-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [US-001]
|
||||
- Checklist used: [QC-US-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Follows INVEST criteria (Independent, Negotiable, Valuable, Estimable, Small, Testable) | Pass | INVEST Check section confirms the six properties for all twelve stories and states one dependency exception. |
|
||||
| 2 | Written in "As a / I want / So that" form | Pass | All twelve stories use `As a / I want / so that`. |
|
||||
| 3 | Clear, testable acceptance criteria are included | Pass | Every story, including US-001.08 in its new wording, has Given/When/Then acceptance criteria. |
|
||||
| 4 | Traceable to a use case or epic | Pass | Every story traces to a milestone and to UC-001. |
|
||||
| 5 | Story is sized to fit within a single iteration | Pass | Each story is one milestone, which fits one iteration. |
|
||||
| 6 | Story statement avoids technical implementation detail | Fail | Acceptance criteria name `words_to_learn.csv`, `ms-da.csv` and 3000 ms, which are assignment-mandated names and values rather than pure behaviour. |
|
||||
| 7 | Role named in the story matches an actor defined in the Use Case Diagram | Pass | The role `Learner` is the actor of UCD-001. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of US-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Professional English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
Full review (not a delta) after the change for MIL-012 (release v0.2.0).
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion 6 (Optional) failed: Story statement avoids technical implementation detail; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[US-001]: ../../../docs/user-stories.md
|
||||
[QC-US-001]: ../../../framework/qc/artifacts/qc-user-story.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
@@ -0,0 +1,54 @@
|
||||
# RC-069: Review of PP-001
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-069 |
|
||||
| CrossReference | [PP-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [PP-001]
|
||||
- Checklist used: none exists for this type, and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of PP-001 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — no checklist exists for the Project Plan type; the plan now schedules MIL-012 on 2026-10-18 inside the Business Case constraint (delivery by 2026-10-21) and the language checklist passes. Accepted as the Product Owner's stand-in, after the Product Owner accepted the MIL-012 plan in chat. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[PP-001]: ../../../docs/project-plan.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
@@ -0,0 +1,66 @@
|
||||
# RC-070: Review of MIL-012
|
||||
|
||||
## Metadata
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | RC-070 |
|
||||
| CrossReference | [MIL-012], [QC-MIL-001], [QC-LANG-001] |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Artifact Under Review
|
||||
|
||||
- Instance reviewed: [MIL-012]
|
||||
- Checklist used: [QC-MIL-001], and [QC-LANG-001] (language and domain)
|
||||
- Scope: full review
|
||||
- Language and domain: en / it
|
||||
- Language reviewer: none (the stand-in for S01 reads the language and knows the domain)
|
||||
- Mode: autonomous, not independent (reviewer is `AI as stand-in for S01`)
|
||||
|
||||
## Checklist Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | A concrete deliverable is defined for every gate | Pass | A concrete Deliverable section names the output evaluated at the gate. |
|
||||
| 2 | Explicit Go/No-Go criteria are stated for each gate | Pass | The Go / No-Go table has numbered criteria, each with an observable Go and No-Go. |
|
||||
| 3 | Dependencies on other milestones are explicitly mapped | Pass | Dependencies table names the milestone or documents it needs. |
|
||||
| 4 | Each milestone is traceable to a Business Case objective or KPI | Pass | Traceability table maps to Business Case objectives and the user story. |
|
||||
| 5 | Milestone owner and approving reviewer are identified | Pass | Ownership table names S01 as owner and approving reviewer. |
|
||||
| 6 | Milestone has a defined target date consistent with project constraints | Pass | Target Date lies inside the 2026-10-14 to 2026-10-21 window of the Business Case. |
|
||||
|
||||
## Language and Domain Results
|
||||
|
||||
| # | Criterion | Status | Evidence/Notes |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | The Metadata table has a `Language` row and a `Domain` row, and neither is a placeholder | Pass | Metadata of MIL-012 has `Language | en` and `Domain | it`; neither is a placeholder. |
|
||||
| 2 | `Language` is a BCP 47 code and `Domain` is a value from the registry's domain list | Pass | `en` is a BCP 47 code and `it` is a value of the registry's domain list. |
|
||||
| 3 | The content (prose and table cells) is written in the stated language | Pass | Prose and table cells are English; Malay and Danish words and file names appear only as quoted data. |
|
||||
| 4 | The register matches the one the registry gives for the artifact type | Pass | The registry gives `IT Executive English` for this type; the text is written for that reader. |
|
||||
| 5 | Domain terms are the PO terms of the domain's dictionary, with no synonyms | Pass | The PO terms of DICT-001 (flash card, word list, words to learn, study session) are used and no synonym replaces them. |
|
||||
| 6 | Metadata keys, section headings, IDs and statuses are in English | Pass | Metadata keys, headings, IDs and statuses are English. |
|
||||
| 7 | No translated twin (`<name>.<language>.md`) exists beside the document | Pass | No translated twin exists beside the document (checked in `docs/`). |
|
||||
| 8 | A change of language or domain since the previous accepted version has a Version History row and was reviewed again | Pass | First version; no change of language or domain since an earlier accepted version. |
|
||||
| 9 | A reviewer competent in the domain, and in the language, has confirmed that the domain terms are used correctly | Pass | The reviewer is the stand-in for S01, the Product Owner, who reads English and knows the IT domain; no second language reviewer is needed (review-checklist-process step 2). Open to challenge by S01 in the end-of-run summary. |
|
||||
| 10 | Abbreviations are spelled out on first use, in the stated language | Fail | CSV, MVVM, UI, PO and similar abbreviations are not all spelled out at first use; Optional, deferred. |
|
||||
|
||||
## Overall Verdict
|
||||
|
||||
Go — every Mandatory criterion passes; the failed Optional criteria are deferred with an action item. Reviewed by AI as stand-in for S01; not independent of the author.
|
||||
|
||||
## Action Items
|
||||
|
||||
| Action | Owner | Due |
|
||||
| --- | --- | --- |
|
||||
| Criterion LANG 10 (Optional) failed: Abbreviations are spelled out on first use, in the stated language; fix or accept the deferral | S01 | 2026-10-21 |
|
||||
|
||||
---
|
||||
|
||||
[MIL-012]: ../../../docs/milestones/mil-012-release-0-2-0.md
|
||||
[QC-MIL-001]: ../../../framework/qc/artifacts/qc-milestones-gateways.md
|
||||
[QC-LANG-001]: ../../../framework/qc/artifacts/qc-language-domain.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
@@ -10,7 +10,12 @@
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added MIL-008 and the review records of the level choice (no checklist exists for this type) | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added MIL-008 and the review records of the level choice (no checklist exists for this type) | [0b983b7] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the rows and review records of the executable request (no checklist exists for this type) | [768ca34] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the rows and review records of the executable request (no checklist exists for this type) | [061b4f4] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the rows and review records of the executable request (no checklist exists for this type) | [9c8e294] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the rows and review records of the executable request (no checklist exists for this type) | [2211d0f] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the rows and review records of the executable request (no checklist exists for this type) | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
@@ -24,18 +29,18 @@ updated whenever an artifact instance is created or reviewed.
|
||||
|
||||
| Artifact Instance | Type | Language | Domain | Upstream (Backward Link) | Downstream (Forward Link) | Last Reviewed (RC-ID) |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| BC-001 | Business Case | en | it | - | SA-001, PP-001 | [RC-030] |
|
||||
| BC-001 | Business Case | en | it | - | SA-001, PP-001 | [RC-067] |
|
||||
| SA-001 | Stakeholder Analysis | en | it | BC-001 | PP-001, DICT-001 | [RC-002] |
|
||||
| PP-001 | Project Plan | en | it | BC-001, SA-001 | MIL-001 to MIL-008 | [RC-032] |
|
||||
| PP-001 | Project Plan | en | it | BC-001, SA-001 | MIL-001 to MIL-008 | [RC-069] |
|
||||
| UCD-001 | Use Case Diagram | en | it | SA-001, BC-001 | US-001, UC-001 | [RC-004] |
|
||||
| US-001 | User Story | en | it | UCD-001, BC-001 | MIL-002 to MIL-006, MIL-008 | [RC-031] |
|
||||
| UC-001 | Use Case | en | it | UCD-001, US-001 | DM-001, SSD-001 | [RC-033] |
|
||||
| US-001 | User Story | en | it | UCD-001, BC-001 | MIL-002 to MIL-006, MIL-008 | [RC-068] |
|
||||
| UC-001 | Use Case | en | it | UCD-001, US-001 | DM-001, SSD-001 | [RC-058] |
|
||||
| DM-001 | Domain Model | en | it | UC-001 | SSD-001, DICT-001, DCD-001 | [RC-034] |
|
||||
| SSD-001 | System Sequence Diagram | en | it | UC-001, DM-001 | DCD-001 | [RC-036] |
|
||||
| OC-001 | Operation Contract | - | - | SSD-001, DM-001 | SD-001 | [RC-037] |
|
||||
| SD-001 | Sequence Diagram | - | - | OC-001 | DCD-001 | [RC-038] |
|
||||
| DCD-001 | Design Class Diagram | - | - | DM-001, SD-001, DICT-001 | src/flash_card | [RC-039] |
|
||||
| DICT-001 | Domain Dictionary | en | it | BC-001, SA-001, DM-001 | DCD-001 | [RC-035] |
|
||||
| SSD-001 | System Sequence Diagram | en | it | UC-001, DM-001 | DCD-001 | [RC-059] |
|
||||
| OC-001 | Operation Contract | - | - | SSD-001, DM-001 | SD-001 | [RC-060] |
|
||||
| SD-001 | Sequence Diagram | - | - | OC-001 | DCD-001 | [RC-061] |
|
||||
| DCD-001 | Design Class Diagram | - | - | DM-001, SD-001, DICT-001 | src/flash_card | [RC-062] |
|
||||
| DICT-001 | Domain Dictionary | en | it | BC-001, SA-001, DM-001 | DCD-001 | [RC-063] |
|
||||
| ADR-0001 | Architecture Decision Record | - | - | BC-001 | MIL-001, MIL-003, MIL-006 | [RC-013] |
|
||||
| ADR-0002 | Architecture Decision Record | - | - | BC-001 | DCD-001 | [RC-014] |
|
||||
| ADR-0003 | Architecture Decision Record | - | - | BC-001 | - | [RC-015] |
|
||||
@@ -47,6 +52,11 @@ updated whenever an artifact instance is created or reviewed.
|
||||
| MIL-006 | Milestone / Gateway | en | it | BC-001, PP-001 | tasks of MIL-006 | [RC-021] |
|
||||
| MIL-007 | Milestone / Gateway | en | it | BC-001, PP-001 | tasks of MIL-007 | [RC-022] |
|
||||
| MIL-008 | Milestone / Gateway | en | it | BC-001, PP-001 | tasks of MIL-008 | [RC-040] |
|
||||
| MIL-009 | Milestone / Gateway | en | it | BC-001 | - | [RC-050] |
|
||||
| ADR-0004 | Architecture Decision Record | - | - | BC-001 | - | [RC-046] |
|
||||
| MIL-010 | Milestone / Gateway | en | it | BC-001 | - | [RC-054], [RC-055] |
|
||||
| MIL-011 | Milestone / Gateway | en | it | BC-001 | - | [RC-065] |
|
||||
| MIL-012 | Milestone / Gateway | en | it | BC-001 | - | [RC-070] |
|
||||
| PY-MIL-001 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-023] |
|
||||
| PY-MIL-002 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-024] |
|
||||
| PY-MIL-003 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-025] |
|
||||
@@ -54,6 +64,10 @@ updated whenever an artifact instance is created or reviewed.
|
||||
| PY-MIL-005 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-027] |
|
||||
| PY-MIL-006 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-028] |
|
||||
| PY-MIL-007 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-029] |
|
||||
| PY-MIL-008 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-041] |
|
||||
| PY-MIL-009 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-048] |
|
||||
| PY-MIL-011 | Python Source Code | - | - | DCD-001, ADR-0002 | - | [RC-066] |
|
||||
| PY-FIX-001 | Python Source Code | - | - | PY-MIL-008 | - | [RC-049] |
|
||||
|
||||
## Coverage Notes
|
||||
|
||||
@@ -135,3 +149,47 @@ updated whenever an artifact instance is created or reviewed.
|
||||
[RC-040]: ./reviews/rc-040-mil-008.md
|
||||
[MIL-008]: ../milestones/mil-008-choose-level.md
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[RC-041]: ./reviews/rc-041-py-mil-008.md
|
||||
[PY-MIL-008]: ../../src/flash_card
|
||||
[RC-042]: ./reviews/rc-042-business-case-exe.md
|
||||
[RC-043]: ./reviews/rc-043-user-stories-exe.md
|
||||
[RC-044]: ./reviews/rc-044-project-plan-exe.md
|
||||
[RC-045]: ./reviews/rc-045-design-class-diagram-exe.md
|
||||
[RC-046]: ./reviews/rc-046-adr-0004.md
|
||||
[RC-047]: ./reviews/rc-047-mil-009.md
|
||||
[MIL-009]: ../milestones/mil-009-executable.md
|
||||
[ADR-0004]: ../adr/adr-0004-pyinstaller-executable.md
|
||||
[768ca34]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/768ca344c95d4f21e565e37ac96661c2f8dc8f54
|
||||
[RC-048]: ./reviews/rc-048-py-mil-009.md
|
||||
[PY-MIL-009]: ../../src/flash_card
|
||||
[RC-049]: ./reviews/rc-049-py-fix-001.md
|
||||
[PY-FIX-001]: ../../tests/unit/test_app.py
|
||||
[RC-050]: ./reviews/rc-050-mil-009-task9.md
|
||||
[061b4f4]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/061b4f48b5d49e6800656c95d79df707e07ec0f3
|
||||
[RC-051]: ./reviews/rc-051-business-case-release.md
|
||||
[RC-052]: ./reviews/rc-052-user-stories-release.md
|
||||
[RC-053]: ./reviews/rc-053-project-plan-release.md
|
||||
[RC-054]: ./reviews/rc-054-mil-010.md
|
||||
[MIL-010]: ../milestones/mil-010-release.md
|
||||
[9c8e294]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/9c8e2940217e615f82eda2d48aca9b2fd58f3687
|
||||
[RC-055]: ./reviews/rc-055-release-v0-1-0.md
|
||||
[RC-056]: ./reviews/rc-056-business-case-menu.md
|
||||
[RC-057]: ./reviews/rc-057-user-stories-menu.md
|
||||
[RC-058]: ./reviews/rc-058-use-case-menu.md
|
||||
[RC-059]: ./reviews/rc-059-system-sequence-diagram-menu.md
|
||||
[RC-060]: ./reviews/rc-060-operation-contracts-menu.md
|
||||
[RC-061]: ./reviews/rc-061-sequence-diagrams-menu.md
|
||||
[RC-062]: ./reviews/rc-062-design-class-diagram-menu.md
|
||||
[RC-063]: ./reviews/rc-063-domain-dictionary-menu.md
|
||||
[RC-064]: ./reviews/rc-064-project-plan-menu.md
|
||||
[RC-065]: ./reviews/rc-065-mil-011.md
|
||||
[MIL-011]: ../milestones/mil-011-menu-bar.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
[RC-066]: ./reviews/rc-066-py-mil-011.md
|
||||
[PY-MIL-011]: ../../src/flash_card
|
||||
[RC-067]: ./reviews/rc-067-business-case-r020.md
|
||||
[RC-068]: ./reviews/rc-068-user-stories-r020.md
|
||||
[RC-069]: ./reviews/rc-069-project-plan-r020.md
|
||||
[RC-070]: ./reviews/rc-070-mil-012.md
|
||||
[MIL-012]: ../milestones/mil-012-release-0-2-0.md
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
|
||||
+116
-3
@@ -9,8 +9,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added chooseLevel; startStudySession returns the levels | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added chooseLevel; startStudySession returns the levels | [0b983b7] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the menu contracts | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
@@ -93,6 +93,119 @@ The turn-over of the card after 3000 ms is started by the system's own timer, no
|
||||
| --- | --- |
|
||||
| `current_card` is `None` (no card is shown) | Nothing is changed and nothing is stored |
|
||||
|
||||
## Contract: openWordList
|
||||
|
||||
| Item | Value |
|
||||
| --- | --- |
|
||||
| Operation | `openWordList(path: Path): tuple[Level, ...]` |
|
||||
| Traces to | `openWordList` in [SSD-001] |
|
||||
| Domain Model concepts | Word List, Study Session, Words To Learn ([DM-001]); IT terms `Vocabulary`, `StudySession`, `Deck` ([DICT-001]) |
|
||||
|
||||
**Preconditions**
|
||||
|
||||
- `path` names an existing file.
|
||||
|
||||
**Postconditions**
|
||||
|
||||
- The `Vocabulary` of `path` is the word list in use and its progress file (`words_to_learn.csv` for `ms-da.csv`, else `words_to_learn_<name>.csv` in the data folder) is the progress in use.
|
||||
- Any earlier `StudySession` was dropped and the levels are returned; no card is shown until a level is chosen.
|
||||
|
||||
**Exceptions**
|
||||
|
||||
| Condition (failing precondition) | Outcome |
|
||||
| --- | --- |
|
||||
| The file does not exist or is not a word list (no header of two language codes, a row that is not two cells, or no card) | `VocabularyNotFoundError` or `VocabularyFormatError` is raised; the earlier word list and session stay in use and no file is changed |
|
||||
|
||||
## Contract: changeLevel
|
||||
|
||||
| Item | Value |
|
||||
| --- | --- |
|
||||
| Operation | `changeLevel(): tuple[Level, ...]` |
|
||||
| Traces to | `changeLevel` in [SSD-001] |
|
||||
| Domain Model concepts | Level, Study Session ([DM-001]); IT terms `Level`, `StudySession` ([DICT-001]) |
|
||||
|
||||
**Preconditions**
|
||||
|
||||
- A word list is in use.
|
||||
|
||||
**Postconditions**
|
||||
|
||||
- The pending flip timer was cancelled, the `StudySession` was dropped and the levels are returned; the progress file was not changed.
|
||||
|
||||
**Exceptions**
|
||||
|
||||
| Condition (failing precondition) | Outcome |
|
||||
| --- | --- |
|
||||
| None | – |
|
||||
|
||||
## Contract: resetWordList
|
||||
|
||||
| Item | Value |
|
||||
| --- | --- |
|
||||
| Operation | `resetWordList(): tuple[Level, ...]` |
|
||||
| Traces to | `resetWordList` in [SSD-001] |
|
||||
| Domain Model concepts | Words To Learn, Word List ([DM-001]); IT terms `Deck`, `Vocabulary` ([DICT-001]) |
|
||||
|
||||
**Preconditions**
|
||||
|
||||
- A word list is in use and the Learner confirmed.
|
||||
|
||||
**Postconditions**
|
||||
|
||||
- The progress file of the word list in use does not exist; the word list file and the progress files of other word lists are unchanged.
|
||||
- The `StudySession` was dropped and the levels are returned; the next session starts from a `Deck` of the whole `Vocabulary`.
|
||||
|
||||
**Exceptions**
|
||||
|
||||
| Condition (failing precondition) | Outcome |
|
||||
| --- | --- |
|
||||
| The progress file does not exist | Nothing is deleted and no error is raised |
|
||||
| The progress file cannot be deleted (`OSError`) | The error is logged and shown to the Learner; the earlier session stays |
|
||||
|
||||
## Contract: showContact
|
||||
|
||||
| Item | Value |
|
||||
| --- | --- |
|
||||
| Operation | `showContact(): tuple[str, str, str]` |
|
||||
| Traces to | `showContact` in [SSD-001] |
|
||||
| Domain Model concepts | none (author information, outside the domain) |
|
||||
|
||||
**Preconditions**
|
||||
|
||||
- None.
|
||||
|
||||
**Postconditions**
|
||||
|
||||
- The name, the title and the link of the author are returned and the link was opened in the web browser.
|
||||
|
||||
**Exceptions**
|
||||
|
||||
| Condition (failing precondition) | Outcome |
|
||||
| --- | --- |
|
||||
| No web browser can be started | The failure is logged; nothing else changes |
|
||||
|
||||
## Contract: exit
|
||||
|
||||
| Item | Value |
|
||||
| --- | --- |
|
||||
| Operation | `exit(): None` |
|
||||
| Traces to | `exit` in [SSD-001] |
|
||||
| Domain Model concepts | Study Session ([DM-001]); IT term `StudySession` ([DICT-001]) |
|
||||
|
||||
**Preconditions**
|
||||
|
||||
- None.
|
||||
|
||||
**Postconditions**
|
||||
|
||||
- The pending flip timer was cancelled, the window was closed and the program ended with exit code 0; the progress file is as it was after the last `markKnown`.
|
||||
|
||||
**Exceptions**
|
||||
|
||||
| Condition (failing precondition) | Outcome |
|
||||
| --- | --- |
|
||||
| None | – |
|
||||
|
||||
## Contract: markUnknown
|
||||
|
||||
| Item | Value |
|
||||
@@ -124,5 +237,5 @@ The turn-over of the card after 3000 ms is started by the system's own timer, no
|
||||
[DM-001]: ../domain-model.md
|
||||
[DICT-001]: ../dictionary.md
|
||||
[SD-001]: ./sd.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
+89
-3
@@ -9,8 +9,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the sequences startStudySession (levels) and chooseLevel (level filter) | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the sequences startStudySession (levels) and chooseLevel (level filter) | [0b983b7] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the sequences openWordList and resetWordList | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
@@ -109,6 +109,92 @@ deactivate S
|
||||
|
||||
The composition root only wires; the level selects, the deck holds, the session coordinates; no object receives all messages.
|
||||
|
||||
## Sequence: openWordList
|
||||
|
||||
**Realizes:** `openWordList` in [OC-001]
|
||||
|
||||
### Diagram
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
participant ":MenuView" as V
|
||||
participant ":Application" as A
|
||||
participant ":CsvVocabularyRepository" as VR
|
||||
V -> A : open_word_list(path)
|
||||
activate A
|
||||
create VR
|
||||
A -> VR : create(path)
|
||||
A -> VR : load()
|
||||
alt file is a word list
|
||||
VR --> A : vocabulary
|
||||
A -> A : drop session, use progress file of path
|
||||
A --> V : levels
|
||||
else file is refused
|
||||
VR --> A : VocabularyError
|
||||
A --> V : message, earlier list stays
|
||||
end
|
||||
deactivate A
|
||||
@enduml
|
||||
```
|
||||
|
||||
### Pattern Annotations
|
||||
|
||||
| Pattern (GRASP / GoF) | Applied to | Rationale |
|
||||
| --- | --- | --- |
|
||||
| Controller | `Application` | Receives the menu command and coordinates the repositories and the session |
|
||||
| Repository | `CsvVocabularyRepository` | The file format stays in the adapter |
|
||||
|
||||
### Postcondition Coverage
|
||||
|
||||
| Postcondition (from contract) | Satisfied by message |
|
||||
| --- | --- |
|
||||
| The vocabulary and the progress file of `path` are in use | `load()`, `use progress file of path` |
|
||||
| The earlier session was dropped and the levels are returned | `drop session`, `levels` |
|
||||
| A refused file leaves everything as it was | the `else` branch |
|
||||
|
||||
### Responsibility Check
|
||||
|
||||
The view forwards the command; the application validates through the repository before it replaces anything.
|
||||
|
||||
## Sequence: resetWordList
|
||||
|
||||
**Realizes:** `resetWordList` in [OC-001]
|
||||
|
||||
### Diagram
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
participant ":MenuView" as V
|
||||
participant ":Application" as A
|
||||
participant ":CsvProgressRepository" as PR
|
||||
V -> A : reset_word_list()
|
||||
activate A
|
||||
A -> PR : reset()
|
||||
PR --> A : done
|
||||
A -> A : drop session
|
||||
A --> V : levels
|
||||
deactivate A
|
||||
@enduml
|
||||
```
|
||||
|
||||
### Pattern Annotations
|
||||
|
||||
| Pattern (GRASP / GoF) | Applied to | Rationale |
|
||||
| --- | --- | --- |
|
||||
| Controller | `Application` | Sequences the reset and the return to the level screen |
|
||||
| Repository | `CsvProgressRepository` | Knows where the progress file is |
|
||||
|
||||
### Postcondition Coverage
|
||||
|
||||
| Postcondition (from contract) | Satisfied by message |
|
||||
| --- | --- |
|
||||
| The progress file of the word list in use does not exist | `reset()` |
|
||||
| The session was dropped and the levels are returned | `drop session`, `levels` |
|
||||
|
||||
### Responsibility Check
|
||||
|
||||
The confirmation is asked by the view before `reset_word_list` is called; the repository deletes only its own file.
|
||||
|
||||
## Sequence: markKnown
|
||||
|
||||
**Realizes:** `markKnown` in [OC-001]
|
||||
@@ -209,5 +295,5 @@ Same as `markKnown`; the session is the only object that speaks and draws.
|
||||
[OC-001]: ./oc.md
|
||||
[DCD-001]: ../dcd.md
|
||||
[DICT-001]: ../dictionary.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
+17
-3
@@ -11,8 +11,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added chooseLevel; startStudySession returns the levels | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added chooseLevel; startStudySession returns the levels | [0b983b7] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the menu operations | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
@@ -36,6 +36,15 @@ L -> S : markKnown()
|
||||
S --> L : next card (word, language name)
|
||||
L -> S : markUnknown()
|
||||
S --> L : next card (word, language name)
|
||||
L -> S : openWordList(path)
|
||||
S --> L : levels, or the reason the file is refused
|
||||
L -> S : changeLevel()
|
||||
S --> L : levels
|
||||
L -> S : resetWordList()
|
||||
S --> L : levels
|
||||
L -> S : showContact()
|
||||
S --> L : name, title, link opened
|
||||
L -> S : exit()
|
||||
@enduml
|
||||
```
|
||||
|
||||
@@ -48,6 +57,11 @@ S --> L : next card (word, language name)
|
||||
| 3 | (timer) turn the card over | none | the same card, translation side | 6 |
|
||||
| 4 | markKnown | none | next card, or "nothing left to learn" | 7, 8, 9 |
|
||||
| 5 | markUnknown | none | next card, or "nothing left to learn" | 7a, 9 |
|
||||
| 6 | openWordList | path of a CSV file | the levels, or the reason the file is refused | *a.1 |
|
||||
| 7 | changeLevel | none | the levels | *a.2 |
|
||||
| 8 | resetWordList | none (the Learner confirmed) | the levels | *a.3 |
|
||||
| 9 | showContact | none | the author's name and title; the link is opened | *a.4 |
|
||||
| 10 | exit | none | none; the program ends | *a.5 |
|
||||
|
||||
The turn-over in step 3 is started by the system's own timer, not by a message from the Learner; it is shown as a return without a call, which is the one deviation from "every return answers a message". When the level is given at start (extension 3a of [UC-001]) the Learner's first message is `chooseLevel` and `startStudySession` is not sent.
|
||||
|
||||
@@ -64,5 +78,5 @@ The system instance lives for one run of the program. The words to learn are cre
|
||||
[UC-001]: ./uc.md
|
||||
[DM-001]: ../domain-model.md
|
||||
[OC-001]: ./oc.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
+10
-3
@@ -11,8 +11,8 @@
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the choice of level (US-001.06) | [0b983b7] |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the choice of level (US-001.06) | [0b983b7] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added the menu commands as an extension (US-001.09 to US-001.12) | [2211d0f] |
|
||||
|
||||
---
|
||||
|
||||
@@ -59,6 +59,12 @@
|
||||
1. The system tells the Learner that there is nothing left to learn at this level, and further answers change nothing.
|
||||
- 4a. The kept progress or the word list is unreadable:
|
||||
1. The system reports the problem to the Learner and ends; it does not overwrite the kept progress.
|
||||
- *a. At any time the Learner uses a menu command:
|
||||
1. Open a word list: the system asks for a file and checks it; when it is a word list, the system replaces the word list in use and goes on at step 2; when it is not, the system tells the Learner why and keeps the word list in use. When the Learner cancels nothing changes.
|
||||
2. Change level: the system goes on at step 2 with the word list in use; the kept progress stays.
|
||||
3. Reset word list: the system asks the Learner to confirm; on yes it removes the kept progress of the word list in use and goes on at step 2, so all its words are to learn again; on no nothing changes.
|
||||
4. Contact: the system shows the author's name and title and opens the author's LinkedIn page in the web browser.
|
||||
5. Exit: the system ends the program.
|
||||
|
||||
### Special Requirements / Business Rules
|
||||
|
||||
@@ -70,6 +76,7 @@
|
||||
| 6 | The turn-over comes three seconds after the card appears |
|
||||
| 8 | A word is identified by its Malay and Danish text; the first equal word is removed; known words stay known at every level and words outside the level are kept |
|
||||
| 4 | The word list names its two languages and holds one word and one translation per card |
|
||||
| *a | The kept progress of each word list is separate; resetting one word list never changes another word list or the word list itself |
|
||||
|
||||
### Open Issues
|
||||
|
||||
@@ -83,5 +90,5 @@
|
||||
[SA-001]: ../stakeholder-analysis.md
|
||||
[DM-001]: ../domain-model.md
|
||||
[SSD-001]: ./ssd.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
|
||||
@@ -60,3 +60,27 @@ The Product Owner gave this screen in the first prompt (the course's target scre
|
||||
| Front (first 3000 ms) | `card_front.png` | Malay | the Malay word | black |
|
||||
| Back (after 3000 ms) | `card_back.png` | Danish | the Danish translation | white |
|
||||
| Finished | `card_front.png` | (empty) | "Nothing left to learn" | black |
|
||||
|
||||
## Menu bar and dialogs (all screens)
|
||||
|
||||
```text
|
||||
+----------------------------------------------------------+
|
||||
| File About | classic menu bar of the window
|
||||
+----------------------------------------------------------+
|
||||
File About
|
||||
+------------------------+ +-----------------------------------------------+
|
||||
| Open... | | Contact > |
|
||||
| Change level... | | +-----------------------------------------+|
|
||||
| Reset word list... | | | Jens Tirsvad Nielsen, Software engineer ||
|
||||
| ---------------------- | | | (LinkedIn) ||
|
||||
| Exit | | +-----------------------------------------+|
|
||||
+------------------------+ +-----------------------------------------------+
|
||||
```
|
||||
|
||||
| Element | Behaviour |
|
||||
| --- | --- |
|
||||
| File, Open... | Standard file dialog for `*.csv` (all files allowed), starting in the data folder; a refused file shows an error message with the reason |
|
||||
| File, Change level... | Replaces the screen by Screen 1 |
|
||||
| File, Reset word list... | Question "Start `<name>` from the beginning? All words will be to learn again." with Yes and No; Yes replaces the screen by Screen 1 |
|
||||
| File, Exit | Closes the window |
|
||||
| About, Contact, the author entry | Opens https://www.linkedin.com/in/tirsvad74 in the web browser |
|
||||
|
||||
+94
-7
@@ -4,21 +4,21 @@
|
||||
| Key | Value |
|
||||
| --- | --- |
|
||||
| ID | US-001 |
|
||||
| CrossReference | [UCD-001], [BC-001], [UC-001], [MIL-002], [MIL-003], [MIL-004], [MIL-005], [MIL-006], [MIL-008] |
|
||||
| CrossReference | [UCD-001], [BC-001], [UC-001], [MIL-002], [MIL-003], [MIL-004], [MIL-005], [MIL-006], [MIL-008], [MIL-009], [MIL-010], [MIL-011] |
|
||||
| Language | en |
|
||||
| Domain | it |
|
||||
|
||||
## Version History
|
||||
| Date | Status | Author | Reviewer | Change | Commit |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 2026-10-14 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [c3fbcbc] |
|
||||
| 2026-10-14 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added US-001.06 Choose my level | [0b983b7] |
|
||||
| 2026-10-15 | Deprecated | Jens Tirsvad Nielsen | AI as stand-in for S01 | Added US-001.09 to US-001.12 (menu bar) | [2211d0f] |
|
||||
| 2026-10-15 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | US-001.08 names the latest release instead of v0.1.0 | [0264b60] |
|
||||
|
||||
---
|
||||
|
||||
## Purpose and Scope
|
||||
|
||||
These stories cover the epic "Study Flash Cards": the four steps of the course assignment (the window, new cards, flipping the cards, saving progress), the spoken Malay word and the choice of level. Each story is delivered by one milestone. The wireframe the stories follow is in `docs/uc-001/wireframe.md`.
|
||||
These stories cover the epic "Study Flash Cards": the four steps of the course assignment (the window, new cards, flipping the cards, saving progress), the spoken Malay word the choice of level the start without an installed Python the download of the executable from a release and the menu bar. Each story is delivered by one milestone. The wireframe the stories follow is in `docs/uc-001/wireframe.md`.
|
||||
|
||||
## Story List
|
||||
|
||||
@@ -105,9 +105,93 @@ These stories cover the epic "Study Flash Cards": the four steps of the course a
|
||||
| --- | --- | --- |
|
||||
| [MIL-008], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.07 — Start without Python
|
||||
|
||||
**As a** Learner, **I want** to start the program by opening one executable file, **so that** I can learn without installing Python or a virtual environment.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given the executable was built, when I open it on a Windows computer without Python, then the level screen appears and no console window opens.
|
||||
- Given I mark a word as known in the executable, when I open it again, then the known word does not come up (my progress is kept in `data/words_to_learn.csv` next to the executable).
|
||||
- Given a `data/ms-da.csv` exists next to the executable, when the program starts, then that word list is used; otherwise the word list inside the executable is used.
|
||||
- Given the speech extra was included in the build and a network is available, when a card is shown, then the Malay word is spoken; without a network the program works silently.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-009], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.08 — Download the executable
|
||||
|
||||
**As a** Learner, **I want** to download the executable from a release page of the repository, **so that** I can use the program without building it.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given a release exists (for example `v0.2.0`), when I open the releases page of the repository, then I find release notes and, when the git host accepts the upload, `flash-card.exe` and a checksum file attached to it.
|
||||
- Given I downloaded `flash-card.exe`, when I compute its SHA-256 hash, then it equals the value in the checksum file and in the release notes.
|
||||
- Given I read the release notes, when I look for what the file is, then they say that it is an unsigned Windows build, what the `data` folder next to it holds, and how to build it myself.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-010], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.09 — Open another word list
|
||||
|
||||
**As a** Learner, **I want** to open another word list from a CSV file with the File menu, **so that** I can learn another language pair than the one delivered.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given the program is running, when I choose File, Open, then a file dialog lets me pick a CSV file that starts in the data folder.
|
||||
- Given I picked a valid word list, when the dialog closes, then I choose a level and the cards come from that list, and my progress in it is kept apart from the progress in other lists.
|
||||
- Given I picked a file that is not a word list (no header of two language codes, or a row that is not two cells), when the dialog closes, then a message names the problem and the earlier word list stays in use.
|
||||
- Given I cancel the dialog, when it closes, then nothing changes.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-011], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.10 — Change the level while learning
|
||||
|
||||
**As a** Learner, **I want** to change the level from the File menu, **so that** I do not have to restart the program to make the word list easier or harder.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given a card is shown, when I choose File, Change level, then I see the level choices again.
|
||||
- Given I choose a level, when the cards continue, then they come from that level and the words I know stay known.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-011], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.11 — Learn a word list from the start again
|
||||
|
||||
**As a** Learner, **I want** to reset the current word list from the File menu, **so that** all its words are to learn again.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given a word list is open, when I choose File, Reset word list, then I am asked to confirm and the message names the word list.
|
||||
- Given I confirm, when the reset is done, then the progress of that word list is gone, all its words are to learn again and the level choice is shown; the progress of other word lists and the word list file itself are not changed.
|
||||
- Given I do not confirm, when the question closes, then nothing changes.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-011], [UC-001] | fits one iteration | none |
|
||||
|
||||
### US-001.12 — Find the author and leave the program
|
||||
|
||||
**As a** Learner, **I want** an About menu with the author's contact and a File, Exit command, **so that** I can reach the author and close the program in the usual way.
|
||||
|
||||
**Acceptance Criteria**
|
||||
|
||||
- Given the program is running, when I choose About, Contact, then I see an entry with the author's name and title (Jens Tirsvad Nielsen, Software engineer) and, when I choose it, the author's LinkedIn page opens in my web browser.
|
||||
- Given the program is running, when I choose File, Exit, then the window closes and the program ends.
|
||||
|
||||
| Traces to | Size | INVEST exceptions |
|
||||
| --- | --- | --- |
|
||||
| [MIL-011], [UC-001] | fits one iteration | none |
|
||||
|
||||
## INVEST Check
|
||||
|
||||
All six stories are Independent in delivery order (each builds on the one before but can be accepted alone), Negotiable in wording, Valuable to the Learner, Estimable, Small (one milestone each) and Testable (every criterion is Given/When/Then). Exception: US-001.02 to US-001.06 depend on the window of US-001.01, which is stated in their milestones' Dependencies.
|
||||
All twelve stories are Independent in delivery order (each builds on the one before but can be accepted alone), Negotiable in wording, Valuable to the Learner, Estimable, Small (one milestone each) and Testable (every criterion is Given/When/Then). Exception: US-001.02 to US-001.12 depend on the window of US-001.01, which is stated in their milestones' Dependencies.
|
||||
|
||||
---
|
||||
|
||||
@@ -120,5 +204,8 @@ All six stories are Independent in delivery order (each builds on the one before
|
||||
[MIL-005]: ./milestones/mil-005-step4-save-progress.md
|
||||
[MIL-006]: ./milestones/mil-006-malay-speech.md
|
||||
[MIL-008]: ./milestones/mil-008-choose-level.md
|
||||
[c3fbcbc]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/c3fbcbcfaf799e0ae34aed7e14d3bc8a62f03db3
|
||||
[0b983b7]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0b983b7fdadf6958717c1d0227d0f2ebe037f7b1
|
||||
[MIL-009]: ./milestones/mil-009-executable.md
|
||||
[MIL-010]: ./milestones/mil-010-release.md
|
||||
[MIL-011]: ./milestones/mil-011-menu-bar.md
|
||||
[2211d0f]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/2211d0f4cbd8182314d18cbdefd939ae50c39e6d
|
||||
[0264b60]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/commit/0264b6084f26bac5af716ea71596ce3be961fec8
|
||||
|
||||
@@ -6,7 +6,7 @@ Programmet er bygget i fire lag under `src/flash_card/`. Importer peger indad; `
|
||||
|
||||
| Lag | Indeholder | Må importere |
|
||||
| --- | --- | --- |
|
||||
| `domain` | `Card`, `LanguagePair`, `Vocabulary`, `Deck`, fejlene og repository-grænsefladerne | ingenting |
|
||||
| `domain` | `Card`, `LanguagePair`, `Level`, `Vocabulary`, `Deck`, fejlene og repository-grænsefladerne | ingenting |
|
||||
| `application` | `StudySession`, `open_study_session`, `CardDto` og `SpeechPort` | `domain` |
|
||||
| `infrastructure` | CSV-repositories og tale-adaptere | `application`, `domain` |
|
||||
| `presentation` | `FlashCardView`, `FlashCardViewModel` (MVVM) og kompositionsroden `app.py` | alle lag |
|
||||
@@ -21,6 +21,7 @@ Alle konstanter står i `src/flash_card/constants.py`.
|
||||
| Trin 2: læs CSV, tilfældigt ord ved hvert tryk | `CsvVocabularyRepository` og `read_word_list` (erstatter `pandas`), `Deck.draw`, `StudySession.next_card`, `FlashCardView.next_card` |
|
||||
| Trin 3: vend efter 3 sekunder | `FlashCardView.flip_card`, `FlashCardView.flip_timer` (`after`, `after_cancel`), `FlashCardViewModel.flip_card` |
|
||||
| Trin 4: kendte ord, `words_to_learn.csv` | `FlashCardView.is_known`, `StudySession.mark_known`, `CsvProgressRepository`, `open_study_session` |
|
||||
| Ekstra: niveauvalg | `Level`, `Deck.within`, `StudySession.next_card`, `open_study_session`, `LevelView`, `LevelViewModel`, `Application.start` i `presentation/app.py` |
|
||||
| Ekstra: tale | `SpeechPort`, `GttsSpeech`, `NullSpeech`, `build_speech` i `presentation/app.py` |
|
||||
|
||||
## Hvorfor en lagdelt løsning til en lille opgave?
|
||||
|
||||
@@ -6,7 +6,7 @@ Program dibina dalam empat lapisan di bawah `src/flash_card/`. Import menuju ke
|
||||
|
||||
| Lapisan | Mengandungi | Boleh mengimport |
|
||||
| --- | --- | --- |
|
||||
| `domain` | `Card`, `LanguagePair`, `Vocabulary`, `Deck`, ralat dan antara muka repositori | tiada |
|
||||
| `domain` | `Card`, `LanguagePair`, `Level`, `Vocabulary`, `Deck`, ralat dan antara muka repositori | tiada |
|
||||
| `application` | `StudySession`, `open_study_session`, `CardDto` dan `SpeechPort` | `domain` |
|
||||
| `infrastructure` | Repositori CSV dan penyesuai suara | `application`, `domain` |
|
||||
| `presentation` | `FlashCardView`, `FlashCardViewModel` (MVVM) dan akar komposisi `app.py` | semua lapisan |
|
||||
@@ -21,6 +21,7 @@ Semua pemalar terdapat dalam `src/flash_card/constants.py`.
|
||||
| Langkah 2: baca CSV, perkataan rawak setiap tekanan | `CsvVocabularyRepository` dan `read_word_list` (menggantikan `pandas`), `Deck.draw`, `StudySession.next_card`, `FlashCardView.next_card` |
|
||||
| Langkah 3: terbalik selepas 3 saat | `FlashCardView.flip_card`, `FlashCardView.flip_timer` (`after`, `after_cancel`), `FlashCardViewModel.flip_card` |
|
||||
| Langkah 4: perkataan diketahui, `words_to_learn.csv` | `FlashCardView.is_known`, `StudySession.mark_known`, `CsvProgressRepository`, `open_study_session` |
|
||||
| Tambahan: pilihan tahap | `Level`, `Deck.within`, `StudySession.next_card`, `open_study_session`, `LevelView`, `LevelViewModel`, `Application.start` dalam `presentation/app.py` |
|
||||
| Tambahan: suara | `SpeechPort`, `GttsSpeech`, `NullSpeech`, `build_speech` dalam `presentation/app.py` |
|
||||
|
||||
## Mengapa program berlapis untuk tugasan kecil?
|
||||
|
||||
@@ -6,7 +6,7 @@ The program is built in four layers under `src/flash_card/`. Imports point inwar
|
||||
|
||||
| Layer | Holds | May import |
|
||||
| --- | --- | --- |
|
||||
| `domain` | `Card`, `LanguagePair`, `Vocabulary`, `Deck`, the errors and the repository interfaces | nothing |
|
||||
| `domain` | `Card`, `LanguagePair`, `Level`, `Vocabulary`, `Deck`, the errors and the repository interfaces | nothing |
|
||||
| `application` | `StudySession`, `open_study_session`, `CardDto` and `SpeechPort` | `domain` |
|
||||
| `infrastructure` | The CSV repositories and the speech adapters | `application`, `domain` |
|
||||
| `presentation` | `FlashCardView`, `FlashCardViewModel` (MVVM) and the composition root `app.py` | all layers |
|
||||
@@ -21,6 +21,7 @@ All constants are in `src/flash_card/constants.py`.
|
||||
| Step 2: read the CSV, random word on each press | `CsvVocabularyRepository` and `read_word_list` (replace `pandas`), `Deck.draw`, `StudySession.next_card`, `FlashCardView.next_card` |
|
||||
| Step 3: flip after 3 seconds | `FlashCardView.flip_card`, `FlashCardView.flip_timer` (`after`, `after_cancel`), `FlashCardViewModel.flip_card` |
|
||||
| Step 4: known words, `words_to_learn.csv` | `FlashCardView.is_known`, `StudySession.mark_known`, `CsvProgressRepository`, `open_study_session` |
|
||||
| Extra: level choice | `Level`, `Deck.within`, `StudySession.next_card`, `open_study_session`, `LevelView`, `LevelViewModel`, `Application.start` in `presentation/app.py` |
|
||||
| Extra: speech | `SpeechPort`, `GttsSpeech`, `NullSpeech`, `build_speech` in `presentation/app.py` |
|
||||
|
||||
## Why a layered program for a small assignment?
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
Et flashkortprogram til at lære de mest almindelige malajiske ord med danske oversættelser. Det er løsningen på dag 31 i Udemys kursus *100 Days of Code: The Complete Python Pro Bootcamp*.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
@@ -22,6 +23,7 @@ Et flashkortprogram til at lære de mest almindelige malajiske ord med danske ov
|
||||
| 3. Vend kortene | Efter 3 sekunder viser kortet den danske oversættelse | MIL-004 |
|
||||
| 4. Gem din fremgang | Kendte ord fjernes, og resten gemmes i `words_to_learn.csv` | MIL-005 |
|
||||
| Ekstra | Det malajiske ord bliver udtalt (valgfrit) | MIL-006 |
|
||||
| Ekstra | Du vælger først et niveau: de første 100 ord, de første 1000 ord eller alle ord | MIL-008 |
|
||||
|
||||
## Til kursister
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
Program kad imbas untuk mempelajari perkataan Melayu yang paling kerap digunakan beserta terjemahan Denmark. Ia ialah penyelesaian hari ke-31 kursus Udemy *100 Days of Code: The Complete Python Pro Bootcamp*.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
@@ -22,6 +23,7 @@ Program kad imbas untuk mempelajari perkataan Melayu yang paling kerap digunakan
|
||||
| 3. Terbalikkan kad | Selepas 3 saat kad menunjukkan terjemahan Denmark | MIL-004 |
|
||||
| 4. Simpan kemajuan anda | Perkataan yang diketahui dibuang dan selebihnya disimpan dalam `words_to_learn.csv` | MIL-005 |
|
||||
| Tambahan | Perkataan Melayu disebut (pilihan) | MIL-006 |
|
||||
| Tambahan | Anda memilih tahap dahulu: 100 perkataan pertama, 1000 perkataan pertama atau semua perkataan | MIL-008 |
|
||||
|
||||
## Untuk peserta kursus
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
A flash card program for learning the most frequent Malay words with their Danish translations. It is the solution of day 31 of Udemy's *100 Days of Code: The Complete Python Pro Bootcamp*.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
@@ -22,6 +23,7 @@ A flash card program for learning the most frequent Malay words with their Danis
|
||||
| 3. Flip the cards | After 3 seconds the card shows the Danish translation | MIL-004 |
|
||||
| 4. Save your progress | Known words are removed and the rest is saved in `words_to_learn.csv` | MIL-005 |
|
||||
| Extra | The Malay word is spoken (optional) | MIL-006 |
|
||||
| Extra | You choose a level first: the first 100 words, the first 1000 words or all words | MIL-008 |
|
||||
|
||||
## For course participants
|
||||
|
||||
|
||||
@@ -56,6 +56,24 @@ python -m pytest
|
||||
|
||||
Vinduestesten i `tests/e2e/` springes over, når der ikke er en skærm.
|
||||
|
||||
## Udgivelse og programfil (Windows)
|
||||
|
||||
[Udgivelsessiden](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases/tag/v0.1.0) for v0.1.0 har udgivelsesnoterne. Programfilen er endnu ikke vedhæftet, fordi serverens grænse for upload afviser en fil af denne størrelse (HTTP 413); byg den som beskrevet nedenfor. Filen er ikke signeret, så Windows kan vise en SmartScreen-advarsel.
|
||||
|
||||
## Byg en programfil (Windows)
|
||||
|
||||
```powershell
|
||||
python -m pip install -e ".[build,speech]"
|
||||
python tools/build_executable.py
|
||||
```
|
||||
|
||||
Scriptet bruger PyInstaller og skriver `dist/flash-card.exe`: én fil uden konsolvindue, med billeder, ordliste og udtalen indeni. Dobbeltklik for at starte; Python er ikke nødvendigt for at køre den.
|
||||
|
||||
- Din fremgang gemmes i en `data/`-mappe ved siden af programfilen (`data/words_to_learn.csv`).
|
||||
- En `data/ms-da.csv` ved siden af programfilen erstatter ordlisten indeni.
|
||||
- `python tools/build_executable.py --no-speech` udelader talepakkerne; `--clean` bygger forfra.
|
||||
- Programfilen er ikke i repositoryet. Byg den på det system, hvor den skal køre; Windows kan vise en SmartScreen-advarsel, fordi filen ikke er signeret.
|
||||
|
||||
## Dokumentation af kildekoden
|
||||
|
||||
```bash
|
||||
|
||||
@@ -56,6 +56,24 @@ python -m pytest
|
||||
|
||||
Ujian tetingkap dalam `tests/e2e/` dilangkau apabila tiada paparan.
|
||||
|
||||
## Keluaran dan fail boleh laku (Windows)
|
||||
|
||||
[Halaman keluaran](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases/tag/v0.1.0) v0.1.0 mempunyai nota keluaran. Fail boleh laku belum dilampirkan di sana kerana had muat naik pelayan menolak fail sebesar ini (HTTP 413); bina seperti yang diterangkan di bawah. Fail tidak ditandatangani, jadi Windows mungkin menunjukkan amaran SmartScreen.
|
||||
|
||||
## Bina fail boleh laku (Windows)
|
||||
|
||||
```powershell
|
||||
python -m pip install -e ".[build,speech]"
|
||||
python tools/build_executable.py
|
||||
```
|
||||
|
||||
Skrip menggunakan PyInstaller dan menulis `dist/flash-card.exe`: satu fail tanpa tetingkap konsol, dengan imej, senarai perkataan dan suara di dalamnya. Klik dua kali untuk memulakan; Python tidak diperlukan untuk menjalankannya.
|
||||
|
||||
- Kemajuan anda disimpan dalam folder `data/` di sebelah fail boleh laku (`data/words_to_learn.csv`).
|
||||
- `data/ms-da.csv` di sebelah fail boleh laku menggantikan senarai perkataan di dalamnya.
|
||||
- `python tools/build_executable.py --no-speech` meninggalkan pakej suara; `--clean` membina semula dari awal.
|
||||
- Fail boleh laku tidak disimpan dalam repositori. Bina di sistem tempat ia akan dijalankan; Windows mungkin menunjukkan amaran SmartScreen kerana fail tidak ditandatangani.
|
||||
|
||||
## Dokumentasi kod sumber
|
||||
|
||||
```bash
|
||||
|
||||
@@ -56,6 +56,24 @@ python -m pytest
|
||||
|
||||
The window test in `tests/e2e/` is skipped when no display is available.
|
||||
|
||||
## Release and executable (Windows)
|
||||
|
||||
The [release page](https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/031-flash-card/releases/tag/v0.1.0) of v0.1.0 has the release notes. The executable is not attached there yet, because the server's upload limit rejects a file of this size (HTTP 413); build it as described below. The file is not signed, so Windows may show a SmartScreen warning.
|
||||
|
||||
## Build an executable (Windows)
|
||||
|
||||
```powershell
|
||||
python -m pip install -e ".[build,speech]"
|
||||
python tools/build_executable.py
|
||||
```
|
||||
|
||||
The script uses PyInstaller and writes `dist/flash-card.exe`: one file, no console window, with the images, the word list and the spoken word inside. Double-click it to start; Python is not needed to run it.
|
||||
|
||||
- Your progress is kept in a `data/` folder next to the executable (`data/words_to_learn.csv`).
|
||||
- A `data/ms-da.csv` next to the executable replaces the word list inside it.
|
||||
- `python tools/build_executable.py --no-speech` leaves the speech packages out; `--clean` rebuilds from scratch.
|
||||
- The executable is not committed to the repository. Build it on the system you want to run it on; Windows may show a SmartScreen warning because the file is not signed.
|
||||
|
||||
## Documentation of the source code
|
||||
|
||||
```bash
|
||||
|
||||
+23
-5
@@ -5,12 +5,27 @@
|
||||
## Øv kortene
|
||||
|
||||
1. Start programmet med `python -m flash_card`.
|
||||
2. Et kort viser et malajisk ord. Prøv at huske den danske oversættelse.
|
||||
3. Efter tre sekunder vender kortet og viser oversættelsen.
|
||||
4. Tryk på det grønne flueben, hvis du kendte ordet, eller på det røde kryds, hvis du ikke gjorde.
|
||||
5. Et nyt tilfældigt ord vises. Gentag.
|
||||
2. Vælg et niveau: **100 words**, **1000 words** eller **All words**. Ordlisten er sorteret fra det hyppigste til det sjældneste ord, så niveau 100 er de 100 hyppigste ord.
|
||||
3. Et kort viser et malajisk ord. Prøv at huske den danske oversættelse.
|
||||
4. Efter tre sekunder vender kortet og viser oversættelsen.
|
||||
5. Tryk på det grønne flueben, hvis du kendte ordet, eller på det røde kryds, hvis du ikke gjorde.
|
||||
6. Et nyt tilfældigt ord fra niveauet vises. Gentag.
|
||||
|
||||
Et ord, du har markeret som kendt, fjernes og kommer ikke igen. Når der ikke er flere ord, står der "Nothing left to learn" på kortet.
|
||||
Et ord, du har markeret som kendt, fjernes og kommer ikke igen. Når der ikke er flere ord på niveauet, står der "Nothing left to learn" på kortet; start programmet igen og vælg et højere niveau.
|
||||
|
||||
## Menulinjen
|
||||
|
||||

|
||||
|
||||
| Menu | Kommando | Hvad den gør |
|
||||
| --- | --- | --- |
|
||||
| File | Open... | Åbner en anden ordliste fra en CSV-fil (overskrift med to sprogkoder, fx `en;da`). Fremgang gemmes adskilt for hver liste |
|
||||
| File | Change level... | Viser niveauvalget igen uden genstart; kendte ord forbliver kendte |
|
||||
| File | Reset word list... | Fjerner efter en bekræftelse fremgangen for den åbne liste, så alle dens ord skal læres igen; listefilen ændres ikke |
|
||||
| File | Exit | Lukker programmet |
|
||||
| About | Contact | Forfatteren, Jens Tirsvad Nielsen, softwareudvikler; åbner LinkedIn-siden i din browser |
|
||||
|
||||
Fremgangen for den medfølgende `ms-da.csv` er `data/words_to_learn.csv`; en anden liste får `data/words_to_learn_<navn>.csv`. Den åbnede liste huskes ikke efter en genstart.
|
||||
|
||||
## Din fremgang
|
||||
|
||||
@@ -18,6 +33,8 @@ Et ord, du har markeret som kendt, fjernes og kommer ikke igen. Når der ikke er
|
||||
- Næste start bruger den fil. Findes den ikke, bruger programmet hele ordlisten `data/ms-da.csv`.
|
||||
- For at starte forfra skal du slette `data/words_to_learn.csv`.
|
||||
- Det røde kryds ændrer aldrig filen.
|
||||
- Kendte ord forbliver kendte på alle niveauer. Niveauet begrænser kun, hvilke af de ord, du endnu ikke kender, der kommer frem, og filen beholder altid alle ord, du ikke kender, også dem uden for niveauet.
|
||||
- Denne liste har 1000 ord, så "1000 words" og "All words" giver de samme kort.
|
||||
|
||||
## Filformat
|
||||
|
||||
@@ -34,6 +51,7 @@ yang;hvilke
|
||||
| Indstilling | Betydning |
|
||||
| --- | --- |
|
||||
| `--data-dir <mappe>` | Mappen med `ms-da.csv` og `words_to_learn.csv` (standard: `data/` i repositoryet) |
|
||||
| `--level {100,1000,all}` | Start på det niveau og spring niveauskærmen over |
|
||||
| `--no-speech` | Udtal ikke det malajiske ord, selv om tilvalget til tale er installeret |
|
||||
|
||||
## Brug et andet sprogpar
|
||||
|
||||
+23
-5
@@ -5,12 +5,27 @@
|
||||
## Berlatih dengan kad
|
||||
|
||||
1. Mulakan program dengan `python -m flash_card`.
|
||||
2. Kad menunjukkan satu perkataan Melayu. Cuba ingat terjemahan Denmarknya.
|
||||
3. Selepas tiga saat kad terbalik dan menunjukkan terjemahan.
|
||||
4. Tekan tanda semak hijau jika anda tahu perkataan itu, atau pangkah merah jika tidak.
|
||||
5. Satu perkataan rawak baharu muncul. Ulang.
|
||||
2. Pilih tahap: **100 words**, **1000 words** atau **All words**. Senarai perkataan disusun daripada perkataan paling kerap kepada paling jarang, jadi tahap 100 ialah 100 perkataan paling kerap.
|
||||
3. Kad menunjukkan satu perkataan Melayu. Cuba ingat terjemahan Denmarknya.
|
||||
4. Selepas tiga saat kad terbalik dan menunjukkan terjemahan.
|
||||
5. Tekan tanda semak hijau jika anda tahu perkataan itu, atau pangkah merah jika tidak.
|
||||
6. Satu perkataan rawak baharu daripada tahap itu muncul. Ulang.
|
||||
|
||||
Perkataan yang anda tandakan sebagai diketahui dibuang dan tidak muncul lagi. Apabila tiada perkataan lagi, kad menunjukkan "Nothing left to learn".
|
||||
Perkataan yang anda tandakan sebagai diketahui dibuang dan tidak muncul lagi. Apabila tiada perkataan lagi pada tahap itu, kad menunjukkan "Nothing left to learn"; mulakan program semula dan pilih tahap yang lebih tinggi.
|
||||
|
||||
## Bar menu
|
||||
|
||||

|
||||
|
||||
| Menu | Perintah | Apa yang dilakukan |
|
||||
| --- | --- | --- |
|
||||
| File | Open... | Membuka senarai perkataan lain daripada fail CSV (baris pertama dengan dua kod bahasa, contohnya `en;da`). Kemajuan disimpan berasingan bagi setiap senarai |
|
||||
| File | Change level... | Menunjukkan pilihan tahap semula tanpa memulakan semula; perkataan yang diketahui kekal diketahui |
|
||||
| File | Reset word list... | Selepas pengesahan membuang kemajuan senarai yang dibuka, supaya semua perkataannya perlu dipelajari semula; fail senarai tidak diubah |
|
||||
| File | Exit | Menutup program |
|
||||
| About | Contact | Pengarang, Jens Tirsvad Nielsen, jurutera perisian; membuka halaman LinkedIn dalam pelayar anda |
|
||||
|
||||
Kemajuan bagi `ms-da.csv` yang disertakan ialah `data/words_to_learn.csv`; senarai lain mendapat `data/words_to_learn_<nama>.csv`. Senarai yang dibuka tidak diingati selepas dimulakan semula.
|
||||
|
||||
## Kemajuan anda
|
||||
|
||||
@@ -18,6 +33,8 @@ Perkataan yang anda tandakan sebagai diketahui dibuang dan tidak muncul lagi. Ap
|
||||
- Permulaan seterusnya menggunakan fail itu. Jika ia tiada, program menggunakan senarai penuh `data/ms-da.csv`.
|
||||
- Untuk bermula semula, padam `data/words_to_learn.csv`.
|
||||
- Pangkah merah tidak pernah mengubah fail.
|
||||
- Perkataan yang diketahui kekal diketahui pada semua tahap. Tahap hanya mengehadkan perkataan yang belum anda ketahui yang muncul, dan fail sentiasa menyimpan semua perkataan yang anda belum tahu, termasuk yang di luar tahap.
|
||||
- Senarai ini mempunyai 1000 perkataan, jadi "1000 words" dan "All words" memberikan kad yang sama.
|
||||
|
||||
## Format fail
|
||||
|
||||
@@ -34,6 +51,7 @@ yang;hvilke
|
||||
| Pilihan | Maksud |
|
||||
| --- | --- |
|
||||
| `--data-dir <folder>` | Folder yang mengandungi `ms-da.csv` dan `words_to_learn.csv` (lalai: `data/` dalam repositori) |
|
||||
| `--level {100,1000,all}` | Mulakan pada tahap itu dan langkau skrin tahap |
|
||||
| `--no-speech` | Jangan sebut perkataan Melayu, walaupun tambahan suara dipasang |
|
||||
|
||||
## Gunakan pasangan bahasa lain
|
||||
|
||||
+23
-5
@@ -5,12 +5,27 @@
|
||||
## Study the cards
|
||||
|
||||
1. Start the program with `python -m flash_card`.
|
||||
2. A card shows a Malay word. Try to remember its Danish translation.
|
||||
3. After three seconds the card turns over and shows the translation.
|
||||
4. Press the green tick when you knew the word, or the red cross when you did not.
|
||||
5. A new random word appears. Repeat.
|
||||
2. Choose a level: **100 words**, **1000 words** or **All words**. The word list is ordered from the most to the least frequent word, so level 100 is the 100 most frequent words.
|
||||
3. A card shows a Malay word. Try to remember its Danish translation.
|
||||
4. After three seconds the card turns over and shows the translation.
|
||||
5. Press the green tick when you knew the word, or the red cross when you did not.
|
||||
6. A new random word of the level appears. Repeat.
|
||||
|
||||
A word you marked as known is removed and does not come up again. When no word is left, the card says "Nothing left to learn".
|
||||
A word you marked as known is removed and does not come up again. When no word of the level is left, the card says "Nothing left to learn"; restart the program and choose a higher level.
|
||||
|
||||
## The menu bar
|
||||
|
||||

|
||||
|
||||
| Menu | Command | What it does |
|
||||
| --- | --- | --- |
|
||||
| File | Open... | Opens another word list from a CSV file (header with two language codes, for example `en;da`). Progress is kept apart for each list |
|
||||
| File | Change level... | Shows the level choice again without a restart; known words stay known |
|
||||
| File | Reset word list... | After a confirmation removes the progress of the open list, so all its words are to learn again; the list file is not changed |
|
||||
| File | Exit | Closes the program |
|
||||
| About | Contact | The author, Jens Tirsvad Nielsen, Software engineer; opens the LinkedIn page in your browser |
|
||||
|
||||
The progress of the delivered `ms-da.csv` is `data/words_to_learn.csv`; another list gets `data/words_to_learn_<name>.csv`. The opened list is not remembered after a restart.
|
||||
|
||||
## Your progress
|
||||
|
||||
@@ -18,6 +33,8 @@ A word you marked as known is removed and does not come up again. When no word i
|
||||
- The next start uses that file. If it does not exist, the program uses the full word list `data/ms-da.csv`.
|
||||
- To start again, delete `data/words_to_learn.csv`.
|
||||
- The red cross never changes the file.
|
||||
- Known words stay known at every level. The level only limits which of the words you do not know yet come up, and the file always keeps every word you do not know, also those outside the level.
|
||||
- This list has 1000 words, so "1000 words" and "All words" give the same cards.
|
||||
|
||||
## File format
|
||||
|
||||
@@ -34,6 +51,7 @@ yang;hvilke
|
||||
| Option | Meaning |
|
||||
| --- | --- |
|
||||
| `--data-dir <folder>` | Folder that holds `ms-da.csv` and `words_to_learn.csv` (default: `data/` of the repository) |
|
||||
| `--level {100,1000,all}` | Start at that level and skip the level screen |
|
||||
| `--no-speech` | Do not speak the Malay word, even when the speech extra is installed |
|
||||
|
||||
## Use another language pair
|
||||
|
||||
+3
-1
@@ -26,6 +26,8 @@ dependencies = []
|
||||
speech = ["gTTS>=2.5", "playsound==1.2.2"]
|
||||
# Only for tools/capture_screenshots.py; not needed to run the program.
|
||||
tools = ["pillow>=10"]
|
||||
# Only for tools/build_executable.py; not needed to run the program.
|
||||
build = ["pyinstaller>=6"]
|
||||
dev = ["pytest>=8", "ruff>=0.6", "mypy>=1.11", "import-linter>=2.0"]
|
||||
|
||||
[project.scripts]
|
||||
@@ -35,7 +37,7 @@ flash-card = "flash_card.presentation.app:run"
|
||||
where = ["src"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
flash_card = ["presentation/assets/*.png"]
|
||||
flash_card = ["presentation/assets/*.png", "presentation/assets/*.ico"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
|
||||
@@ -12,6 +12,7 @@ from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.entities.deck import Deck
|
||||
from flash_card.domain.repositories.progress_repository import ProgressRepository
|
||||
from flash_card.domain.repositories.vocabulary_repository import VocabularyRepository
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
|
||||
|
||||
def open_study_session(
|
||||
@@ -19,18 +20,24 @@ def open_study_session(
|
||||
progress_repository: ProgressRepository,
|
||||
speech: SpeechPort,
|
||||
choose: Callable[[Sequence[Card]], Card],
|
||||
level: Level,
|
||||
) -> StudySession:
|
||||
"""Build a session over the saved words to learn, else the whole word list.
|
||||
|
||||
The word list is always loaded: its order defines which words a level holds.
|
||||
|
||||
@param vocabulary_repository Source of the delivered word list.
|
||||
@param progress_repository Store of the words still to learn.
|
||||
@param speech Speaks the front text of each drawn card.
|
||||
@param choose Picks one card from a non-empty sequence.
|
||||
@param level The level: the first words of the list that may be drawn.
|
||||
@return The new session.
|
||||
@throws VocabularyError When the saved progress, or the word list when no
|
||||
progress exists, cannot be loaded.
|
||||
@throws VocabularyError When the word list or the saved progress cannot be
|
||||
loaded.
|
||||
"""
|
||||
vocabulary = vocabulary_repository.load()
|
||||
deck = progress_repository.load()
|
||||
if deck is None:
|
||||
deck = Deck.from_vocabulary(vocabulary_repository.load())
|
||||
return StudySession(deck, choose, progress_repository, speech)
|
||||
deck = Deck.from_vocabulary(vocabulary)
|
||||
level_cards = level.first(vocabulary.cards)
|
||||
return StudySession(deck, choose, progress_repository, speech, level_cards)
|
||||
|
||||
@@ -22,6 +22,7 @@ class StudySession:
|
||||
choose: Callable[[Sequence[Card]], Card],
|
||||
progress: ProgressRepository,
|
||||
speech: SpeechPort,
|
||||
level_cards: Sequence[Card] | None = None,
|
||||
) -> None:
|
||||
"""Create a session.
|
||||
|
||||
@@ -29,7 +30,10 @@ class StudySession:
|
||||
@param choose Picks one card from a non-empty sequence.
|
||||
@param progress Store of the words still to learn.
|
||||
@param speech Speaks the front text of each drawn card.
|
||||
@param level_cards The cards of the chosen level, or None for no limit.
|
||||
"""
|
||||
## @brief The cards of the chosen level, or None for no limit.
|
||||
self._level_cards = None if level_cards is None else tuple(level_cards)
|
||||
## @brief Speaks the front text of each drawn card.
|
||||
self._speech = speech
|
||||
## @brief Store of the words still to learn.
|
||||
@@ -51,27 +55,36 @@ class StudySession:
|
||||
|
||||
@property
|
||||
def remaining(self) -> int:
|
||||
"""Return the number of cards still to learn.
|
||||
"""Return the number of cards still to learn, of every level.
|
||||
|
||||
@return The card count.
|
||||
"""
|
||||
return len(self._deck)
|
||||
|
||||
@property
|
||||
def remaining_in_level(self) -> int:
|
||||
"""Return the number of cards still to learn in the chosen level.
|
||||
|
||||
@return The card count.
|
||||
"""
|
||||
return len(self._candidates())
|
||||
|
||||
def next_card(self) -> CardDto | None:
|
||||
"""Draw the next card, different from the current one when possible.
|
||||
|
||||
@return The new card, or None when the deck is empty.
|
||||
@return The new card, or None when no card of the level is left.
|
||||
"""
|
||||
if self._deck.is_empty:
|
||||
candidates = self._candidates()
|
||||
if not candidates:
|
||||
self._current = None
|
||||
return None
|
||||
card = self._deck.draw(self._choose, exclude=self._current)
|
||||
card = self._deck.draw(self._choose, self._current, candidates)
|
||||
self._current = card
|
||||
self._speech.speak(card.front, self._deck.language_pair.front_code)
|
||||
return self._to_dto(card)
|
||||
|
||||
def mark_known(self) -> None:
|
||||
"""Remove the current card from the deck and save the remaining cards.
|
||||
"""Remove the current card from the whole deck and save the whole deck.
|
||||
|
||||
Does nothing and saves nothing when no card is shown.
|
||||
|
||||
@@ -83,6 +96,15 @@ class StudySession:
|
||||
self._progress.save(self._deck)
|
||||
self._current = None
|
||||
|
||||
def _candidates(self) -> tuple[Card, ...]:
|
||||
"""Return the cards that may be drawn.
|
||||
|
||||
@return The deck cards of the level, or all deck cards without a level.
|
||||
"""
|
||||
if self._level_cards is None:
|
||||
return self._deck.cards
|
||||
return self._deck.within(self._level_cards)
|
||||
|
||||
def _to_dto(self, card: Card | None) -> CardDto | None:
|
||||
"""Map a card to its DTO.
|
||||
|
||||
|
||||
+118
-5
@@ -9,6 +9,8 @@ from collections.abc import Mapping
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
from flash_card.runtime import executable_dir, is_frozen, resource_root
|
||||
|
||||
## @brief Window background colour.
|
||||
BACKGROUND_COLOR: Final[str] = "#B1DDC6"
|
||||
## @brief Window title.
|
||||
@@ -20,6 +22,8 @@ WINDOW_PADDING: Final[int] = 50
|
||||
CARD_WIDTH: Final[int] = 800
|
||||
## @brief Card height in pixels.
|
||||
CARD_HEIGHT: Final[int] = 526
|
||||
## @brief Level screen height in pixels: card plus the card window button row.
|
||||
LEVEL_SCREEN_HEIGHT: Final[int] = 526 + 100
|
||||
## @brief Horizontal centre of the card in pixels.
|
||||
CARD_CENTER_X: Final[int] = 400
|
||||
## @brief Vertical position of the language text in pixels.
|
||||
@@ -43,6 +47,29 @@ LANGUAGE_NAMES: Final[Mapping[str, str]] = {"ms": "Malay", "da": "Danish"}
|
||||
## @brief Message shown when no word is left to learn.
|
||||
FINISHED_MESSAGE: Final[str] = "Nothing left to learn"
|
||||
|
||||
## @brief Title of the level screen.
|
||||
LEVEL_TITLE: Final[str] = "Choose your level"
|
||||
## @brief Level choices in display order: label and word limit (None = all words).
|
||||
LEVEL_CHOICES: Final[tuple[tuple[str, int | None], ...]] = (
|
||||
("100 words", 100),
|
||||
("1000 words", 1000),
|
||||
("All words", None),
|
||||
)
|
||||
## @brief Values of the --level option and the word limit each stands for.
|
||||
LEVEL_ARGUMENT_VALUES: Final[Mapping[str, int | None]] = {
|
||||
"100": 100,
|
||||
"1000": 1000,
|
||||
"all": None,
|
||||
}
|
||||
## @brief Font of the level screen title: family, size, style.
|
||||
LEVEL_TITLE_FONT: Final[tuple[str, int, str]] = ("Arial", 40, "italic")
|
||||
## @brief Font of the level buttons: family, size, style.
|
||||
LEVEL_BUTTON_FONT: Final[tuple[str, int, str]] = ("Arial", 24, "bold")
|
||||
## @brief Width of every level button in characters.
|
||||
LEVEL_BUTTON_WIDTH: Final[int] = 14
|
||||
## @brief Background colour of the level buttons.
|
||||
LEVEL_BUTTON_COLOR: Final[str] = "white"
|
||||
|
||||
## @brief Delimiter of the CSV files.
|
||||
CSV_DELIMITER: Final[str] = ";"
|
||||
## @brief Encoding of the CSV files; drops a leading byte order mark.
|
||||
@@ -51,13 +78,31 @@ CSV_ENCODING: Final[str] = "utf-8-sig"
|
||||
VOCABULARY_FILE_NAME: Final[str] = "ms-da.csv"
|
||||
## @brief File name of the words still to learn.
|
||||
PROGRESS_FILE_NAME: Final[str] = "words_to_learn.csv"
|
||||
## @brief File name of the words to learn of another word list; {stem} is its stem.
|
||||
PROGRESS_FILE_NAME_TEMPLATE: Final[str] = "words_to_learn_{stem}.csv"
|
||||
## @brief Pattern of the characters replaced in a stem (not letter, digit, - or _).
|
||||
PROGRESS_STEM_FORBIDDEN: Final[str] = r"[^\w-]"
|
||||
## @brief Replacement of a forbidden character in the progress file name.
|
||||
PROGRESS_STEM_REPLACEMENT: Final[str] = "_"
|
||||
|
||||
## @brief Root folder of the project.
|
||||
## @brief Root folder of the project, for a source run.
|
||||
PROJECT_ROOT: Final[Path] = Path(__file__).resolve().parents[2]
|
||||
## @brief Default folder of the data files.
|
||||
DEFAULT_DATA_DIR: Final[Path] = PROJECT_ROOT / "data"
|
||||
## @brief Folder of the image assets.
|
||||
ASSETS_DIR: Final[Path] = Path(__file__).resolve().parent / "presentation" / "assets"
|
||||
## @brief Folder of the image assets, inside the bundle when frozen.
|
||||
ASSETS_DIR: Final[Path] = (
|
||||
resource_root() / "flash_card" / "presentation" / "assets"
|
||||
if is_frozen()
|
||||
else Path(__file__).resolve().parent / "presentation" / "assets"
|
||||
)
|
||||
## @brief Folder of the word list delivered with the program.
|
||||
BUNDLED_DATA_DIR: Final[Path] = resource_root() / "data"
|
||||
## @brief The word list delivered with the program.
|
||||
BUNDLED_VOCABULARY_PATH: Final[Path] = BUNDLED_DATA_DIR / VOCABULARY_FILE_NAME
|
||||
## @brief Default folder of the data files, next to the executable when frozen.
|
||||
DEFAULT_DATA_DIR: Final[Path] = executable_dir() / "data"
|
||||
## @brief File name of the program icon.
|
||||
ICON_FILE_NAME: Final[str] = "flash_card.ico"
|
||||
## @brief Name of the executable without extension.
|
||||
EXECUTABLE_NAME: Final[str] = "flash-card"
|
||||
## @brief File name of the card front image.
|
||||
CARD_FRONT_IMAGE_NAME: Final[str] = "card_front.png"
|
||||
## @brief File name of the card back image.
|
||||
@@ -66,3 +111,71 @@ CARD_BACK_IMAGE_NAME: Final[str] = "card_back.png"
|
||||
RIGHT_IMAGE_NAME: Final[str] = "right.png"
|
||||
## @brief File name of the wrong button image.
|
||||
WRONG_IMAGE_NAME: Final[str] = "wrong.png"
|
||||
|
||||
## @brief Label of the File menu.
|
||||
MENU_FILE_LABEL: Final[str] = "File"
|
||||
## @brief Label of the File, Open entry.
|
||||
MENU_OPEN_LABEL: Final[str] = "Open..."
|
||||
## @brief Label of the File, Change level entry.
|
||||
MENU_CHANGE_LEVEL_LABEL: Final[str] = "Change level..."
|
||||
## @brief Label of the File, Reset word list entry.
|
||||
MENU_RESET_LABEL: Final[str] = "Reset word list..."
|
||||
## @brief Label of the File, Exit entry.
|
||||
MENU_EXIT_LABEL: Final[str] = "Exit"
|
||||
## @brief Label of the About menu.
|
||||
MENU_ABOUT_LABEL: Final[str] = "About"
|
||||
## @brief Label of the About, Contact submenu.
|
||||
MENU_CONTACT_LABEL: Final[str] = "Contact"
|
||||
## @brief Index of the mnemonic letter of the File menu.
|
||||
MENU_FILE_UNDERLINE: Final[int] = 0
|
||||
## @brief Index of the mnemonic letter of the Open entry.
|
||||
MENU_OPEN_UNDERLINE: Final[int] = 0
|
||||
## @brief Index of the mnemonic letter of the Change level entry.
|
||||
MENU_CHANGE_LEVEL_UNDERLINE: Final[int] = 0
|
||||
## @brief Index of the mnemonic letter of the Reset word list entry.
|
||||
MENU_RESET_UNDERLINE: Final[int] = 0
|
||||
## @brief Index of the mnemonic letter of the Exit entry.
|
||||
MENU_EXIT_UNDERLINE: Final[int] = 1
|
||||
## @brief Index of the mnemonic letter of the About menu.
|
||||
MENU_ABOUT_UNDERLINE: Final[int] = 0
|
||||
## @brief Index of the mnemonic letter of the Contact submenu.
|
||||
MENU_CONTACT_UNDERLINE: Final[int] = 0
|
||||
## @brief Command name of the Open entry, as the menu view maps it.
|
||||
MENU_COMMAND_OPEN: Final[str] = "open_word_list"
|
||||
## @brief Command name of the Change level entry.
|
||||
MENU_COMMAND_CHANGE_LEVEL: Final[str] = "change_level"
|
||||
## @brief Command name of the Reset word list entry.
|
||||
MENU_COMMAND_RESET: Final[str] = "reset_word_list"
|
||||
## @brief Command name of the Exit entry.
|
||||
MENU_COMMAND_EXIT: Final[str] = "exit_program"
|
||||
|
||||
## @brief Name of the author shown under About, Contact.
|
||||
CONTACT_NAME: Final[str] = "Jens Tirsvad Nielsen"
|
||||
## @brief Title of the author shown under About, Contact.
|
||||
CONTACT_TITLE: Final[str] = "Software engineer"
|
||||
## @brief LinkedIn page of the author.
|
||||
CONTACT_URL: Final[str] = "https://www.linkedin.com/in/tirsvad74"
|
||||
## @brief Text of the contact entry: name and title; {name} and {title}.
|
||||
CONTACT_LABEL_TEMPLATE: Final[str] = "{name}, {title}"
|
||||
|
||||
## @brief Title of the open file dialog.
|
||||
OPEN_DIALOG_TITLE: Final[str] = "Open a word list"
|
||||
## @brief File types of the open file dialog: description and pattern.
|
||||
OPEN_FILE_TYPES: Final[tuple[tuple[str, str], ...]] = (
|
||||
("CSV files", "*.csv"),
|
||||
("All files", "*.*"),
|
||||
)
|
||||
## @brief Title of the reset confirmation.
|
||||
RESET_CONFIRM_TITLE: Final[str] = "Reset word list"
|
||||
## @brief Question of the reset confirmation; {name} is the word list file name.
|
||||
RESET_CONFIRM_TEMPLATE: Final[str] = (
|
||||
"Start {name} from the beginning? All words will be to learn again."
|
||||
)
|
||||
## @brief Title of the message that tells a word list could not be opened.
|
||||
OPEN_ERROR_TITLE: Final[str] = "Cannot open word list"
|
||||
## @brief Message of a word list that could not be opened; {name} and {reason}.
|
||||
OPEN_ERROR_TEMPLATE: Final[str] = "{name} could not be used.\n{reason}"
|
||||
## @brief Title of the message that tells a word list could not be reset.
|
||||
RESET_ERROR_TITLE: Final[str] = "Cannot reset word list"
|
||||
## @brief Message of a word list that could not be reset; {name} and {reason}.
|
||||
RESET_ERROR_TEMPLATE: Final[str] = "{name} could not be reset.\n{reason}"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
@brief The Deck entity: holds cards, draws one and removes one.
|
||||
"""
|
||||
|
||||
from collections import Counter
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
|
||||
from flash_card.domain.entities.card import Card
|
||||
@@ -66,24 +67,43 @@ class Deck:
|
||||
"""
|
||||
return len(self._cards)
|
||||
|
||||
def within(self, cards: Sequence[Card]) -> tuple[Card, ...]:
|
||||
"""Select the cards of the deck that also appear in the given cards.
|
||||
|
||||
A card counts as often as it appears in both.
|
||||
|
||||
@param cards The cards to match against, for example a level.
|
||||
@return The matching cards in deck order.
|
||||
"""
|
||||
allowed = Counter(cards)
|
||||
selected: list[Card] = []
|
||||
for card in self._cards:
|
||||
if allowed[card] > 0:
|
||||
allowed[card] -= 1
|
||||
selected.append(card)
|
||||
return tuple(selected)
|
||||
|
||||
def draw(
|
||||
self,
|
||||
choose: Callable[[Sequence[Card]], Card],
|
||||
exclude: Card | None = None,
|
||||
among: Sequence[Card] | None = None,
|
||||
) -> Card:
|
||||
"""Pick a card without removing it.
|
||||
|
||||
The pick avoids the excluded card when another card exists.
|
||||
The pick avoids the excluded card when another candidate exists.
|
||||
|
||||
@param choose Picks one card from a non-empty sequence.
|
||||
@param exclude A card to avoid, usually the one shown now.
|
||||
@param among The candidates, or None for every card of the deck.
|
||||
@return The picked card.
|
||||
@throws EmptyDeckError When the deck has no card.
|
||||
@throws EmptyDeckError When there is no candidate.
|
||||
"""
|
||||
if not self._cards:
|
||||
candidates = self._cards if among is None else list(among)
|
||||
if not candidates:
|
||||
raise EmptyDeckError("cannot draw from an empty deck")
|
||||
others = [card for card in self._cards if card != exclude]
|
||||
return choose(others or self._cards)
|
||||
others = [card for card in candidates if card != exclude]
|
||||
return choose(others or candidates)
|
||||
|
||||
def remove(self, card: Card) -> None:
|
||||
"""Remove the first card equal to the given one.
|
||||
|
||||
@@ -27,3 +27,11 @@ class ProgressRepository(Protocol):
|
||||
@return Nothing.
|
||||
"""
|
||||
...
|
||||
|
||||
def reset(self) -> None:
|
||||
"""Forget the saved words to learn, so every word is to learn again.
|
||||
|
||||
@return Nothing.
|
||||
@throws OSError When the saved progress cannot be removed.
|
||||
"""
|
||||
...
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
"""The level of a study session.
|
||||
|
||||
@file level.py
|
||||
@brief The Level value object: how many of the first words a session uses.
|
||||
"""
|
||||
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
|
||||
from flash_card.domain.entities.card import Card
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class Level:
|
||||
"""A limit on the words of the list, counted from the most frequent."""
|
||||
|
||||
## @brief Number of first words used, or None for all words.
|
||||
limit: int | None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Check the limit.
|
||||
|
||||
@return Nothing.
|
||||
@throws ValueError When the limit is set and not above zero.
|
||||
"""
|
||||
if self.limit is not None and self.limit <= 0:
|
||||
raise ValueError(f"level limit must be above zero, got {self.limit}")
|
||||
|
||||
def first(self, cards: Sequence[Card]) -> tuple[Card, ...]:
|
||||
"""Select the cards of this level.
|
||||
|
||||
@param cards The word list in order from the most frequent word.
|
||||
@return The first limit cards, or all cards when there is no limit or
|
||||
the list is shorter.
|
||||
"""
|
||||
if self.limit is None:
|
||||
return tuple(cards)
|
||||
return tuple(cards[: self.limit])
|
||||
@@ -42,3 +42,11 @@ class CsvProgressRepository:
|
||||
@return Nothing.
|
||||
"""
|
||||
write_word_list(self._path, deck.language_pair, deck.cards)
|
||||
|
||||
def reset(self) -> None:
|
||||
"""Delete the words to learn file; nothing happens when it is absent.
|
||||
|
||||
@return Nothing.
|
||||
@throws OSError When the file cannot be deleted.
|
||||
"""
|
||||
self._path.unlink(missing_ok=True)
|
||||
|
||||
@@ -67,7 +67,8 @@ def read_word_list(path: Path) -> tuple[LanguagePair, tuple[Card, ...]]:
|
||||
@param path The CSV file: a header of two language codes, then one card a row.
|
||||
@return The language pair and the cards in file order.
|
||||
@throws VocabularyNotFoundError When the file does not exist.
|
||||
@throws VocabularyFormatError When the file is empty or a row is malformed.
|
||||
@throws VocabularyFormatError When the file is empty, not UTF-8 text, cannot
|
||||
be read or a row is malformed.
|
||||
"""
|
||||
pair: LanguagePair | None = None
|
||||
cards: list[Card] = []
|
||||
@@ -83,6 +84,10 @@ def read_word_list(path: Path) -> tuple[LanguagePair, tuple[Card, ...]]:
|
||||
cards.append(_parse_card(path, reader.line_num, row))
|
||||
except FileNotFoundError as error:
|
||||
raise VocabularyNotFoundError(f"word list not found: {path}") from error
|
||||
except UnicodeDecodeError as error:
|
||||
raise VocabularyFormatError(f"{path}: file is not UTF-8 text") from error
|
||||
except OSError as error:
|
||||
raise VocabularyFormatError(f"{path}: cannot be read: {error}") from error
|
||||
if pair is None:
|
||||
raise _format_error(path, 1, "file is empty")
|
||||
return pair, tuple(cards)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
"""Name of the words to learn file of a word list.
|
||||
|
||||
@file progress_file_name.py
|
||||
@brief Keeps the progress of every word list in a file of its own.
|
||||
"""
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
from flash_card.constants import (
|
||||
PROGRESS_FILE_NAME,
|
||||
PROGRESS_FILE_NAME_TEMPLATE,
|
||||
PROGRESS_STEM_FORBIDDEN,
|
||||
PROGRESS_STEM_REPLACEMENT,
|
||||
VOCABULARY_FILE_NAME,
|
||||
)
|
||||
|
||||
|
||||
def progress_file_name(list_path: Path) -> str:
|
||||
"""Name the words to learn file of a word list.
|
||||
|
||||
@param list_path Path of the word list file.
|
||||
@return The default file name for the delivered list, else a name made of
|
||||
the list's file name stem with other characters than letters, digits,
|
||||
hyphen and underscore replaced by an underscore.
|
||||
"""
|
||||
if list_path.name == VOCABULARY_FILE_NAME:
|
||||
return PROGRESS_FILE_NAME
|
||||
stem = re.sub(PROGRESS_STEM_FORBIDDEN, PROGRESS_STEM_REPLACEMENT, list_path.stem)
|
||||
return PROGRESS_FILE_NAME_TEMPLATE.format(stem=stem)
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Entry point and composition root of the flash card program.
|
||||
|
||||
@file app.py
|
||||
@brief Creates the window, its view model and view, and runs the main loop.
|
||||
@brief Creates the window and menu bar, shows the level screen and then the card.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -9,30 +9,42 @@ import importlib.util
|
||||
import logging
|
||||
import random
|
||||
import tkinter as tk
|
||||
from collections.abc import Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
from pathlib import Path
|
||||
from typing import NoReturn
|
||||
|
||||
from flash_card.application.ports.speech_port import SpeechPort
|
||||
from flash_card.application.use_cases.open_study_session import open_study_session
|
||||
from flash_card.constants import (
|
||||
BUNDLED_VOCABULARY_PATH,
|
||||
DEFAULT_DATA_DIR,
|
||||
PROGRESS_FILE_NAME,
|
||||
LEVEL_ARGUMENT_VALUES,
|
||||
VOCABULARY_FILE_NAME,
|
||||
)
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.errors.vocabulary_errors import VocabularyError
|
||||
from flash_card.domain.repositories.progress_repository import ProgressRepository
|
||||
from flash_card.domain.repositories.vocabulary_repository import VocabularyRepository
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.csv_vocabulary_repository import (
|
||||
CsvVocabularyRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.progress_file_name import (
|
||||
progress_file_name,
|
||||
)
|
||||
from flash_card.infrastructure.speech.gtts_speech import GttsSpeech
|
||||
from flash_card.infrastructure.speech.null_speech import NullSpeech
|
||||
from flash_card.presentation.features.flash_card.flash_card_view import FlashCardView
|
||||
from flash_card.presentation.features.flash_card.flash_card_view_model import (
|
||||
FlashCardViewModel,
|
||||
)
|
||||
from flash_card.presentation.features.level.level_view import LevelView
|
||||
from flash_card.presentation.features.level.level_view_model import LevelViewModel
|
||||
from flash_card.presentation.features.menu.menu_view import MenuView
|
||||
from flash_card.presentation.features.menu.menu_view_model import MenuViewModel
|
||||
|
||||
## @brief Logger of the entry point.
|
||||
_logger = logging.getLogger(__name__)
|
||||
@@ -55,26 +67,255 @@ def build_speech(enabled: bool) -> SpeechPort:
|
||||
return NullSpeech()
|
||||
|
||||
|
||||
class Application:
|
||||
"""The running program: one window with a menu, the level screen and the card."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
root: tk.Tk,
|
||||
speech: SpeechPort,
|
||||
choose: Callable[[Sequence[Card]], Card],
|
||||
repositories_for: Callable[
|
||||
[Path], tuple[VocabularyRepository, ProgressRepository]
|
||||
],
|
||||
list_path: Path,
|
||||
) -> None:
|
||||
"""Create the application on a window; no screen is shown yet.
|
||||
|
||||
@param root The Tk root window.
|
||||
@param speech Speaks the front text of each drawn card.
|
||||
@param choose Picks one card from a non-empty sequence.
|
||||
@param repositories_for Builds the word list and progress repositories of
|
||||
a word list file; the composition root supplies it.
|
||||
@param list_path The word list file in use.
|
||||
"""
|
||||
## @brief The Tk root window.
|
||||
self.root = root
|
||||
## @brief Speaks the front text of each drawn card.
|
||||
self._speech = speech
|
||||
## @brief Picks one card from a non-empty sequence.
|
||||
self._choose = choose
|
||||
## @brief Builds the repositories of a word list file.
|
||||
self._repositories_for = repositories_for
|
||||
## @brief The word list file in use.
|
||||
self._list_path = list_path
|
||||
vocabulary_repository, progress_repository = repositories_for(list_path)
|
||||
## @brief Source of the word list in use.
|
||||
self._vocabulary_repository = vocabulary_repository
|
||||
## @brief Store of the words still to learn of the word list in use.
|
||||
self._progress_repository = progress_repository
|
||||
## @brief The screen shown now, or None before the first one.
|
||||
self._view: LevelView | FlashCardView | None = None
|
||||
## @brief The exit code of the program.
|
||||
self._exit_code = 0
|
||||
|
||||
@property
|
||||
def view(self) -> LevelView | FlashCardView | None:
|
||||
"""Return the screen shown now.
|
||||
|
||||
@return The level screen, the card screen, or None before the first.
|
||||
"""
|
||||
return self._view
|
||||
|
||||
@property
|
||||
def exit_code(self) -> int:
|
||||
"""Return the exit code the program ends with.
|
||||
|
||||
@return 0, or 1 when a session could not be started after a choice.
|
||||
"""
|
||||
return self._exit_code
|
||||
|
||||
@property
|
||||
def word_list_name(self) -> str:
|
||||
"""Return the file name of the word list in use.
|
||||
|
||||
@return The file name.
|
||||
"""
|
||||
return self._list_path.name
|
||||
|
||||
@property
|
||||
def word_list_folder(self) -> Path:
|
||||
"""Return the folder of the word list in use.
|
||||
|
||||
@return The folder that holds the word list file.
|
||||
"""
|
||||
return self._list_path.parent
|
||||
|
||||
def show_level_screen(self) -> None:
|
||||
"""Show the level screen; a choice starts the session.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._view = LevelView(self.root, LevelViewModel(), self._choose_level)
|
||||
|
||||
def start(self, level: Level) -> None:
|
||||
"""Open the session of a level and show the card screen on the window.
|
||||
|
||||
@param level The level the user chose.
|
||||
@return Nothing.
|
||||
@throws VocabularyError When the word list or saved progress is unusable.
|
||||
"""
|
||||
session = open_study_session(
|
||||
self._vocabulary_repository,
|
||||
self._progress_repository,
|
||||
self._speech,
|
||||
self._choose,
|
||||
level,
|
||||
)
|
||||
self._close_screen()
|
||||
self._view = FlashCardView(self.root, FlashCardViewModel(session))
|
||||
|
||||
def open_word_list(self, path: Path) -> None:
|
||||
"""Switch to another word list and show the level screen.
|
||||
|
||||
The file is loaded first; nothing changes when it is unusable.
|
||||
|
||||
@param path The CSV word list file.
|
||||
@return Nothing.
|
||||
@throws VocabularyError When the file is missing or malformed.
|
||||
"""
|
||||
vocabulary_repository, progress_repository = self._repositories_for(path)
|
||||
vocabulary_repository.load()
|
||||
self._vocabulary_repository = vocabulary_repository
|
||||
self._progress_repository = progress_repository
|
||||
self._list_path = path
|
||||
self.change_level()
|
||||
|
||||
def change_level(self) -> None:
|
||||
"""Drop the current screen and its timer and show the level screen.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._close_screen()
|
||||
self.show_level_screen()
|
||||
|
||||
def reset_word_list(self) -> None:
|
||||
"""Forget the progress of the word list in use and show the level screen.
|
||||
|
||||
@return Nothing.
|
||||
@throws OSError When the progress cannot be removed.
|
||||
"""
|
||||
self._progress_repository.reset()
|
||||
self.change_level()
|
||||
|
||||
def exit_application(self) -> None:
|
||||
"""Drop the current screen and its timer and close the window.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._close_screen()
|
||||
self.root.destroy()
|
||||
|
||||
def _close_screen(self) -> None:
|
||||
"""Remove the screen shown now, if any.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
if isinstance(self._view, LevelView):
|
||||
self._view.destroy()
|
||||
elif isinstance(self._view, FlashCardView):
|
||||
self._view.close()
|
||||
self._view = None
|
||||
|
||||
def _choose_level(self, level: Level) -> None:
|
||||
"""Start the session after a click; close the window when it fails.
|
||||
|
||||
@param level The level the user chose.
|
||||
@return Nothing.
|
||||
"""
|
||||
try:
|
||||
self.start(level)
|
||||
except VocabularyError as error:
|
||||
_logger.error("%s", error)
|
||||
self._exit_code = 1
|
||||
self.root.destroy()
|
||||
|
||||
|
||||
def resolve_data_files(data_dir: Path | None) -> tuple[Path, Path]:
|
||||
"""Find the word list and the progress file.
|
||||
|
||||
@param data_dir Folder given by the user, or None for the default folder.
|
||||
@return The vocabulary path and the progress path. Without a given folder,
|
||||
the delivered word list is used when the default folder has none.
|
||||
"""
|
||||
folder = DEFAULT_DATA_DIR if data_dir is None else data_dir
|
||||
vocabulary = folder / VOCABULARY_FILE_NAME
|
||||
if data_dir is None and not vocabulary.exists():
|
||||
vocabulary = BUNDLED_VOCABULARY_PATH
|
||||
return vocabulary, folder / progress_file_name(vocabulary)
|
||||
|
||||
|
||||
def _repository_builder(
|
||||
folder: Path,
|
||||
) -> Callable[[Path], tuple[VocabularyRepository, ProgressRepository]]:
|
||||
"""Make the function that builds the CSV repositories of a word list.
|
||||
|
||||
@param folder The data folder that holds every progress file.
|
||||
@return A function from a word list path to its repositories; the progress
|
||||
file is in the data folder, named after the list.
|
||||
"""
|
||||
|
||||
def build(list_path: Path) -> tuple[VocabularyRepository, ProgressRepository]:
|
||||
return (
|
||||
CsvVocabularyRepository(list_path),
|
||||
CsvProgressRepository(folder / progress_file_name(list_path)),
|
||||
)
|
||||
|
||||
return build
|
||||
|
||||
|
||||
def create_application(
|
||||
data_dir: Path | None = None,
|
||||
speech_enabled: bool = True,
|
||||
) -> tuple[tk.Tk, FlashCardView]:
|
||||
"""Create the root window and the flash card view.
|
||||
level: Level | None = None,
|
||||
word_list: Path | None = None,
|
||||
) -> Application:
|
||||
"""Create the window with its menu bar and show the level screen, or start.
|
||||
|
||||
@param data_dir Folder of the data files, or None for the default folder.
|
||||
@param data_dir Folder of the data files, or None for the default folder
|
||||
with the delivered word list as fallback.
|
||||
@param speech_enabled False to run without spoken words.
|
||||
@return The root window and the view built on it.
|
||||
@throws VocabularyError When the word list or saved progress is unusable.
|
||||
@param level The level to start at, or None to show the level screen.
|
||||
@param word_list A word list file to use instead of the one of the data
|
||||
folder, or None; its progress file is still in the data folder.
|
||||
@return The application, its window in the root attribute.
|
||||
@throws VocabularyError When a level is given and the word list or saved
|
||||
progress is unusable.
|
||||
"""
|
||||
folder = DEFAULT_DATA_DIR if data_dir is None else data_dir
|
||||
repository = CsvVocabularyRepository(folder / VOCABULARY_FILE_NAME)
|
||||
progress = CsvProgressRepository(folder / PROGRESS_FILE_NAME)
|
||||
speech = build_speech(speech_enabled)
|
||||
session = open_study_session(repository, progress, speech, random.choice)
|
||||
view_model = FlashCardViewModel(session)
|
||||
vocabulary_path, progress_path = resolve_data_files(data_dir)
|
||||
root = tk.Tk()
|
||||
view = FlashCardView(root, view_model)
|
||||
return root, view
|
||||
application = Application(
|
||||
root,
|
||||
build_speech(speech_enabled),
|
||||
random.choice,
|
||||
_repository_builder(progress_path.parent),
|
||||
vocabulary_path if word_list is None else word_list,
|
||||
)
|
||||
MenuView(root, MenuViewModel(), application)
|
||||
if level is None:
|
||||
application.show_level_screen()
|
||||
return application
|
||||
try:
|
||||
application.start(level)
|
||||
except VocabularyError:
|
||||
root.destroy()
|
||||
raise
|
||||
return application
|
||||
|
||||
|
||||
def _level_argument(value: str) -> Level:
|
||||
"""Convert a --level value to a level.
|
||||
|
||||
@param value One of the keys of LEVEL_ARGUMENT_VALUES.
|
||||
@return The level.
|
||||
@throws argparse.ArgumentTypeError When the value is unknown.
|
||||
"""
|
||||
if value not in LEVEL_ARGUMENT_VALUES:
|
||||
choices = ", ".join(LEVEL_ARGUMENT_VALUES)
|
||||
raise argparse.ArgumentTypeError(
|
||||
f"invalid level {value!r} (choose from {choices})"
|
||||
)
|
||||
return Level(LEVEL_ARGUMENT_VALUES[value])
|
||||
|
||||
|
||||
def main(argv: Sequence[str] | None = None) -> int:
|
||||
@@ -87,22 +328,29 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||
parser.add_argument(
|
||||
"--data-dir",
|
||||
type=Path,
|
||||
default=DEFAULT_DATA_DIR,
|
||||
help="folder of the data files",
|
||||
default=None,
|
||||
help="folder of the data files (default: data next to the program)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--no-speech",
|
||||
action="store_true",
|
||||
help="do not speak the words",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--level",
|
||||
type=_level_argument,
|
||||
default=None,
|
||||
metavar="{" + ",".join(LEVEL_ARGUMENT_VALUES) + "}",
|
||||
help="start at a level (100, 1000 or all words) and skip the level screen",
|
||||
)
|
||||
args = parser.parse_args(argv)
|
||||
try:
|
||||
root, _view = create_application(args.data_dir, not args.no_speech)
|
||||
application = create_application(args.data_dir, not args.no_speech, args.level)
|
||||
except VocabularyError as error:
|
||||
_logger.error("%s", error)
|
||||
return 1
|
||||
root.mainloop()
|
||||
return 0
|
||||
application.root.mainloop()
|
||||
return application.exit_code
|
||||
|
||||
|
||||
def run() -> NoReturn:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
@@ -20,8 +20,6 @@ from flash_card.constants import (
|
||||
LANGUAGE_FONT,
|
||||
LANGUAGE_TEXT_Y,
|
||||
RIGHT_IMAGE_NAME,
|
||||
WINDOW_PADDING,
|
||||
WINDOW_TITLE,
|
||||
WORD_FONT,
|
||||
WORD_TEXT_Y,
|
||||
WRONG_IMAGE_NAME,
|
||||
@@ -30,6 +28,7 @@ from flash_card.presentation.features.flash_card.flash_card_view_model import (
|
||||
FlashCardViewModel,
|
||||
Side,
|
||||
)
|
||||
from flash_card.presentation.shared.window import configure_window
|
||||
|
||||
|
||||
def _load_image(root: tk.Tk, name: str) -> tk.PhotoImage:
|
||||
@@ -60,8 +59,7 @@ class FlashCardView:
|
||||
self._root = root
|
||||
## @brief The data source of the texts.
|
||||
self._view_model = view_model
|
||||
root.title(WINDOW_TITLE)
|
||||
root.config(padx=WINDOW_PADDING, pady=WINDOW_PADDING, bg=BACKGROUND_COLOR)
|
||||
configure_window(root)
|
||||
|
||||
# Kept as attributes: Tkinter drops an image nothing refers to.
|
||||
## @brief Card front image, kept so Tk does not drop it.
|
||||
@@ -148,6 +146,15 @@ class FlashCardView:
|
||||
"""
|
||||
return self._card_back_image
|
||||
|
||||
def close(self) -> None:
|
||||
"""Cancel the flip timer and remove the widgets of the screen.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._cancel_flip_timer()
|
||||
for widget in (self.canvas, self.wrong_button, self.right_button):
|
||||
widget.destroy()
|
||||
|
||||
def next_card(self) -> None:
|
||||
"""Show the next card front and restart the flip timer.
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
"""The level feature: its view and view model."""
|
||||
@@ -0,0 +1,99 @@
|
||||
"""View of the level screen.
|
||||
|
||||
@file level_view.py
|
||||
@brief Builds the level screen of the wireframe: a title and one button per level.
|
||||
"""
|
||||
|
||||
import tkinter as tk
|
||||
from collections.abc import Callable
|
||||
|
||||
from flash_card.constants import (
|
||||
BACKGROUND_COLOR,
|
||||
CARD_WIDTH,
|
||||
LEVEL_BUTTON_COLOR,
|
||||
LEVEL_BUTTON_FONT,
|
||||
LEVEL_BUTTON_WIDTH,
|
||||
LEVEL_SCREEN_HEIGHT,
|
||||
LEVEL_TITLE_FONT,
|
||||
)
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.presentation.features.level.level_view_model import (
|
||||
LevelChoice,
|
||||
LevelViewModel,
|
||||
)
|
||||
from flash_card.presentation.shared.window import configure_window
|
||||
|
||||
|
||||
class LevelView:
|
||||
"""The level screen: a title and a button for each level."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
root: tk.Tk,
|
||||
view_model: LevelViewModel,
|
||||
on_choose: Callable[[Level], None],
|
||||
) -> None:
|
||||
"""Build the screen on a root.
|
||||
|
||||
@param root The Tk root window.
|
||||
@param view_model The data to show.
|
||||
@param on_choose Called with the level the user picked.
|
||||
"""
|
||||
## @brief Called with the level the user picked.
|
||||
self._on_choose = on_choose
|
||||
configure_window(root)
|
||||
## @brief Frame that holds the whole screen.
|
||||
self.frame = tk.Frame(
|
||||
root, bg=BACKGROUND_COLOR, width=CARD_WIDTH, height=LEVEL_SCREEN_HEIGHT
|
||||
)
|
||||
self.frame.grid(row=0, column=0)
|
||||
self.frame.grid_propagate(False)
|
||||
self.frame.grid_columnconfigure(0, weight=1)
|
||||
for row in range(len(view_model.choices) + 1):
|
||||
self.frame.grid_rowconfigure(row, weight=1)
|
||||
## @brief The title text.
|
||||
self.title_label = tk.Label(
|
||||
self.frame,
|
||||
text=view_model.title,
|
||||
font=LEVEL_TITLE_FONT,
|
||||
bg=BACKGROUND_COLOR,
|
||||
)
|
||||
self.title_label.grid(row=0, column=0)
|
||||
## @brief One button per choice, in display order.
|
||||
self.buttons = tuple(
|
||||
self._build_button(row, choice)
|
||||
for row, choice in enumerate(view_model.choices, start=1)
|
||||
)
|
||||
|
||||
def choose(self, level: Level) -> None:
|
||||
"""Forward the chosen level.
|
||||
|
||||
@param level The level the user picked.
|
||||
@return Nothing.
|
||||
"""
|
||||
self._on_choose(level)
|
||||
|
||||
def destroy(self) -> None:
|
||||
"""Remove the screen from the window.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self.frame.destroy()
|
||||
|
||||
def _build_button(self, row: int, choice: LevelChoice) -> tk.Button:
|
||||
"""Create the button of one choice.
|
||||
|
||||
@param row Grid row of the button.
|
||||
@param choice The choice the button stands for.
|
||||
@return The button, placed in the frame.
|
||||
"""
|
||||
button = tk.Button(
|
||||
self.frame,
|
||||
text=choice.label,
|
||||
font=LEVEL_BUTTON_FONT,
|
||||
width=LEVEL_BUTTON_WIDTH,
|
||||
bg=LEVEL_BUTTON_COLOR,
|
||||
command=lambda: self.choose(choice.level),
|
||||
)
|
||||
button.grid(row=row, column=0)
|
||||
return button
|
||||
@@ -0,0 +1,53 @@
|
||||
"""View model of the level screen.
|
||||
|
||||
@file level_view_model.py
|
||||
@brief Exposes the title and the level choices; free of any Tkinter import.
|
||||
"""
|
||||
|
||||
from collections.abc import Sequence
|
||||
from dataclasses import dataclass
|
||||
|
||||
from flash_card.constants import LEVEL_CHOICES, LEVEL_TITLE
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class LevelChoice:
|
||||
"""One choice on the level screen."""
|
||||
|
||||
## @brief Text of the choice.
|
||||
label: str
|
||||
## @brief The level the choice stands for.
|
||||
level: Level
|
||||
|
||||
|
||||
class LevelViewModel:
|
||||
"""Data the level view shows."""
|
||||
|
||||
def __init__(self, choices: Sequence[tuple[str, int | None]] | None = None) -> None:
|
||||
"""Create the view model.
|
||||
|
||||
@param choices Label and word limit of each choice, or None for the
|
||||
choices of the program.
|
||||
"""
|
||||
source = LEVEL_CHOICES if choices is None else choices
|
||||
## @brief The choices in display order.
|
||||
self._choices = tuple(
|
||||
LevelChoice(label, Level(limit)) for label, limit in source
|
||||
)
|
||||
|
||||
@property
|
||||
def title(self) -> str:
|
||||
"""Return the title of the screen.
|
||||
|
||||
@return The title text.
|
||||
"""
|
||||
return LEVEL_TITLE
|
||||
|
||||
@property
|
||||
def choices(self) -> tuple[LevelChoice, ...]:
|
||||
"""Return the choices.
|
||||
|
||||
@return The choices in display order.
|
||||
"""
|
||||
return self._choices
|
||||
@@ -0,0 +1 @@
|
||||
"""Menu bar feature."""
|
||||
@@ -0,0 +1,241 @@
|
||||
"""View of the menu bar.
|
||||
|
||||
@file menu_view.py
|
||||
@brief Builds the menu bar of the wireframe and asks the dialogs of its commands.
|
||||
"""
|
||||
|
||||
import logging
|
||||
import tkinter as tk
|
||||
import webbrowser
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
from tkinter import filedialog, messagebox
|
||||
from typing import Protocol
|
||||
|
||||
from flash_card.constants import (
|
||||
MENU_ABOUT_UNDERLINE,
|
||||
MENU_COMMAND_CHANGE_LEVEL,
|
||||
MENU_COMMAND_EXIT,
|
||||
MENU_COMMAND_OPEN,
|
||||
MENU_COMMAND_RESET,
|
||||
MENU_CONTACT_UNDERLINE,
|
||||
MENU_FILE_UNDERLINE,
|
||||
OPEN_DIALOG_TITLE,
|
||||
OPEN_ERROR_TEMPLATE,
|
||||
OPEN_ERROR_TITLE,
|
||||
OPEN_FILE_TYPES,
|
||||
RESET_CONFIRM_TEMPLATE,
|
||||
RESET_CONFIRM_TITLE,
|
||||
RESET_ERROR_TEMPLATE,
|
||||
RESET_ERROR_TITLE,
|
||||
)
|
||||
from flash_card.domain.errors.vocabulary_errors import VocabularyError
|
||||
from flash_card.presentation.features.menu.menu_view_model import MenuViewModel
|
||||
|
||||
## @brief Logger of the menu view.
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MenuApplication(Protocol):
|
||||
"""What the menu view needs from the application."""
|
||||
|
||||
@property
|
||||
def word_list_name(self) -> str:
|
||||
"""Return the file name of the word list in use.
|
||||
|
||||
@return The file name.
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def word_list_folder(self) -> Path:
|
||||
"""Return the folder of the word list in use.
|
||||
|
||||
@return The folder.
|
||||
"""
|
||||
...
|
||||
|
||||
def open_word_list(self, path: Path) -> None:
|
||||
"""Switch to the word list in a file.
|
||||
|
||||
@param path The CSV file.
|
||||
@return Nothing.
|
||||
"""
|
||||
...
|
||||
|
||||
def change_level(self) -> None:
|
||||
"""Show the level screen.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
...
|
||||
|
||||
def reset_word_list(self) -> None:
|
||||
"""Forget the progress of the word list in use.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
...
|
||||
|
||||
def exit_application(self) -> None:
|
||||
"""Close the window.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
...
|
||||
|
||||
|
||||
class MenuView:
|
||||
"""The menu bar of the window: File and About."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
root: tk.Tk,
|
||||
view_model: MenuViewModel,
|
||||
application: MenuApplication,
|
||||
*,
|
||||
ask_open_file: Callable[..., str] = filedialog.askopenfilename,
|
||||
confirm: Callable[..., bool] = messagebox.askyesno,
|
||||
show_error: Callable[..., str] = messagebox.showerror,
|
||||
open_url: Callable[[str], bool] = webbrowser.open,
|
||||
) -> None:
|
||||
"""Build the menu bar on a root.
|
||||
|
||||
@param root The Tk root window.
|
||||
@param view_model The labels and the contact data.
|
||||
@param application The commands the entries run.
|
||||
@param ask_open_file Shows the file dialog and returns the chosen path,
|
||||
or an empty value when cancelled.
|
||||
@param confirm Asks a yes or no question.
|
||||
@param show_error Shows an error message.
|
||||
@param open_url Opens an address in the web browser.
|
||||
"""
|
||||
## @brief The Tk root window.
|
||||
self._root = root
|
||||
## @brief The labels and the contact data.
|
||||
self._view_model = view_model
|
||||
## @brief The commands the entries run.
|
||||
self._application = application
|
||||
## @brief Shows the file dialog.
|
||||
self._ask_open_file = ask_open_file
|
||||
## @brief Asks a yes or no question.
|
||||
self._confirm = confirm
|
||||
## @brief Shows an error message.
|
||||
self._show_error = show_error
|
||||
## @brief Opens an address in the web browser.
|
||||
self._open_url = open_url
|
||||
## @brief The menu bar of the window.
|
||||
self.menubar = tk.Menu(root, tearoff=False)
|
||||
## @brief The File menu.
|
||||
self.file_menu = tk.Menu(self.menubar, tearoff=False)
|
||||
## @brief The About menu.
|
||||
self.about_menu = tk.Menu(self.menubar, tearoff=False)
|
||||
## @brief The Contact submenu of the About menu.
|
||||
self.contact_menu = tk.Menu(self.about_menu, tearoff=False)
|
||||
self._build()
|
||||
root.config(menu=self.menubar)
|
||||
|
||||
def open_word_list(self) -> None:
|
||||
"""Ask for a CSV file and switch to it; a refused file shows a message.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
chosen = self._ask_open_file(
|
||||
parent=self._root,
|
||||
title=OPEN_DIALOG_TITLE,
|
||||
initialdir=str(self._application.word_list_folder),
|
||||
filetypes=OPEN_FILE_TYPES,
|
||||
)
|
||||
if not chosen:
|
||||
return
|
||||
path = Path(chosen)
|
||||
try:
|
||||
self._application.open_word_list(path)
|
||||
except VocabularyError as error:
|
||||
_logger.error("%s", error)
|
||||
self._show_error(
|
||||
OPEN_ERROR_TITLE,
|
||||
OPEN_ERROR_TEMPLATE.format(name=path.name, reason=error),
|
||||
parent=self._root,
|
||||
)
|
||||
|
||||
def change_level(self) -> None:
|
||||
"""Show the level screen again.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._application.change_level()
|
||||
|
||||
def reset_word_list(self) -> None:
|
||||
"""Ask to confirm, then start the word list in use from the beginning.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
name = self._application.word_list_name
|
||||
question = RESET_CONFIRM_TEMPLATE.format(name=name)
|
||||
if not self._confirm(RESET_CONFIRM_TITLE, question, parent=self._root):
|
||||
return
|
||||
try:
|
||||
self._application.reset_word_list()
|
||||
except OSError as error:
|
||||
_logger.error("%s", error)
|
||||
self._show_error(
|
||||
RESET_ERROR_TITLE,
|
||||
RESET_ERROR_TEMPLATE.format(name=name, reason=error),
|
||||
parent=self._root,
|
||||
)
|
||||
|
||||
def show_contact(self) -> None:
|
||||
"""Open the LinkedIn page of the author in the web browser.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
try:
|
||||
self._open_url(self._view_model.contact_url)
|
||||
except (webbrowser.Error, OSError) as error:
|
||||
_logger.error("%s", error)
|
||||
|
||||
def exit_program(self) -> None:
|
||||
"""Close the window.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
self._application.exit_application()
|
||||
|
||||
def _build(self) -> None:
|
||||
"""Fill the menus and add them to the menu bar.
|
||||
|
||||
@return Nothing.
|
||||
"""
|
||||
commands = {
|
||||
MENU_COMMAND_OPEN: self.open_word_list,
|
||||
MENU_COMMAND_CHANGE_LEVEL: self.change_level,
|
||||
MENU_COMMAND_RESET: self.reset_word_list,
|
||||
MENU_COMMAND_EXIT: self.exit_program,
|
||||
}
|
||||
for entry in self._view_model.file_entries:
|
||||
if entry.command == MENU_COMMAND_EXIT:
|
||||
self.file_menu.add_separator()
|
||||
self.file_menu.add_command(
|
||||
label=entry.label,
|
||||
underline=entry.underline,
|
||||
command=commands[entry.command],
|
||||
)
|
||||
self.contact_menu.add_command(
|
||||
label=self._view_model.contact_label, command=self.show_contact
|
||||
)
|
||||
self.about_menu.add_cascade(
|
||||
label=self._view_model.contact_menu_label,
|
||||
underline=MENU_CONTACT_UNDERLINE,
|
||||
menu=self.contact_menu,
|
||||
)
|
||||
self.menubar.add_cascade(
|
||||
label=self._view_model.file_label,
|
||||
underline=MENU_FILE_UNDERLINE,
|
||||
menu=self.file_menu,
|
||||
)
|
||||
self.menubar.add_cascade(
|
||||
label=self._view_model.about_label,
|
||||
underline=MENU_ABOUT_UNDERLINE,
|
||||
menu=self.about_menu,
|
||||
)
|
||||
@@ -0,0 +1,102 @@
|
||||
"""View model of the menu bar.
|
||||
|
||||
@file menu_view_model.py
|
||||
@brief Exposes the labels, the order and the contact data; free of Tkinter.
|
||||
"""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from flash_card.constants import (
|
||||
CONTACT_LABEL_TEMPLATE,
|
||||
CONTACT_NAME,
|
||||
CONTACT_TITLE,
|
||||
CONTACT_URL,
|
||||
MENU_ABOUT_LABEL,
|
||||
MENU_CHANGE_LEVEL_LABEL,
|
||||
MENU_CHANGE_LEVEL_UNDERLINE,
|
||||
MENU_COMMAND_CHANGE_LEVEL,
|
||||
MENU_COMMAND_EXIT,
|
||||
MENU_COMMAND_OPEN,
|
||||
MENU_COMMAND_RESET,
|
||||
MENU_CONTACT_LABEL,
|
||||
MENU_EXIT_LABEL,
|
||||
MENU_EXIT_UNDERLINE,
|
||||
MENU_FILE_LABEL,
|
||||
MENU_OPEN_LABEL,
|
||||
MENU_OPEN_UNDERLINE,
|
||||
MENU_RESET_LABEL,
|
||||
MENU_RESET_UNDERLINE,
|
||||
)
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class MenuEntry:
|
||||
"""One entry of the File menu."""
|
||||
|
||||
## @brief Text of the entry.
|
||||
label: str
|
||||
## @brief Name of the command of the menu view the entry runs.
|
||||
command: str
|
||||
## @brief Index of the mnemonic letter in the label.
|
||||
underline: int
|
||||
|
||||
|
||||
class MenuViewModel:
|
||||
"""Data the menu view shows."""
|
||||
|
||||
@property
|
||||
def file_label(self) -> str:
|
||||
"""Return the label of the File menu.
|
||||
|
||||
@return The label.
|
||||
"""
|
||||
return MENU_FILE_LABEL
|
||||
|
||||
@property
|
||||
def file_entries(self) -> tuple[MenuEntry, ...]:
|
||||
"""Return the entries of the File menu.
|
||||
|
||||
@return Open, Change level, Reset word list and Exit, in this order.
|
||||
"""
|
||||
return (
|
||||
MenuEntry(MENU_OPEN_LABEL, MENU_COMMAND_OPEN, MENU_OPEN_UNDERLINE),
|
||||
MenuEntry(
|
||||
MENU_CHANGE_LEVEL_LABEL,
|
||||
MENU_COMMAND_CHANGE_LEVEL,
|
||||
MENU_CHANGE_LEVEL_UNDERLINE,
|
||||
),
|
||||
MenuEntry(MENU_RESET_LABEL, MENU_COMMAND_RESET, MENU_RESET_UNDERLINE),
|
||||
MenuEntry(MENU_EXIT_LABEL, MENU_COMMAND_EXIT, MENU_EXIT_UNDERLINE),
|
||||
)
|
||||
|
||||
@property
|
||||
def about_label(self) -> str:
|
||||
"""Return the label of the About menu.
|
||||
|
||||
@return The label.
|
||||
"""
|
||||
return MENU_ABOUT_LABEL
|
||||
|
||||
@property
|
||||
def contact_menu_label(self) -> str:
|
||||
"""Return the label of the Contact submenu.
|
||||
|
||||
@return The label.
|
||||
"""
|
||||
return MENU_CONTACT_LABEL
|
||||
|
||||
@property
|
||||
def contact_label(self) -> str:
|
||||
"""Return the text of the contact entry.
|
||||
|
||||
@return The name and the title of the author.
|
||||
"""
|
||||
return CONTACT_LABEL_TEMPLATE.format(name=CONTACT_NAME, title=CONTACT_TITLE)
|
||||
|
||||
@property
|
||||
def contact_url(self) -> str:
|
||||
"""Return the address the contact entry opens.
|
||||
|
||||
@return The LinkedIn page of the author.
|
||||
"""
|
||||
return CONTACT_URL
|
||||
@@ -0,0 +1 @@
|
||||
"""Code shared by the screens of the presentation layer."""
|
||||
@@ -0,0 +1,19 @@
|
||||
"""Window set-up shared by the screens.
|
||||
|
||||
@file window.py
|
||||
@brief Gives the root window its title, padding and background.
|
||||
"""
|
||||
|
||||
import tkinter as tk
|
||||
|
||||
from flash_card.constants import BACKGROUND_COLOR, WINDOW_PADDING, WINDOW_TITLE
|
||||
|
||||
|
||||
def configure_window(root: tk.Tk) -> None:
|
||||
"""Set the title, padding and background of the window.
|
||||
|
||||
@param root The Tk root window.
|
||||
@return Nothing.
|
||||
"""
|
||||
root.title(WINDOW_TITLE)
|
||||
root.config(padx=WINDOW_PADDING, pady=WINDOW_PADDING, bg=BACKGROUND_COLOR)
|
||||
@@ -0,0 +1,72 @@
|
||||
"""Locate resources and the executable folder, frozen or from source.
|
||||
|
||||
@file runtime.py
|
||||
@brief Packaging support: tells where bundled files and the executable are.
|
||||
Imports only the standard library; it is not one of the layers.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
## @brief Number of folders from this file up to the project root.
|
||||
_ROOT_LEVELS = 2
|
||||
|
||||
|
||||
def is_frozen() -> bool:
|
||||
"""Tell whether the program runs as a PyInstaller executable.
|
||||
|
||||
@return True when frozen.
|
||||
"""
|
||||
return bool(getattr(sys, "frozen", False))
|
||||
|
||||
|
||||
def source_root() -> Path:
|
||||
"""Return the project root of a source run.
|
||||
|
||||
@return The folder that holds src.
|
||||
"""
|
||||
return Path(__file__).resolve().parents[_ROOT_LEVELS]
|
||||
|
||||
|
||||
def pick_resource_root(frozen: bool, bundle_dir: Path | None, root: Path) -> Path:
|
||||
"""Choose the folder that holds the bundled resources.
|
||||
|
||||
@param frozen True when running as an executable.
|
||||
@param bundle_dir The unpack folder of the executable, when frozen.
|
||||
@param root The project root of a source run.
|
||||
@return The bundle folder when frozen and known, else the project root.
|
||||
"""
|
||||
if frozen and bundle_dir is not None:
|
||||
return bundle_dir
|
||||
return root
|
||||
|
||||
|
||||
def pick_executable_dir(frozen: bool, executable: Path, root: Path) -> Path:
|
||||
"""Choose the folder next to the executable.
|
||||
|
||||
@param frozen True when running as an executable.
|
||||
@param executable Path of the running executable.
|
||||
@param root The project root of a source run.
|
||||
@return The folder of the executable when frozen, else the project root.
|
||||
"""
|
||||
if frozen:
|
||||
return executable.parent
|
||||
return root
|
||||
|
||||
|
||||
def resource_root() -> Path:
|
||||
"""Return the folder that holds the bundled resources.
|
||||
|
||||
@return The PyInstaller unpack folder when frozen, else the project root.
|
||||
"""
|
||||
bundle = getattr(sys, "_MEIPASS", None)
|
||||
bundle_dir = Path(bundle) if bundle else None
|
||||
return pick_resource_root(is_frozen(), bundle_dir, source_root())
|
||||
|
||||
|
||||
def executable_dir() -> Path:
|
||||
"""Return the folder of the running executable.
|
||||
|
||||
@return The folder of the executable when frozen, else the project root.
|
||||
"""
|
||||
return pick_executable_dir(is_frozen(), Path(sys.executable), source_root())
|
||||
@@ -0,0 +1,22 @@
|
||||
"""Fixtures shared by the end-to-end tests."""
|
||||
|
||||
import tkinter as tk
|
||||
from collections.abc import Iterator
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def tk_root() -> Iterator[tk.Tk]:
|
||||
"""The one Tk root of the process, shared by every e2e module.
|
||||
|
||||
A second interpreter right after destroying the first fails to find
|
||||
init.tcl on some Windows Python installs, so there is only one. Each test
|
||||
builds its views on it and destroys their widgets afterwards.
|
||||
"""
|
||||
try:
|
||||
root = tk.Tk()
|
||||
except tk.TclError:
|
||||
pytest.skip("no display available for Tk")
|
||||
yield root
|
||||
root.destroy()
|
||||
@@ -29,6 +29,7 @@ from flash_card.constants import (
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.entities.deck import Deck
|
||||
from flash_card.domain.value_objects.language_pair import LanguagePair
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
@@ -85,18 +86,20 @@ def _shown(view: FlashCardView) -> tuple[str, str]:
|
||||
)
|
||||
|
||||
|
||||
def _destroy_view(root: tk.Tk, view: FlashCardView) -> None:
|
||||
if view.flip_timer is not None:
|
||||
root.after_cancel(view.flip_timer)
|
||||
view.flip_timer = None
|
||||
for widget in (view.canvas, view.wrong_button, view.right_button):
|
||||
widget.destroy()
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def window() -> Iterator[tuple[tk.Tk, FlashCardView]]:
|
||||
# One Tk per module: a second interpreter right after destroying the
|
||||
# first fails to find init.tcl on some Windows Python installs.
|
||||
try:
|
||||
root = tk.Tk()
|
||||
except tk.TclError:
|
||||
pytest.skip("no display available for Tk")
|
||||
view = _build_view(root)
|
||||
root.update_idletasks()
|
||||
yield root, view
|
||||
root.destroy()
|
||||
def window(tk_root: tk.Tk) -> Iterator[tuple[tk.Tk, FlashCardView]]:
|
||||
view = _build_view(tk_root)
|
||||
tk_root.update_idletasks()
|
||||
yield tk_root, view
|
||||
_destroy_view(tk_root, view)
|
||||
|
||||
|
||||
def test_window_has_title_background_and_padding(
|
||||
@@ -306,6 +309,7 @@ def files_view(
|
||||
CsvProgressRepository(progress),
|
||||
NullSpeech(),
|
||||
_first,
|
||||
Level(None),
|
||||
)
|
||||
view = FlashCardView(root, FlashCardViewModel(session))
|
||||
yield view, progress
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
"""End-to-end tests of the level screen and the flow to the first card.
|
||||
|
||||
@file test_level_window.py
|
||||
@brief Builds the real level screen with Tk and checks it against the wireframe.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
import tkinter as tk
|
||||
from collections.abc import Callable, Iterator, Sequence
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from flash_card.constants import (
|
||||
BACKGROUND_COLOR,
|
||||
CARD_WIDTH,
|
||||
DEFAULT_DATA_DIR,
|
||||
FINISHED_MESSAGE,
|
||||
LEVEL_BUTTON_COLOR,
|
||||
LEVEL_BUTTON_FONT,
|
||||
LEVEL_SCREEN_HEIGHT,
|
||||
LEVEL_TITLE,
|
||||
LEVEL_TITLE_FONT,
|
||||
VOCABULARY_FILE_NAME,
|
||||
WINDOW_PADDING,
|
||||
WINDOW_TITLE,
|
||||
)
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.entities.deck import Deck
|
||||
from flash_card.domain.repositories.progress_repository import ProgressRepository
|
||||
from flash_card.domain.repositories.vocabulary_repository import VocabularyRepository
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.csv_vocabulary_repository import (
|
||||
CsvVocabularyRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.progress_file_name import (
|
||||
progress_file_name,
|
||||
)
|
||||
from flash_card.infrastructure.speech.null_speech import NullSpeech
|
||||
from flash_card.presentation import app
|
||||
from flash_card.presentation.features.flash_card.flash_card_view import FlashCardView
|
||||
from flash_card.presentation.features.level.level_view import LevelView
|
||||
from flash_card.presentation.features.level.level_view_model import LevelViewModel
|
||||
|
||||
|
||||
def _last(cards: Sequence[Card]) -> Card:
|
||||
return cards[-1]
|
||||
|
||||
|
||||
def _label(button: tk.Button) -> str:
|
||||
return str(button.cget("text"))
|
||||
|
||||
|
||||
def _word(view: FlashCardView) -> str:
|
||||
return str(view.canvas.itemcget(view.word_text_id, "text"))
|
||||
|
||||
|
||||
def _clear(root: tk.Tk, view: object) -> None:
|
||||
"""Destroy the widgets of whichever screen is shown, and pending timers."""
|
||||
if isinstance(view, FlashCardView):
|
||||
view.close()
|
||||
elif isinstance(view, LevelView):
|
||||
view.destroy()
|
||||
|
||||
|
||||
def repositories_for(
|
||||
folder: Path,
|
||||
) -> Callable[[Path], tuple[VocabularyRepository, ProgressRepository]]:
|
||||
"""Build the CSV repositories of a list, its progress file in folder."""
|
||||
|
||||
def build(list_path: Path) -> tuple[VocabularyRepository, ProgressRepository]:
|
||||
return (
|
||||
CsvVocabularyRepository(list_path),
|
||||
CsvProgressRepository(folder / progress_file_name(list_path)),
|
||||
)
|
||||
|
||||
return build
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def data_dir(tmp_path: Path) -> Path:
|
||||
shutil.copy(DEFAULT_DATA_DIR / VOCABULARY_FILE_NAME, tmp_path)
|
||||
return tmp_path
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def application(tk_root: tk.Tk, data_dir: Path) -> Iterator[app.Application]:
|
||||
instance = app.Application(
|
||||
tk_root,
|
||||
NullSpeech(),
|
||||
_last,
|
||||
repositories_for(data_dir),
|
||||
data_dir / VOCABULARY_FILE_NAME,
|
||||
)
|
||||
yield instance
|
||||
_clear(tk_root, instance.view)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def level_view(tk_root: tk.Tk) -> Iterator[LevelView]:
|
||||
chosen: list[Level] = []
|
||||
view = LevelView(tk_root, LevelViewModel(), chosen.append)
|
||||
tk_root.update_idletasks()
|
||||
yield view
|
||||
view.destroy()
|
||||
|
||||
|
||||
def test_level_screen_shows_title_with_font_on_window_background(
|
||||
level_view: LevelView,
|
||||
) -> None:
|
||||
label = level_view.title_label
|
||||
assert label.cget("text") == LEVEL_TITLE == "Choose your level"
|
||||
assert label.cget("bg") == BACKGROUND_COLOR
|
||||
family, size, style = LEVEL_TITLE_FONT
|
||||
assert str(label.cget("font")).split() == [family, str(size), style]
|
||||
assert level_view.frame.cget("bg") == BACKGROUND_COLOR
|
||||
|
||||
|
||||
def test_level_screen_sets_window_title_background_and_padding(
|
||||
tk_root: tk.Tk,
|
||||
) -> None:
|
||||
tk_root.title("tk")
|
||||
tk_root.config(padx=0, pady=0, bg="white")
|
||||
|
||||
view = LevelView(tk_root, LevelViewModel(), lambda level: None)
|
||||
try:
|
||||
assert tk_root.title() == WINDOW_TITLE
|
||||
assert tk_root.cget("bg") == BACKGROUND_COLOR
|
||||
assert int(str(tk_root.cget("padx"))) == WINDOW_PADDING
|
||||
assert int(str(tk_root.cget("pady"))) == WINDOW_PADDING
|
||||
finally:
|
||||
view.destroy()
|
||||
|
||||
|
||||
def test_level_screen_frame_has_the_card_window_size(level_view: LevelView) -> None:
|
||||
assert level_view.frame.winfo_width() == CARD_WIDTH
|
||||
assert level_view.frame.winfo_height() == LEVEL_SCREEN_HEIGHT
|
||||
|
||||
|
||||
def test_level_screen_shows_three_buttons_in_order(level_view: LevelView) -> None:
|
||||
labels = [_label(button) for button in level_view.buttons]
|
||||
assert labels == ["100 words", "1000 words", "All words"]
|
||||
rows = [int(button.grid_info()["row"]) for button in level_view.buttons]
|
||||
assert rows == [1, 2, 3]
|
||||
|
||||
|
||||
def test_level_buttons_have_equal_width_font_and_colour(
|
||||
level_view: LevelView,
|
||||
) -> None:
|
||||
widths = {int(str(button.cget("width"))) for button in level_view.buttons}
|
||||
assert len(widths) == 1
|
||||
family, size, style = LEVEL_BUTTON_FONT
|
||||
for button in level_view.buttons:
|
||||
assert str(button.cget("font")).split() == [family, str(size), style]
|
||||
assert button.cget("bg") == LEVEL_BUTTON_COLOR
|
||||
assert len({button.winfo_reqwidth() for button in level_view.buttons}) == 1
|
||||
|
||||
|
||||
def test_clicking_a_button_forwards_its_level(tk_root: tk.Tk) -> None:
|
||||
chosen: list[Level] = []
|
||||
view = LevelView(tk_root, LevelViewModel(), chosen.append)
|
||||
for button in view.buttons:
|
||||
button.invoke()
|
||||
view.destroy()
|
||||
assert chosen == [Level(100), Level(1000), Level(None)]
|
||||
|
||||
|
||||
def test_destroy_removes_the_level_frame(tk_root: tk.Tk) -> None:
|
||||
view = LevelView(tk_root, LevelViewModel(), lambda level: None)
|
||||
view.destroy()
|
||||
assert not view.frame.winfo_exists()
|
||||
|
||||
|
||||
def test_clicking_100_words_replaces_screen_with_first_card_of_first_hundred(
|
||||
tk_root: tk.Tk, application: app.Application, data_dir: Path
|
||||
) -> None:
|
||||
first_hundred = (
|
||||
CsvVocabularyRepository(data_dir / VOCABULARY_FILE_NAME).load().cards[:100]
|
||||
)
|
||||
application.show_level_screen()
|
||||
level_view = application.view
|
||||
assert isinstance(level_view, LevelView)
|
||||
|
||||
level_view.buttons[0].invoke()
|
||||
|
||||
card_view = application.view
|
||||
assert isinstance(card_view, FlashCardView)
|
||||
assert not level_view.frame.winfo_exists()
|
||||
assert _word(card_view) == first_hundred[-1].front
|
||||
assert tk_root.title() == WINDOW_TITLE
|
||||
assert int(str(tk_root.cget("padx"))) == WINDOW_PADDING
|
||||
|
||||
|
||||
def test_level_whose_words_are_all_known_shows_the_finished_message(
|
||||
application: app.Application, data_dir: Path
|
||||
) -> None:
|
||||
cards = CsvVocabularyRepository(data_dir / VOCABULARY_FILE_NAME).load().cards
|
||||
pair = CsvVocabularyRepository(data_dir / VOCABULARY_FILE_NAME).load().language_pair
|
||||
CsvProgressRepository(data_dir / "words_to_learn.csv").save(Deck(pair, cards[100:]))
|
||||
application.show_level_screen()
|
||||
level_view = application.view
|
||||
assert isinstance(level_view, LevelView)
|
||||
|
||||
level_view.buttons[0].invoke()
|
||||
|
||||
card_view = application.view
|
||||
assert isinstance(card_view, FlashCardView)
|
||||
assert _word(card_view) == FINISHED_MESSAGE
|
||||
|
||||
|
||||
def test_create_application_with_level_skips_the_level_screen(
|
||||
tk_root: tk.Tk, data_dir: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.setattr(tk, "Tk", lambda: tk_root)
|
||||
|
||||
application = app.create_application(data_dir, False, Level(100))
|
||||
|
||||
try:
|
||||
assert isinstance(application.view, FlashCardView)
|
||||
assert not [c for c in tk_root.winfo_children() if isinstance(c, tk.Frame)]
|
||||
assert str(tk_root.cget("menu"))
|
||||
finally:
|
||||
_clear(tk_root, application.view)
|
||||
tk_root.config(menu="")
|
||||
|
||||
|
||||
def test_create_application_without_level_shows_the_level_screen(
|
||||
tk_root: tk.Tk, data_dir: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.setattr(tk, "Tk", lambda: tk_root)
|
||||
|
||||
application = app.create_application(data_dir, False)
|
||||
|
||||
try:
|
||||
assert isinstance(application.view, LevelView)
|
||||
assert application.root is tk_root
|
||||
assert str(tk_root.cget("menu"))
|
||||
finally:
|
||||
_clear(tk_root, application.view)
|
||||
tk_root.config(menu="")
|
||||
|
||||
|
||||
def test_create_application_with_word_list_keeps_progress_in_the_data_folder(
|
||||
tk_root: tk.Tk, data_dir: Path, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
monkeypatch.setattr(tk, "Tk", lambda: tk_root)
|
||||
other = tmp_path / "other" / "animals.csv"
|
||||
other.parent.mkdir()
|
||||
other.write_text("ms;da\nkucing;kat\n", encoding="utf-8")
|
||||
|
||||
application = app.create_application(data_dir, False, Level(None), other)
|
||||
|
||||
try:
|
||||
view = application.view
|
||||
assert isinstance(view, FlashCardView)
|
||||
assert application.word_list_name == "animals.csv"
|
||||
view.right_button.invoke()
|
||||
assert (data_dir / "words_to_learn_animals.csv").is_file()
|
||||
finally:
|
||||
_clear(tk_root, application.view)
|
||||
tk_root.config(menu="")
|
||||
@@ -0,0 +1,306 @@
|
||||
"""End-to-end tests of the menu bar and its commands on a real Tk window.
|
||||
|
||||
@file test_menu_bar.py
|
||||
@brief Builds the real menu bar with injected dialogs and checks the commands.
|
||||
"""
|
||||
|
||||
import tkinter as tk
|
||||
from collections.abc import Callable, Iterator, Sequence
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from flash_card.constants import CONTACT_URL, WINDOW_TITLE
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.repositories.progress_repository import ProgressRepository
|
||||
from flash_card.domain.repositories.vocabulary_repository import VocabularyRepository
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.csv_vocabulary_repository import (
|
||||
CsvVocabularyRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.progress_file_name import (
|
||||
progress_file_name,
|
||||
)
|
||||
from flash_card.infrastructure.speech.null_speech import NullSpeech
|
||||
from flash_card.presentation import app
|
||||
from flash_card.presentation.features.flash_card.flash_card_view import FlashCardView
|
||||
from flash_card.presentation.features.level.level_view import LevelView
|
||||
from flash_card.presentation.features.menu.menu_view import MenuView
|
||||
from flash_card.presentation.features.menu.menu_view_model import MenuViewModel
|
||||
|
||||
DEFAULT_LIST = "ms;da\naku;mig\nkau;du\n"
|
||||
OTHER_LIST = "ms;da\nkucing;kat\n"
|
||||
CONTACT_LABEL = "Jens Tirsvad Nielsen, Software engineer"
|
||||
|
||||
FILE_INDEX = 0
|
||||
ABOUT_INDEX = 1
|
||||
OPEN, CHANGE_LEVEL, RESET, SEPARATOR, EXIT = range(5)
|
||||
|
||||
|
||||
def _last(cards: Sequence[Card]) -> Card:
|
||||
return cards[-1]
|
||||
|
||||
|
||||
class _Dialogs:
|
||||
"""Records and answers the dialogs the menu view asks."""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.file = ""
|
||||
self.answer = True
|
||||
self.asked_files: list[dict[str, object]] = []
|
||||
self.questions: list[str] = []
|
||||
self.errors: list[tuple[str, str]] = []
|
||||
self.urls: list[str] = []
|
||||
|
||||
def ask_open_file(self, **options: object) -> str:
|
||||
self.asked_files.append(options)
|
||||
return self.file
|
||||
|
||||
def confirm(self, title: str, message: str, **options: object) -> bool:
|
||||
self.questions.append(message)
|
||||
return self.answer
|
||||
|
||||
def show_error(self, title: str, message: str, **options: object) -> str:
|
||||
self.errors.append((title, message))
|
||||
return "ok"
|
||||
|
||||
def open_url(self, url: str) -> bool:
|
||||
self.urls.append(url)
|
||||
return True
|
||||
|
||||
|
||||
class _Window:
|
||||
def __init__(
|
||||
self,
|
||||
root: tk.Tk,
|
||||
application: app.Application,
|
||||
menu: MenuView,
|
||||
dialogs: _Dialogs,
|
||||
folder: Path,
|
||||
) -> None:
|
||||
self.root = root
|
||||
self.application = application
|
||||
self.menu = menu
|
||||
self.dialogs = dialogs
|
||||
self.folder = folder
|
||||
|
||||
|
||||
def _repositories_for(
|
||||
folder: Path,
|
||||
) -> Callable[[Path], tuple[VocabularyRepository, ProgressRepository]]:
|
||||
def build(list_path: Path) -> tuple[VocabularyRepository, ProgressRepository]:
|
||||
return (
|
||||
CsvVocabularyRepository(list_path),
|
||||
CsvProgressRepository(folder / progress_file_name(list_path)),
|
||||
)
|
||||
|
||||
return build
|
||||
|
||||
|
||||
def _close(window: _Window) -> None:
|
||||
view = window.application.view
|
||||
if isinstance(view, FlashCardView):
|
||||
view.close()
|
||||
elif isinstance(view, LevelView):
|
||||
view.destroy()
|
||||
window.root.config(menu="")
|
||||
window.menu.menubar.destroy()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def window(tk_root: tk.Tk, tmp_path: Path) -> Iterator[_Window]:
|
||||
default = tmp_path / "ms-da.csv"
|
||||
default.write_bytes(DEFAULT_LIST.encode("utf-8"))
|
||||
application = app.Application(
|
||||
tk_root, NullSpeech(), _last, _repositories_for(tmp_path), default
|
||||
)
|
||||
dialogs = _Dialogs()
|
||||
menu = MenuView(
|
||||
tk_root,
|
||||
MenuViewModel(),
|
||||
application,
|
||||
ask_open_file=dialogs.ask_open_file,
|
||||
confirm=dialogs.confirm,
|
||||
show_error=dialogs.show_error,
|
||||
open_url=dialogs.open_url,
|
||||
)
|
||||
application.show_level_screen()
|
||||
instance = _Window(tk_root, application, menu, dialogs, tmp_path)
|
||||
yield instance
|
||||
_close(instance)
|
||||
|
||||
|
||||
def _labels(menu: tk.Menu, last: int) -> list[str]:
|
||||
return [
|
||||
"-" if menu.type(i) == "separator" else str(menu.entrycget(i, "label"))
|
||||
for i in range(last + 1)
|
||||
]
|
||||
|
||||
|
||||
def _start_first_level(window: _Window) -> FlashCardView:
|
||||
level_view = window.application.view
|
||||
assert isinstance(level_view, LevelView)
|
||||
level_view.buttons[0].invoke()
|
||||
card_view = window.application.view
|
||||
assert isinstance(card_view, FlashCardView)
|
||||
return card_view
|
||||
|
||||
|
||||
def _word(view: FlashCardView) -> str:
|
||||
return str(view.canvas.itemcget(view.word_text_id, "text"))
|
||||
|
||||
|
||||
def test_menu_bar_has_file_and_about_in_order(window: _Window) -> None:
|
||||
menubar = window.menu.menubar
|
||||
assert str(window.root.cget("menu")) == str(menubar)
|
||||
assert menubar.index("end") == ABOUT_INDEX
|
||||
assert _labels(menubar, ABOUT_INDEX) == ["File", "About"]
|
||||
|
||||
|
||||
def test_file_menu_has_four_entries_and_a_separator_before_exit(
|
||||
window: _Window,
|
||||
) -> None:
|
||||
file_menu = window.menu.file_menu
|
||||
assert file_menu.index("end") == EXIT
|
||||
assert _labels(file_menu, EXIT) == [
|
||||
"Open...",
|
||||
"Change level...",
|
||||
"Reset word list...",
|
||||
"-",
|
||||
"Exit",
|
||||
]
|
||||
assert file_menu.type(SEPARATOR) == "separator"
|
||||
|
||||
|
||||
def test_file_entries_have_mnemonics(window: _Window) -> None:
|
||||
file_menu = window.menu.file_menu
|
||||
assert int(str(file_menu.entrycget(OPEN, "underline"))) == 0
|
||||
assert int(str(file_menu.entrycget(EXIT, "underline"))) == 1
|
||||
assert int(str(window.menu.menubar.entrycget(FILE_INDEX, "underline"))) == 0
|
||||
|
||||
|
||||
def test_about_menu_leads_to_the_contact_entry(window: _Window) -> None:
|
||||
about = window.menu.about_menu
|
||||
assert _labels(about, 0) == ["Contact"]
|
||||
assert about.type(0) == "cascade"
|
||||
contact = window.menu.contact_menu
|
||||
assert contact.index("end") == 0
|
||||
assert _labels(contact, 0) == [CONTACT_LABEL]
|
||||
|
||||
|
||||
def test_open_starts_the_chosen_list_after_a_level_choice(window: _Window) -> None:
|
||||
other = window.folder / "animals.csv"
|
||||
other.write_bytes(OTHER_LIST.encode("utf-8"))
|
||||
window.dialogs.file = str(other)
|
||||
|
||||
window.menu.file_menu.invoke(OPEN)
|
||||
|
||||
assert isinstance(window.application.view, LevelView)
|
||||
assert window.application.word_list_name == "animals.csv"
|
||||
assert _word(_start_first_level(window)) == "kucing"
|
||||
asked = window.dialogs.asked_files[0]
|
||||
assert asked["initialdir"] == str(window.folder)
|
||||
assert ("CSV files", "*.csv") in asked["filetypes"] # type: ignore[operator]
|
||||
assert window.root.title() == WINDOW_TITLE
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content",
|
||||
[None, b"ms;da\n\xff\xfe;x\n", "ms;da\nkøkken;x\n".encode("latin-1")],
|
||||
ids=["missing", "invalid-utf8", "latin-1"],
|
||||
)
|
||||
def test_open_of_an_invalid_file_shows_a_message_and_keeps_the_list(
|
||||
window: _Window, content: bytes | None
|
||||
) -> None:
|
||||
bad = window.folder / "bad.csv"
|
||||
if content is not None:
|
||||
bad.write_bytes(content)
|
||||
window.dialogs.file = str(bad)
|
||||
level_view = window.application.view
|
||||
|
||||
window.menu.file_menu.invoke(OPEN)
|
||||
|
||||
assert len(window.dialogs.errors) == 1
|
||||
assert "bad.csv" in window.dialogs.errors[0][1]
|
||||
assert window.application.view is level_view
|
||||
assert window.application.word_list_name == "ms-da.csv"
|
||||
assert _word(_start_first_level(window)) == "kau"
|
||||
|
||||
|
||||
def test_open_cancelled_changes_nothing(window: _Window) -> None:
|
||||
window.dialogs.file = ""
|
||||
level_view = window.application.view
|
||||
|
||||
window.menu.file_menu.invoke(OPEN)
|
||||
|
||||
assert window.application.view is level_view
|
||||
assert window.application.word_list_name == "ms-da.csv"
|
||||
assert not window.dialogs.errors
|
||||
|
||||
|
||||
def test_change_level_shows_the_level_screen_and_keeps_known_words(
|
||||
window: _Window,
|
||||
) -> None:
|
||||
card_view = _start_first_level(window)
|
||||
card_view.right_button.invoke()
|
||||
progress = window.folder / "words_to_learn.csv"
|
||||
saved = progress.read_bytes()
|
||||
|
||||
window.menu.file_menu.invoke(CHANGE_LEVEL)
|
||||
|
||||
assert isinstance(window.application.view, LevelView)
|
||||
assert card_view.flip_timer is None
|
||||
assert progress.read_bytes() == saved
|
||||
|
||||
|
||||
def test_reset_asks_and_on_yes_removes_progress_and_shows_level_screen(
|
||||
window: _Window,
|
||||
) -> None:
|
||||
card_view = _start_first_level(window)
|
||||
card_view.right_button.invoke()
|
||||
progress = window.folder / "words_to_learn.csv"
|
||||
assert progress.is_file()
|
||||
|
||||
window.menu.file_menu.invoke(RESET)
|
||||
|
||||
assert window.dialogs.questions == [
|
||||
"Start ms-da.csv from the beginning? All words will be to learn again."
|
||||
]
|
||||
assert not progress.exists()
|
||||
assert isinstance(window.application.view, LevelView)
|
||||
assert (window.folder / "ms-da.csv").read_bytes() == DEFAULT_LIST.encode("utf-8")
|
||||
|
||||
|
||||
def test_reset_answered_no_changes_nothing(window: _Window) -> None:
|
||||
card_view = _start_first_level(window)
|
||||
card_view.right_button.invoke()
|
||||
progress = window.folder / "words_to_learn.csv"
|
||||
window.dialogs.answer = False
|
||||
|
||||
window.menu.file_menu.invoke(RESET)
|
||||
|
||||
assert progress.is_file()
|
||||
assert window.application.view is card_view
|
||||
|
||||
|
||||
def test_contact_opens_the_linkedin_page(window: _Window) -> None:
|
||||
window.menu.contact_menu.invoke(0)
|
||||
assert window.dialogs.urls == [CONTACT_URL]
|
||||
assert CONTACT_URL == "https://www.linkedin.com/in/tirsvad74"
|
||||
|
||||
|
||||
def test_exit_cancels_the_timer_and_destroys_the_window(
|
||||
window: _Window, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
destroyed: list[bool] = []
|
||||
monkeypatch.setattr(window.root, "destroy", lambda: destroyed.append(True))
|
||||
card_view = _start_first_level(window)
|
||||
assert card_view.flip_timer is not None
|
||||
|
||||
window.menu.file_menu.invoke(EXIT)
|
||||
|
||||
assert destroyed == [True]
|
||||
assert card_view.flip_timer is None
|
||||
assert window.application.exit_code == 0
|
||||
@@ -0,0 +1,124 @@
|
||||
"""Integration tests of the levels over the real word list and a progress file."""
|
||||
|
||||
from collections.abc import Callable, Sequence
|
||||
from pathlib import Path
|
||||
|
||||
from flash_card.application.use_cases.open_study_session import open_study_session
|
||||
from flash_card.application.use_cases.study_session import StudySession
|
||||
from flash_card.constants import (
|
||||
DEFAULT_DATA_DIR,
|
||||
PROGRESS_FILE_NAME,
|
||||
VOCABULARY_FILE_NAME,
|
||||
)
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.csv_vocabulary_repository import (
|
||||
CsvVocabularyRepository,
|
||||
)
|
||||
from flash_card.infrastructure.speech.null_speech import NullSpeech
|
||||
|
||||
VOCABULARY = CsvVocabularyRepository(DEFAULT_DATA_DIR / VOCABULARY_FILE_NAME)
|
||||
ALL_CARDS = VOCABULARY.load().cards
|
||||
FIRST_HUNDRED = ALL_CARDS[:100]
|
||||
|
||||
Choose = Callable[[Sequence[Card]], Card]
|
||||
|
||||
|
||||
def _first(cards: Sequence[Card]) -> Card:
|
||||
return cards[0]
|
||||
|
||||
|
||||
def _open(folder: Path, level: Level, choose: Choose = _first) -> StudySession:
|
||||
return open_study_session(
|
||||
VOCABULARY,
|
||||
CsvProgressRepository(folder / PROGRESS_FILE_NAME),
|
||||
NullSpeech(),
|
||||
choose,
|
||||
level,
|
||||
)
|
||||
|
||||
|
||||
def _learn_to_the_end(session: StudySession) -> list[Card]:
|
||||
"""Mark every drawn card known until the session is finished."""
|
||||
drawn: list[Card] = []
|
||||
while (card := session.next_card()) is not None:
|
||||
drawn.append(Card(card.front_text, card.back_text))
|
||||
session.mark_known()
|
||||
return drawn
|
||||
|
||||
|
||||
def _saved(folder: Path) -> tuple[Card, ...]:
|
||||
loaded = CsvProgressRepository(folder / PROGRESS_FILE_NAME).load()
|
||||
assert loaded is not None
|
||||
return loaded.cards
|
||||
|
||||
|
||||
def test_word_list_has_one_thousand_distinct_words() -> None:
|
||||
assert len(ALL_CARDS) == 1000
|
||||
assert len(set(ALL_CARDS)) == 1000
|
||||
|
||||
|
||||
def test_level_100_draws_exactly_the_first_hundred_words(tmp_path: Path) -> None:
|
||||
drawn = _learn_to_the_end(_open(tmp_path, Level(100)))
|
||||
assert len(drawn) == 100
|
||||
assert len(set(drawn)) == 100
|
||||
assert set(drawn) == set(FIRST_HUNDRED)
|
||||
|
||||
|
||||
def test_level_100_keeps_the_other_words_in_order_in_the_file(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
_learn_to_the_end(_open(tmp_path, Level(100)))
|
||||
assert _saved(tmp_path) == ALL_CARDS[100:]
|
||||
assert len(_saved(tmp_path)) == 900
|
||||
|
||||
|
||||
def test_level_all_after_level_100_draws_only_the_other_words(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
_learn_to_the_end(_open(tmp_path, Level(100)))
|
||||
drawn = _learn_to_the_end(_open(tmp_path, Level(None)))
|
||||
assert len(drawn) == 900
|
||||
assert set(drawn) == set(ALL_CARDS[100:])
|
||||
assert not set(drawn) & set(FIRST_HUNDRED)
|
||||
|
||||
|
||||
def test_level_1000_equals_all_words_for_this_list(tmp_path: Path) -> None:
|
||||
session_1000 = _open(tmp_path, Level(1000))
|
||||
session_all = _open(tmp_path, Level(None))
|
||||
assert session_1000.remaining_in_level == 1000
|
||||
assert session_all.remaining_in_level == 1000
|
||||
|
||||
|
||||
def test_words_known_at_level_100_stay_known_at_level_1000(tmp_path: Path) -> None:
|
||||
first = _open(tmp_path, Level(100))
|
||||
shown = first.next_card()
|
||||
assert shown is not None
|
||||
first.mark_known()
|
||||
session = _open(tmp_path, Level(1000))
|
||||
assert session.remaining == 999
|
||||
assert session.remaining_in_level == 999
|
||||
|
||||
|
||||
def test_marking_known_at_level_100_keeps_words_outside_the_level(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
session = _open(tmp_path, Level(100))
|
||||
session.next_card()
|
||||
session.mark_known()
|
||||
saved = _saved(tmp_path)
|
||||
assert len(saved) == 999
|
||||
assert saved[-900:] == ALL_CARDS[100:]
|
||||
|
||||
|
||||
def test_level_whose_words_are_all_known_is_finished_at_once(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
_learn_to_the_end(_open(tmp_path, Level(100)))
|
||||
session = _open(tmp_path, Level(100))
|
||||
assert session.remaining_in_level == 0
|
||||
assert session.remaining == 900
|
||||
assert session.next_card() is None
|
||||
@@ -6,6 +6,7 @@ from pathlib import Path
|
||||
from flash_card.application.use_cases.open_study_session import open_study_session
|
||||
from flash_card.application.use_cases.study_session import StudySession
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
@@ -36,6 +37,7 @@ def _open(folder: Path, choose: Choose = _first) -> StudySession:
|
||||
CsvProgressRepository(folder / "words_to_learn.csv"),
|
||||
NullSpeech(),
|
||||
choose,
|
||||
Level(None),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ from flash_card.constants import (
|
||||
)
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.value_objects.language_pair import LanguagePair
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
@@ -34,7 +35,11 @@ def test_open_study_session_yields_card_from_real_file(tmp_path: Path) -> None:
|
||||
cards = repository.load().cards
|
||||
progress = CsvProgressRepository(tmp_path / PROGRESS_FILE_NAME)
|
||||
session = open_study_session(
|
||||
repository, progress, NullSpeech(), lambda candidates: candidates[0]
|
||||
repository,
|
||||
progress,
|
||||
NullSpeech(),
|
||||
lambda candidates: candidates[0],
|
||||
Level(None),
|
||||
)
|
||||
|
||||
card = session.next_card()
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
"""Integration tests: every word list keeps its progress in a file of its own."""
|
||||
|
||||
from collections.abc import Sequence
|
||||
from pathlib import Path
|
||||
|
||||
from flash_card.application.use_cases.open_study_session import open_study_session
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
from flash_card.infrastructure.persistence.csv_progress_repository import (
|
||||
CsvProgressRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.csv_vocabulary_repository import (
|
||||
CsvVocabularyRepository,
|
||||
)
|
||||
from flash_card.infrastructure.persistence.progress_file_name import (
|
||||
progress_file_name,
|
||||
)
|
||||
from flash_card.infrastructure.speech.null_speech import NullSpeech
|
||||
|
||||
MS_DA = "ms;da\naku;mig\nkau;du\nini;denne\n"
|
||||
ANIMALS = "ms;da\nkucing;kat\nanjing;hund\n"
|
||||
|
||||
|
||||
def _first(cards: Sequence[Card]) -> Card:
|
||||
return cards[0]
|
||||
|
||||
|
||||
def _lists(folder: Path) -> tuple[Path, Path]:
|
||||
default = folder / "ms-da.csv"
|
||||
other = folder / "animals.csv"
|
||||
default.write_bytes(MS_DA.encode("utf-8"))
|
||||
other.write_bytes(ANIMALS.encode("utf-8"))
|
||||
return default, other
|
||||
|
||||
|
||||
def _progress(folder: Path, list_path: Path) -> CsvProgressRepository:
|
||||
return CsvProgressRepository(folder / progress_file_name(list_path))
|
||||
|
||||
|
||||
def _know_first_word(folder: Path, list_path: Path) -> str:
|
||||
session = open_study_session(
|
||||
CsvVocabularyRepository(list_path),
|
||||
_progress(folder, list_path),
|
||||
NullSpeech(),
|
||||
_first,
|
||||
Level(None),
|
||||
)
|
||||
card = session.next_card()
|
||||
assert card is not None
|
||||
session.mark_known()
|
||||
return card.front_text
|
||||
|
||||
|
||||
def _remaining(folder: Path, list_path: Path) -> list[str]:
|
||||
deck = _progress(folder, list_path).load()
|
||||
assert deck is not None
|
||||
return [card.front for card in deck.cards]
|
||||
|
||||
|
||||
def test_known_words_of_one_list_never_appear_in_the_other(tmp_path: Path) -> None:
|
||||
default, other = _lists(tmp_path)
|
||||
|
||||
assert _know_first_word(tmp_path, default) == "aku"
|
||||
assert _know_first_word(tmp_path, other) == "kucing"
|
||||
|
||||
assert _remaining(tmp_path, default) == ["kau", "ini"]
|
||||
assert _remaining(tmp_path, other) == ["anjing"]
|
||||
assert (tmp_path / "words_to_learn.csv").is_file()
|
||||
assert (tmp_path / "words_to_learn_animals.csv").is_file()
|
||||
|
||||
|
||||
def test_reset_of_one_list_deletes_only_its_progress_file(tmp_path: Path) -> None:
|
||||
default, other = _lists(tmp_path)
|
||||
_know_first_word(tmp_path, default)
|
||||
_know_first_word(tmp_path, other)
|
||||
|
||||
_progress(tmp_path, other).reset()
|
||||
|
||||
assert not (tmp_path / "words_to_learn_animals.csv").exists()
|
||||
assert _remaining(tmp_path, default) == ["kau", "ini"]
|
||||
|
||||
|
||||
def test_reset_leaves_the_word_list_file_byte_identical(tmp_path: Path) -> None:
|
||||
default, other = _lists(tmp_path)
|
||||
_know_first_word(tmp_path, other)
|
||||
|
||||
_progress(tmp_path, other).reset()
|
||||
|
||||
assert other.read_bytes() == ANIMALS.encode("utf-8")
|
||||
assert default.read_bytes() == MS_DA.encode("utf-8")
|
||||
|
||||
|
||||
def test_delivered_list_keeps_words_to_learn_file_name(tmp_path: Path) -> None:
|
||||
default, _other = _lists(tmp_path)
|
||||
assert progress_file_name(default) == "words_to_learn.csv"
|
||||
@@ -11,6 +11,7 @@ from flash_card.domain.entities.deck import Deck
|
||||
from flash_card.domain.entities.vocabulary import Vocabulary
|
||||
from flash_card.domain.errors.vocabulary_errors import VocabularyNotFoundError
|
||||
from flash_card.domain.value_objects.language_pair import LanguagePair
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
|
||||
|
||||
class _FakeRepository:
|
||||
@@ -52,7 +53,7 @@ def test_open_study_session_builds_session_over_all_cards() -> None:
|
||||
repository = _FakeRepository(Vocabulary(LanguagePair("ms", "da"), cards))
|
||||
|
||||
session = open_study_session(
|
||||
repository, _RecordingProgress(), _SilentSpeech(), _first
|
||||
repository, _RecordingProgress(), _SilentSpeech(), _first, Level(None)
|
||||
)
|
||||
|
||||
assert session.remaining == 2
|
||||
@@ -62,7 +63,11 @@ def test_open_study_session_builds_session_over_all_cards() -> None:
|
||||
def test_open_study_session_propagates_repository_error() -> None:
|
||||
with pytest.raises(VocabularyNotFoundError):
|
||||
open_study_session(
|
||||
_MissingRepository(), _RecordingProgress(), _SilentSpeech(), _first
|
||||
_MissingRepository(),
|
||||
_RecordingProgress(),
|
||||
_SilentSpeech(),
|
||||
_first,
|
||||
Level(None),
|
||||
)
|
||||
|
||||
|
||||
@@ -72,21 +77,83 @@ def test_open_study_session_prefers_saved_progress() -> None:
|
||||
progress = _RecordingProgress(Deck(pair, [Card("kau", "du")]))
|
||||
|
||||
session = open_study_session(
|
||||
_FakeRepository(vocabulary), progress, _SilentSpeech(), _first
|
||||
_FakeRepository(vocabulary), progress, _SilentSpeech(), _first, Level(None)
|
||||
)
|
||||
|
||||
assert session.remaining == 1
|
||||
assert session.next_card() == CardDto("kau", "du", "ms", "da")
|
||||
|
||||
|
||||
def test_open_study_session_skips_vocabulary_when_progress_exists() -> None:
|
||||
progress = _RecordingProgress(Deck(LanguagePair("ms", "da"), []))
|
||||
PAIR = LanguagePair("ms", "da")
|
||||
THREE = (Card("aku", "mig"), Card("kau", "du"), Card("ini", "denne"))
|
||||
|
||||
session = open_study_session(
|
||||
_MissingRepository(), progress, _SilentSpeech(), _first
|
||||
|
||||
def _last(cards: Sequence[Card]) -> Card:
|
||||
return cards[-1]
|
||||
|
||||
|
||||
def test_open_study_session_propagates_error_when_list_is_missing() -> None:
|
||||
progress = _RecordingProgress(Deck(PAIR, []))
|
||||
|
||||
with pytest.raises(VocabularyNotFoundError):
|
||||
open_study_session(
|
||||
_MissingRepository(), progress, _SilentSpeech(), _first, Level(None)
|
||||
)
|
||||
|
||||
assert session.remaining == 0
|
||||
|
||||
def test_open_study_session_limits_draws_to_first_cards_of_level() -> None:
|
||||
session = open_study_session(
|
||||
_FakeRepository(Vocabulary(PAIR, THREE)),
|
||||
_RecordingProgress(),
|
||||
_SilentSpeech(),
|
||||
_last,
|
||||
Level(2),
|
||||
)
|
||||
|
||||
assert session.remaining == 3
|
||||
assert session.remaining_in_level == 2
|
||||
assert session.next_card() == CardDto("kau", "du", "ms", "da")
|
||||
|
||||
|
||||
def test_open_study_session_uses_vocabulary_order_with_saved_progress() -> None:
|
||||
progress = _RecordingProgress(Deck(PAIR, [THREE[2], THREE[1]]))
|
||||
session = open_study_session(
|
||||
_FakeRepository(Vocabulary(PAIR, THREE)),
|
||||
progress,
|
||||
_SilentSpeech(),
|
||||
_first,
|
||||
Level(2),
|
||||
)
|
||||
|
||||
assert session.remaining == 2
|
||||
assert session.remaining_in_level == 1
|
||||
assert session.next_card() == CardDto("kau", "du", "ms", "da")
|
||||
|
||||
|
||||
def test_open_study_session_is_finished_when_level_has_nothing_left() -> None:
|
||||
progress = _RecordingProgress(Deck(PAIR, [THREE[1]]))
|
||||
session = open_study_session(
|
||||
_FakeRepository(Vocabulary(PAIR, THREE)),
|
||||
progress,
|
||||
_SilentSpeech(),
|
||||
_first,
|
||||
Level(1),
|
||||
)
|
||||
|
||||
assert session.next_card() is None
|
||||
assert session.remaining == 1
|
||||
|
||||
|
||||
def test_open_study_session_uses_all_cards_when_level_exceeds_list() -> None:
|
||||
session = open_study_session(
|
||||
_FakeRepository(Vocabulary(PAIR, THREE)),
|
||||
_RecordingProgress(),
|
||||
_SilentSpeech(),
|
||||
_first,
|
||||
Level(1000),
|
||||
)
|
||||
|
||||
assert session.remaining_in_level == 3
|
||||
|
||||
|
||||
def test_open_study_session_never_saves_on_start() -> None:
|
||||
@@ -94,7 +161,7 @@ def test_open_study_session_never_saves_on_start() -> None:
|
||||
progress = _RecordingProgress()
|
||||
|
||||
session = open_study_session(
|
||||
_FakeRepository(vocabulary), progress, _SilentSpeech(), _first
|
||||
_FakeRepository(vocabulary), progress, _SilentSpeech(), _first, Level(None)
|
||||
)
|
||||
session.next_card()
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Tests of the StudySession use case."""
|
||||
|
||||
from collections.abc import Sequence
|
||||
import itertools
|
||||
from collections.abc import Callable, Sequence
|
||||
|
||||
from flash_card.application.dto.card_dto import CardDto
|
||||
from flash_card.application.use_cases.study_session import StudySession
|
||||
@@ -150,3 +151,94 @@ def test_mark_known_does_not_speak_but_following_draw_does() -> None:
|
||||
assert speech.spoken == [("aku", "ms")]
|
||||
session.next_card()
|
||||
assert speech.spoken == [("aku", "ms"), ("kau", "ms")]
|
||||
|
||||
|
||||
C = Card("ini", "denne")
|
||||
D = Card("itu", "den")
|
||||
|
||||
|
||||
def _level_session(
|
||||
deck_cards: Sequence[Card],
|
||||
level_cards: Sequence[Card] | None,
|
||||
choose: Callable[[Sequence[Card]], Card] = _first,
|
||||
progress: _RecordingProgress | None = None,
|
||||
speech: _RecordingSpeech | None = None,
|
||||
) -> StudySession:
|
||||
store = _RecordingProgress() if progress is None else progress
|
||||
voice = _RecordingSpeech() if speech is None else speech
|
||||
return StudySession(Deck(PAIR, deck_cards), choose, store, voice, level_cards)
|
||||
|
||||
|
||||
def _last(cards: Sequence[Card]) -> Card:
|
||||
return cards[-1]
|
||||
|
||||
|
||||
def test_next_card_draws_only_cards_of_the_level_over_many_draws() -> None:
|
||||
chooser = itertools.cycle([_first, _last])
|
||||
session = _level_session(
|
||||
[A, B, C, D], [A, B], choose=lambda cards: next(chooser)(cards)
|
||||
)
|
||||
drawn = {session.next_card() for _ in range(40)}
|
||||
assert drawn == {
|
||||
CardDto("aku", "mig", "ms", "da"),
|
||||
CardDto("kau", "du", "ms", "da"),
|
||||
}
|
||||
|
||||
|
||||
def test_next_card_never_draws_a_card_outside_the_level() -> None:
|
||||
session = _level_session([A, B, C], [B], choose=_last)
|
||||
for _ in range(5):
|
||||
assert session.next_card() == CardDto("kau", "du", "ms", "da")
|
||||
|
||||
|
||||
def test_remaining_counts_whole_deck_and_remaining_in_level_counts_level() -> None:
|
||||
session = _level_session([A, B, C], [A, B])
|
||||
assert session.remaining == 3
|
||||
assert session.remaining_in_level == 2
|
||||
|
||||
|
||||
def test_remaining_in_level_counts_whole_deck_without_level() -> None:
|
||||
assert _level_session([A, B, C], None).remaining_in_level == 3
|
||||
|
||||
|
||||
def test_remaining_in_level_ignores_level_cards_missing_from_deck() -> None:
|
||||
assert _level_session([B], [A, B]).remaining_in_level == 1
|
||||
|
||||
|
||||
def test_mark_known_keeps_cards_outside_the_level_and_saves_whole_deck() -> None:
|
||||
progress = _RecordingProgress()
|
||||
session = _level_session([A, B, C], [A], progress=progress)
|
||||
session.next_card()
|
||||
session.mark_known()
|
||||
assert progress.saved == [(B, C)]
|
||||
assert session.remaining == 2
|
||||
assert session.remaining_in_level == 0
|
||||
|
||||
|
||||
def test_next_card_is_none_when_nothing_of_the_level_is_left() -> None:
|
||||
session = _level_session([B, C], [A])
|
||||
assert session.next_card() is None
|
||||
assert session.current_card is None
|
||||
|
||||
|
||||
def test_session_finishes_after_last_card_of_level_is_known() -> None:
|
||||
session = _level_session([A, B], [A])
|
||||
session.next_card()
|
||||
session.mark_known()
|
||||
assert session.next_card() is None
|
||||
assert session.remaining == 1
|
||||
|
||||
|
||||
def test_next_card_speaks_only_cards_of_the_level() -> None:
|
||||
speech = _RecordingSpeech()
|
||||
session = _level_session([A, B, C], [B], choose=_last, speech=speech)
|
||||
session.next_card()
|
||||
session.next_card()
|
||||
assert speech.spoken == [("kau", "ms"), ("kau", "ms")]
|
||||
|
||||
|
||||
def test_next_card_speaks_nothing_when_level_is_finished() -> None:
|
||||
speech = _RecordingSpeech()
|
||||
session = _level_session([B], [A], speech=speech)
|
||||
session.next_card()
|
||||
assert speech.spoken == []
|
||||
|
||||
@@ -71,3 +71,47 @@ def test_remove_raises_when_card_is_absent() -> None:
|
||||
def test_is_empty_reflects_cards() -> None:
|
||||
assert Deck(PAIR, []).is_empty
|
||||
assert not Deck(PAIR, [A]).is_empty
|
||||
|
||||
|
||||
def test_within_returns_deck_cards_found_in_given_cards_in_deck_order() -> None:
|
||||
c = Card("ini", "denne")
|
||||
deck = Deck(PAIR, [A, B, c])
|
||||
assert deck.within([c, A]) == (A, c)
|
||||
|
||||
|
||||
def test_within_respects_multiplicity() -> None:
|
||||
deck = Deck(PAIR, [A, A, B])
|
||||
assert deck.within([A, B]) == (A, B)
|
||||
assert deck.within([A, A, A]) == (A, A)
|
||||
|
||||
|
||||
def test_within_returns_empty_when_no_card_matches() -> None:
|
||||
assert Deck(PAIR, [A]).within([B]) == ()
|
||||
|
||||
|
||||
def test_within_does_not_change_the_deck() -> None:
|
||||
deck = Deck(PAIR, [A, B])
|
||||
deck.within([A])
|
||||
assert deck.cards == (A, B)
|
||||
|
||||
|
||||
def test_draw_chooses_among_given_candidates_only() -> None:
|
||||
deck = Deck(PAIR, [A, B])
|
||||
assert deck.draw(_first, among=[B]) == B
|
||||
|
||||
|
||||
def test_draw_among_avoids_excluded_when_another_candidate_exists() -> None:
|
||||
c = Card("ini", "denne")
|
||||
deck = Deck(PAIR, [A, B, c])
|
||||
assert deck.draw(_first, exclude=B, among=[B, c]) == c
|
||||
|
||||
|
||||
def test_draw_among_returns_excluded_when_it_is_the_only_candidate() -> None:
|
||||
deck = Deck(PAIR, [A, B])
|
||||
assert deck.draw(_first, exclude=B, among=[B]) == B
|
||||
|
||||
|
||||
def test_draw_among_empty_raises_empty_deck_error() -> None:
|
||||
deck = Deck(PAIR, [A, B])
|
||||
with pytest.raises(EmptyDeckError):
|
||||
deck.draw(_first, among=[])
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
"""Tests of the Level value object."""
|
||||
|
||||
import dataclasses
|
||||
|
||||
import pytest
|
||||
|
||||
from flash_card.domain.entities.card import Card
|
||||
from flash_card.domain.value_objects.level import Level
|
||||
|
||||
CARDS = tuple(Card(f"w{i}", f"v{i}") for i in range(1000))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("limit", [0, -1, -100])
|
||||
def test_level_refuses_limit_not_above_zero(limit: int) -> None:
|
||||
with pytest.raises(ValueError, match="above zero"):
|
||||
Level(limit)
|
||||
|
||||
|
||||
def test_level_accepts_no_limit() -> None:
|
||||
assert Level(None).limit is None
|
||||
|
||||
|
||||
def test_level_is_frozen() -> None:
|
||||
level = Level(100)
|
||||
with pytest.raises(dataclasses.FrozenInstanceError):
|
||||
level.limit = 5 # type: ignore[misc]
|
||||
|
||||
|
||||
def test_first_returns_first_hundred_cards_when_limit_is_100() -> None:
|
||||
assert Level(100).first(CARDS) == CARDS[:100]
|
||||
|
||||
|
||||
def test_first_returns_all_cards_when_there_is_no_limit() -> None:
|
||||
assert Level(None).first(CARDS) == CARDS
|
||||
|
||||
|
||||
def test_first_returns_all_cards_when_limit_exceeds_the_list() -> None:
|
||||
assert Level(5000).first(CARDS) == CARDS
|
||||
|
||||
|
||||
def test_first_returns_empty_when_list_is_empty() -> None:
|
||||
assert Level(100).first(()) == ()
|
||||
@@ -110,3 +110,18 @@ def test_progress_save_then_load_returns_same_cards(tmp_path: Path) -> None:
|
||||
assert deck is not None
|
||||
assert deck.cards == CARDS
|
||||
assert deck.language_pair == PAIR
|
||||
|
||||
|
||||
def test_reset_deletes_the_progress_file(tmp_path: Path) -> None:
|
||||
path = tmp_path / "words_to_learn.csv"
|
||||
path.write_text("ms;da\naku;mig\n", encoding="utf-8")
|
||||
repository = CsvProgressRepository(path)
|
||||
|
||||
repository.reset()
|
||||
|
||||
assert not path.exists()
|
||||
assert repository.load() is None
|
||||
|
||||
|
||||
def test_reset_does_nothing_when_the_file_is_absent(tmp_path: Path) -> None:
|
||||
CsvProgressRepository(tmp_path / "words_to_learn.csv").reset()
|
||||
|
||||
@@ -93,3 +93,18 @@ def test_repository_load_raises_format_error_when_no_card(tmp_path: Path) -> Non
|
||||
path = _write(tmp_path / "w.csv", "ms;da\n")
|
||||
with pytest.raises(VocabularyFormatError):
|
||||
CsvVocabularyRepository(path).load()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"content",
|
||||
[b"ms;da\n\xff\xfe;x\n", "ms;da\nkøkken;x\n".encode("latin-1")],
|
||||
ids=["invalid-utf8", "latin-1"],
|
||||
)
|
||||
def test_read_word_list_raises_format_error_when_not_utf8(
|
||||
tmp_path: Path, content: bytes
|
||||
) -> None:
|
||||
path = tmp_path / "w.csv"
|
||||
path.write_bytes(content)
|
||||
with pytest.raises(VocabularyFormatError, match=r"w\.csv.*not UTF-8") as info:
|
||||
read_word_list(path)
|
||||
assert isinstance(info.value.__cause__, UnicodeDecodeError)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user