Fix slide text scaling and document networks units 1–10.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-09-11 18:18:12 +02:00
commit 1e84a1f663
4 changed files with 88 additions and 39 deletions

106
README.md
View file

@ -30,9 +30,8 @@ GTK 4 interface.
- **Deutsch** is open (round bubble with the German flag) and opens the - **Deutsch** is open (round bubble with the German flag) and opens the
German learning path German learning path
- **Správa počítačových sítí / Computer Network Administration** is open too - **Správa počítačových sítí / Computer Network Administration** is open too
(shown with a Wi-Fi icon) and leads to a 30-unit computer-networks path (shown with a Wi-Fi icon) and leads to a 30-unit computer-networks path;
whose first unit, **Výpočet IP adres / IP Address Calculation**, is **units 1–10 are playable**, units 11–30 are locked placeholders
playable; the rest are locked placeholders
- the remaining subjects are dimmed/locked placeholders until their content - the remaining subjects are dimmed/locked placeholders until their content
is added is added
- layout folds into multiple rows when the window is narrow - layout folds into multiple rows when the window is narrow
@ -60,18 +59,30 @@ GTK 4 interface.
- **Hints & model answers** – in exercises where you write or complete a German - **Hints & model answers** – in exercises where you write or complete a German
sentence the Czech meaning is shown right away as a hint, and clicking the sentence the Czech meaning is shown right away as a hint, and clicking the
check button also reveals the correct German sentence so you can compare check button also reveals the correct German sentence so you can compare
- **Computer networks ("Výpočet IP adres")** – the first networks unit contains - **Computer networks path** – ten unlocked units (theory slides + practice):
a 4-slide walkthrough of IP subnetting (masks, host ranges, VLSM) followed by 1. **Výpočet IP adres / IP Address Calculation** – 4-slide VLSM walkthrough
a practice sheet with four subnetting tasks; each task has a "show solution" and four interactive subnetting tasks (prefix, network, broadcast, host
button with a worked answer key range) with check and “show solution”
2. Základní pojmy a rozdělení sítí – slides + multiple-choice quiz
3. Sítě Klient–Server a Cloud – slides + quiz
4. Přenos dat a jeho zabezpečení – slides + quiz
5. Signály a modulace – slides + quiz
6. Cesta, kanál a okruh – slides + quiz
7. Multiplex a směry přenosu – slides + quiz
8. Přepojování – slides + quiz
9. Vrstevnaté modely a protokoly – slides + quiz
10. Model ISO/OSI a TCP/IP – slides + quiz
Progress for networks is **not** saved yet (unlike Deutsch); the Statistics
page still treats networks as without tracked units
- **Progress tracking** – completed exercises are marked green; progress is - **Progress tracking** – completed exercises are marked green; progress is
saved per unit to `progress/unit1.conf`, `progress/unit2.conf` and saved per unit to `progress/unit1.conf`, `progress/unit2.conf` and
`progress/unit3.conf` and restored on startup `progress/unit3.conf` and restored on startup
- **Statistics** – chart icon in the header opens a per-subject progress - **Statistics** – chart icon in the header opens a per-subject progress
overview: summary totals (exercises done, percent, finished units) at the overview: summary totals (exercises done, percent, finished units) at the
top, then every subject with its own progress bar (subjects without content top, then every subject with its own progress bar (subjects without tracked
yet are shown as locked), and a per-unit breakdown with progress bars for content yet — including networks for now — are shown as locked), and a
Deutsch; numbers update as soon as you finish an exercise per-unit breakdown with progress bars for Deutsch; numbers update as soon
as you finish an exercise
- **Settings** – gear icon in the top-right header opens a panel where you can - **Settings** – gear icon in the top-right header opens a panel where you can
choose: choose:
- **mode**: dark or light, as a segmented control - **mode**: dark or light, as a segmented control
@ -274,21 +285,25 @@ When launched, the application shows the welcome screen. From there:
unit 2 or **"Bei uns zu Hause"** for unit 3, then pick any bubble to start unit 2 or **"Bei uns zu Hause"** for unit 3, then pick any bubble to start
an exercise. Units 2 and 3 are available even if the earlier units are not an exercise. Units 2 and 3 are available even if the earlier units are not
finished yet. finished yet.
5. On the networks path, open **"Výpočet IP adres"** (the first unit) to walk 5. On the networks path, units **1–10** are open. Unit 1 (**Výpočet IP adres**)
through four slides on IP subnetting; the final slide leads to the practice walks through four VLSM slides and then four interactive subnetting tasks
sheet with four subnetting tasks and per-task "show solution" answers. with check / “show solution”. Units 2–10 each have theory slides followed by
a multiple-choice quiz (basic concepts, client–server/cloud, transmission
security, signals, path/channel/circuit, multiplexing, switching, layered
models, ISO/OSI & TCP/IP). Units 11–30 stay locked placeholders.
6. Use the **back button** in the top-left corner to return to the previous 6. Use the **back button** in the top-left corner to return to the previous
screen. screen.
7. Open **Statistiky / Statistics** (chart icon, top-right) to see progress 7. Open **Statistiky / Statistics** (chart icon, top-right) to see progress
grouped per subject (overall totals plus, for Deutsch, a per-unit grouped per subject (overall totals plus, for Deutsch, a per-unit
breakdown). breakdown). Network progress is not tracked in Statistics yet.
8. Open **Nastavení / Settings** (gear icon, top-right) to switch dark/light 8. Open **Nastavení / Settings** (gear icon, top-right) to switch dark/light
mode, pick a color theme, or change the interface language. mode, pick a color theme, or change the interface language.
Units 1–3 are currently implemented. Locked units do nothing – they are German units 1–3 and network units 1–10 are currently implemented. Locked
placeholders until lessons are added. Completed exercises stay green and are nodes do nothing – they are placeholders until lessons are added. Completed
saved per unit to `progress/unit1.conf` / `progress/unit2.conf` / Deutsch exercises stay green and are saved per unit to `progress/unit1.conf` /
`progress/unit3.conf` (created next to the app on first finish). `progress/unit2.conf` / `progress/unit3.conf` (created next to the app on first
finish).
#### Keyboard shortcuts #### Keyboard shortcuts
@ -317,7 +332,8 @@ exercise_u1.c unit 1 ("Neue Freunde") exercises
exercise_u2.c unit 2 ("Aus aller Welt") exercises exercise_u2.c unit 2 ("Aus aller Welt") exercises
exercise_u3.c unit 3 ("Bei uns zu Hause") exercises exercise_u3.c unit 3 ("Bei uns zu Hause") exercises
settings.c settings popover (mode, theme, language) settings.c settings popover (mode, theme, language)
net.c computer-networks path, slides and practice sheet net.c computer-networks path (30 nodes), units 1–10 slides
and exercises (unit 1: VLSM practice; 2–10: MC quizzes)
main.c application entry point and page wiring main.c application entry point and page wiring
style.css GTK stylesheet (palette colors are injected at runtime) style.css GTK stylesheet (palette colors are injected at runtime)
Makefile build & run targets (Linux, macOS, MSYS2); `make bundle` on Windows Makefile build & run targets (Linux, macOS, MSYS2); `make bundle` on Windows
@ -326,6 +342,7 @@ build-windows.bat legacy MSVC build (requires Visual Studio + gvsbuild GTK
run-windows.bat legacy launcher for the MSVC build with GTK DLLs on PATH run-windows.bat legacy launcher for the MSVC build with GTK DLLs on PATH
README.md this file README.md this file
LICENSE GPL-3.0 license LICENSE GPL-3.0 license
assets/ README screenshots (welcome, subjects, German roadmap)
progress/ created at runtime progress/ created at runtime
unit1.conf unit 1 exercise completion state unit1.conf unit 1 exercise completion state
unit2.conf unit 2 exercise completion state unit2.conf unit 2 exercise completion state
@ -364,6 +381,8 @@ German in both languages.
- [x] Unit 1 ("Neue Freunde") – 13 interactive exercises with progress saving - [x] Unit 1 ("Neue Freunde") – 13 interactive exercises with progress saving
- [x] Unit 2 ("Aus aller Welt") – 19 interactive exercises (incl. Hangman) - [x] Unit 2 ("Aus aller Welt") – 19 interactive exercises (incl. Hangman)
- [x] Unit 3 ("Bei uns zu Hause") – 15 interactive exercises - [x] Unit 3 ("Bei uns zu Hause") – 15 interactive exercises
- [x] Computer networks units 1–10 (IP/VLSM + nine theory units with quizzes)
- [ ] Progress tracking / statistics for the networks path
- [ ] Lesson progression and unlock system for the remaining units - [ ] Lesson progression and unlock system for the remaining units
- [ ] Add audio pronunciation features - [ ] Add audio pronunciation features
- [x] Add user settings panel (theme, dark/light mode, language) - [x] Add user settings panel (theme, dark/light mode, language)
@ -412,8 +431,8 @@ moderním GTK 4 rozhraním stylovaným přes CSS.
- **Deutsch** je otevřený (bublina s německou vlajkou) a vede na německou - **Deutsch** je otevřený (bublina s německou vlajkou) a vede na německou
učební cestu učební cestu
- **Správa počítačových sítí** je také otevřená (ikona Wi‑Fi) a vede na cestu - **Správa počítačových sítí** je také otevřená (ikona Wi‑Fi) a vede na cestu
s 30 jednotkami; první jednotka **Výpočet IP adres** je hratelná, zbytek s 30 jednotkami; **jednotky 1–10 jsou hratelné**, 11–30 jsou zamčené
je zatím zamčený placeholdery
- ostatní předměty jsou ztmavené / zamčené placeholdery - ostatní předměty jsou ztmavené / zamčené placeholdery
- při úzkém okně se mapa zalomí do více řad - při úzkém okně se mapa zalomí do více řad
- **Učební cesta** – přizpůsobivá cesta s 10 jednotkami - **Učební cesta** – přizpůsobivá cesta s 10 jednotkami
@ -435,14 +454,26 @@ moderním GTK 4 rozhraním stylovaným přes CSS.
„Was siehst du?“, řazení vět, chybějící písmena) „Was siehst du?“, řazení vět, chybějící písmena)
- **Nápovědy a vzorové odpovědi** – u psaných / doplňovaných vět je hned - **Nápovědy a vzorové odpovědi** – u psaných / doplňovaných vět je hned
český význam; po kontrole se ukáže i správná německá věta český význam; po kontrole se ukáže i správná německá věta
- **Počítačové sítě („Výpočet IP adres“)** – 4 slidová vysvětlení IP subnettingu - **Cesta počítačových sítí** – deset odemčených jednotek (snímky + cvičení):
(masky, rozsahy hostitelů, VLSM) a pak 4 praktické úlohy s tlačítkem 1. **Výpočet IP adres** – 4 snímky VLSM a čtyři interaktivní úlohy
„ukázat řešení“ (prefix, síť, broadcast, rozsah uzlů) s kontrolou a „ukázat řešení“
2. Základní pojmy a rozdělení sítí – snímky + kvíz
3. Sítě Klient–Server a Cloud – snímky + kvíz
4. Přenos dat a jeho zabezpečení – snímky + kvíz
5. Signály a modulace – snímky + kvíz
6. Cesta, kanál a okruh – snímky + kvíz
7. Multiplex a směry přenosu – snímky + kvíz
8. Přepojování – snímky + kvíz
9. Vrstevnaté modely a protokoly – snímky + kvíz
10. Model ISO/OSI a TCP/IP – snímky + kvíz
Postup u sítí se **zatím neukládá** (na rozdíl od Deutsch); ve Statistikách
se sítě stále berou jako předmět bez trackovaných jednotek
- **Ukládání postupu** – hotová cvičení zezelenají; stav se ukládá do - **Ukládání postupu** – hotová cvičení zezelenají; stav se ukládá do
`progress/unit1.conf`, `progress/unit2.conf` a `progress/unit3.conf` a při `progress/unit1.conf`, `progress/unit2.conf` a `progress/unit3.conf` a při
startu se načte zpět startu se načte zpět
- **Statistiky** – ikona grafu v hlavičce ukáže postup po předmětech (součty, - **Statistiky** – ikona grafu v hlavičce ukáže postup po předmětech (součty,
procenta, dokončené jednotky), progress bary u každého předmětu a rozpad procenta, dokončené jednotky), progress bary u každého předmětu (předměty
bez trackovaného obsahu — včetně sítí — jsou zatím jako zamčené) a rozpad
po jednotkách u Deutsch po jednotkách u Deutsch
- **Nastavení** – ozubené kolečko vpravo nahoře: - **Nastavení** – ozubené kolečko vpravo nahoře:
- **režim**: tmavý / světlý - **režim**: tmavý / světlý
@ -645,18 +676,23 @@ Po spuštění se zobrazí úvodní obrazovka. Odtud:
4. Otevřete **"Neue Freunde"** (jednotka 1), **"Aus aller Welt"** (2) nebo 4. Otevřete **"Neue Freunde"** (jednotka 1), **"Aus aller Welt"** (2) nebo
**"Bei uns zu Hause"** (3) a vyberte bublinu cvičení. Jednotky 2 a 3 jdou **"Bei uns zu Hause"** (3) a vyberte bublinu cvičení. Jednotky 2 a 3 jdou
otevřít i bez dokončení předchozích. otevřít i bez dokončení předchozích.
5. Na síťové cestě otevřete **"Výpočet IP adres"** – 4 slidová vysvětlení 5. Na síťové cestě jsou otevřené jednotky **1–10**. Jednotka 1 (**Výpočet IP
subnettingu a pak 4 úlohy s „ukázat řešení“. adres**) má 4 snímky VLSM a pak 4 interaktivní úlohy s kontrolou /
„ukázat řešení“. Jednotky 2–10 mají snímky teorie a kvíz s výběrem
(základní pojmy, klient–server/cloud, zabezpečení přenosu, signály, cesta/
kanál/okruh, multiplex, přepojování, vrstevnaté modely, ISO/OSI a TCP/IP).
Jednotky 11–30 zůstávají zamčené.
6. Tlačítkem **zpět** vlevo nahoře se vrátíte na předchozí obrazovku. 6. Tlačítkem **zpět** vlevo nahoře se vrátíte na předchozí obrazovku.
7. **Statistiky** (ikona grafu vpravo nahoře) ukazují postup po předmětech 7. **Statistiky** (ikona grafu vpravo nahoře) ukazují postup po předmětech
(u Deutsch i po jednotkách). (u Deutsch i po jednotkách). Postup sítí se ve Statistikách zatím
nesleduje.
8. **Nastavení** (ozubené kolečko) – tmavý/světlý režim, barevné téma nebo 8. **Nastavení** (ozubené kolečko) – tmavý/světlý režim, barevné téma nebo
jazyk rozhraní. jazyk rozhraní.
Jednotky 1–3 jsou hotové. Zamčené jednotky nic nedělají – jsou to placeholdery. Hotové jsou německé jednotky 1–3 a síťové jednotky 1–10. Zamčené uzly nic
Dokončená cvičení zůstanou zelená a ukládají se do `progress/unit1.conf` / nedělají – jsou to placeholdery. Dokončená německá cvičení zůstanou zelená a
`progress/unit2.conf` / `progress/unit3.conf` (vzniknou vedle aplikace při ukládají se do `progress/unit1.conf` / `progress/unit2.conf` /
prvním dokončení). `progress/unit3.conf` (vzniknou vedle aplikace při prvním dokončení).
#### Klávesové zkratky #### Klávesové zkratky
@ -685,7 +721,8 @@ exercise_u1.c cvičení jednotky 1 („Neue Freunde“)
exercise_u2.c cvičení jednotky 2 („Aus aller Welt“) exercise_u2.c cvičení jednotky 2 („Aus aller Welt“)
exercise_u3.c cvičení jednotky 3 („Bei uns zu Hause“) exercise_u3.c cvičení jednotky 3 („Bei uns zu Hause“)
settings.c panel nastavení (režim, téma, jazyk) settings.c panel nastavení (režim, téma, jazyk)
net.c cesta počítačových sítí, snímky a cvičení net.c cesta počítačových sítí (30 uzlů), jednotky 1–10
(1: VLSM cvičení; 2–10: kvízy s výběrem)
main.c vstupní bod aplikace a zapojení stránek main.c vstupní bod aplikace a zapojení stránek
style.css GTK styl (barvy palety se vkládají za běhu) style.css GTK styl (barvy palety se vkládají za běhu)
Makefile build & run (Linux, macOS, MSYS2); `make bundle` na Windows Makefile build & run (Linux, macOS, MSYS2); `make bundle` na Windows
@ -694,6 +731,7 @@ build-windows.bat legacy MSVC build (vyžaduje Visual Studio + gvsbuild GT
run-windows.bat legacy spouštění MSVC buildu s GTK DLL na PATH run-windows.bat legacy spouštění MSVC buildu s GTK DLL na PATH
README.md tento soubor README.md tento soubor
LICENSE licence GPL-3.0 LICENSE licence GPL-3.0
assets/ screenshoty do README (úvod, předměty, německá cesta)
progress/ vzniká za běhu progress/ vzniká za běhu
unit1.conf stav cvičení jednotky 1 unit1.conf stav cvičení jednotky 1
unit2.conf stav cvičení jednotky 2 unit2.conf stav cvičení jednotky 2
@ -729,6 +767,8 @@ rozhraní.
- [x] Jednotka 1 („Neue Freunde“) – 13 interaktivních cvičení s ukládáním - [x] Jednotka 1 („Neue Freunde“) – 13 interaktivních cvičení s ukládáním
- [x] Jednotka 2 („Aus aller Welt“) – 19 cvičení (včetně Hangmana) - [x] Jednotka 2 („Aus aller Welt“) – 19 cvičení (včetně Hangmana)
- [x] Jednotka 3 („Bei uns zu Hause“) – 15 cvičení - [x] Jednotka 3 („Bei uns zu Hause“) – 15 cvičení
- [x] Počítačové sítě: jednotky 1–10 (IP/VLSM + 9 teoretických s kvízy)
- [ ] Ukládání postupu / statistiky pro síťovou cestu
- [ ] Postupné odemykání zbývajících jednotek - [ ] Postupné odemykání zbývajících jednotek
- [ ] Audio / výslovnost - [ ] Audio / výslovnost
- [x] Panel nastavení (téma, režim, jazyk) - [x] Panel nastavení (téma, režim, jazyk)

View file

@ -984,6 +984,7 @@ GtkWidget *build_exercise_page(UnitCtx *u, int n);
void net_paragraph(GtkWidget *box, const char *text); void net_paragraph(GtkWidget *box, const char *text);
void net_heading(GtkWidget *box, const char *text); void net_heading(GtkWidget *box, const char *text);
void net_note_font(GtkWidget *l, int px); void net_note_font(GtkWidget *l, int px);
void net_rescale_notes_at(int w);
void net_rescale_notes(void); void net_rescale_notes(void);
gboolean net_note_tick(GtkWidget *w, GdkFrameClock *clock, gboolean net_note_tick(GtkWidget *w, GdkFrameClock *clock,
gpointer data); gpointer data);

16
net.c
View file

@ -4,6 +4,8 @@
NetLesson net_lessons[NET_LESSONS] = { NetLesson net_lessons[NET_LESSONS] = {
/* UI unit N maps to lesson content: unit 1 = IP/VLSM (extra);
* units 2–10 = source topics 01–09 (Základní pojmy … ISO/OSI). */
{ .n_slides = NET_SLIDES, .unit_page = "netunit1", .ex_page = "netex" }, { .n_slides = NET_SLIDES, .unit_page = "netunit1", .ex_page = "netex" },
{ .n_slides = NET2_SLIDES, .unit_page = "netunit2", .ex_page = "netex2" }, { .n_slides = NET2_SLIDES, .unit_page = "netunit2", .ex_page = "netex2" },
{ .n_slides = NET3_SLIDES, .unit_page = "netunit3", .ex_page = "netex3" }, { .n_slides = NET3_SLIDES, .unit_page = "netunit3", .ex_page = "netex3" },
@ -58,8 +60,7 @@ void net_note_font(GtkWidget *l, int px) {
pango_attr_list_unref(attrs); pango_attr_list_unref(attrs);
} }
void net_rescale_notes(void) { void net_rescale_notes_at(int w) {
int w = net_note_host ? gtk_widget_get_allocated_width(net_note_host) : 0;
int body, head, kick; int body, head, kick;
if (!net_note_kicks) if (!net_note_kicks)
@ -74,11 +75,18 @@ void net_rescale_notes(void) {
kick = body - 3; kick = body - 3;
if (kick < 11) kick = 11; if (kick < 11) kick = 11;
for (guint i = 0; i < net_note_kicks->len; i++) { for (guint i = 0; i < net_note_kicks->len; i++)
net_note_font(g_array_index(net_note_kicks, GtkWidget *, i), kick); net_note_font(g_array_index(net_note_kicks, GtkWidget *, i), kick);
for (guint i = 0; i < net_note_titles->len; i++)
net_note_font(g_array_index(net_note_titles, GtkWidget *, i), head); net_note_font(g_array_index(net_note_titles, GtkWidget *, i), head);
for (guint i = 0; i < net_note_bodies->len; i++)
net_note_font(g_array_index(net_note_bodies, GtkWidget *, i), body); net_note_font(g_array_index(net_note_bodies, GtkWidget *, i), body);
} }
void net_rescale_notes(void) {
int w = net_note_host ? gtk_widget_get_allocated_width(net_note_host) : 0;
net_rescale_notes_at(w);
} }
gboolean net_note_tick(GtkWidget *w, GdkFrameClock *clock, gboolean net_note_tick(GtkWidget *w, GdkFrameClock *clock,
@ -89,7 +97,7 @@ gboolean net_note_tick(GtkWidget *w, GdkFrameClock *clock,
(void)data; (void)data;
if (width != net_note_last_w) { if (width != net_note_last_w) {
net_note_last_w = width; net_note_last_w = width;
net_rescale_notes(); net_rescale_notes_at(width);
} }
return G_SOURCE_CONTINUE; return G_SOURCE_CONTINUE;
} }

View file

@ -5,7 +5,7 @@
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
/* Index 0 is Deutsch and is the only unlocked subject for now. */ /* Index 0 (Deutsch) and NET_SUBJ (computer networks) are unlocked. */
const char *sub_keys[NUM_SUBJECTS] = { const char *sub_keys[NUM_SUBJECTS] = {
"Deutsch", "Deutsch",
"Správa počítačových sítí", "Správa počítačových sítí",