Add year-3 civics lessons on the individual and the law.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-10-02 22:52:39 +02:00
commit 0ee2f8e960
26 changed files with 2321 additions and 23 deletions

View file

@ -51,6 +51,7 @@ extern char *app_progress_net;
extern char *app_progress_hw;
extern char *app_progress_on;
extern char *app_progress_on2;
extern char *app_progress_on3;
extern char *app_progress_mluvnice;
extern char *app_progress_cetba;
#define PROGRESS_DIR app_progress_dir
@ -62,6 +63,7 @@ extern char *app_progress_cetba;
#define PROGRESS_HW app_progress_hw
#define PROGRESS_ON app_progress_on
#define PROGRESS_ON2 app_progress_on2
#define PROGRESS_ON3 app_progress_on3
#define NODE_SIZE 88.0
#define PATH_SPAC 240.0
#define ROAD_MX 150.0 /* horizontal canvas margin */
@ -123,6 +125,8 @@ extern char *app_progress_cetba;
#define ON_LESSONS 17
#define ON2_UNITS 16
#define ON2_LESSONS 16
#define ON3_UNITS 16
#define ON3_LESSONS 16
#define HW_SLIDES 3
#define HW2_SLIDES 6
#define HW3_SLIDES 2
@ -767,6 +771,8 @@ extern NetLesson on_lessons[ON_LESSONS];
extern GtkWidget *on_nodes[ON_UNITS];
extern NetLesson on2_lessons[ON2_LESSONS];
extern GtkWidget *on2_nodes[ON2_UNITS];
extern NetLesson on3_lessons[ON3_LESSONS];
extern GtkWidget *on3_nodes[ON3_UNITS];
extern GtkWidget *net_note_host;
extern int net_note_last_w;
extern GtkWidget *net_scroll;
@ -872,6 +878,14 @@ void on2_rail_theme_reset(void);
void on2_lessons_apply_lang(void);
GtkWidget *build_on2map_page(void);
void add_on2_pages(GtkStack *stack);
void on3_load_progress(void);
void on3_save_progress(void);
void mark_on3_done(int lesson_id);
void refresh_on3_completion_ui(void);
void on3_rail_theme_reset(void);
void on3_lessons_apply_lang(void);
GtkWidget *build_on3map_page(void);
void add_on3_pages(GtkStack *stack);
void czech_rail_theme_reset(void);
void hw_lessons_apply_lang(void);
GtkWidget *build_hwyears_page(void);

View file

@ -902,6 +902,104 @@ const TrEntry tr_ui[] = {
{"on2_ex16_title", "Kvíz: média", "Quiz: the media"},
{"on2_quiz16_head", "Kvíz k médiím",
"Quiz on the media"},
{"on3_sub", "Člověk a právo. Vyberte lekci na cestě.",
"The individual and the law. Pick a lesson on the path."},
{"on3_unit1", "Právo a spravedlnost", "Law and justice"},
{"on3_unit1_sub", "2 snímky o právu a spravedlnosti a pak kvíz.",
"2 slides on law and justice, then a quiz."},
{"on3_ex1_title", "Kvíz: právo a spravedlnost", "Quiz: law and justice"},
{"on3_quiz1_head", "Kvíz k právu a spravedlnosti",
"Quiz on law and justice"},
{"on3_unit2", "Právní stát", "The rule of law"},
{"on3_unit2_sub", "2 snímky o právním státu a pak kvíz.",
"2 slides on the rule of law, then a quiz."},
{"on3_ex2_title", "Kvíz: právní stát", "Quiz: the rule of law"},
{"on3_quiz2_head", "Kvíz k právnímu státu",
"Quiz on the rule of law"},
{"on3_unit3", "Právní řád", "The legal order"},
{"on3_unit3_sub", "2 snímky o předpisech a odvětvích práva a pak kvíz.",
"2 slides on legal rules and branches of law, then a quiz."},
{"on3_ex3_title", "Kvíz: právní řád", "Quiz: the legal order"},
{"on3_quiz3_head", "Kvíz k právnímu řádu",
"Quiz on the legal order"},
{"on3_unit4", "Osoby a svéprávnost", "Persons and legal capacity"},
{"on3_unit4_sub", "2 snímky o osobách, svéprávnosti a odpovědnosti a pak kvíz.",
"2 slides on persons, capacity and liability, then a quiz."},
{"on3_ex4_title", "Kvíz: osoby a svéprávnost", "Quiz: persons and capacity"},
{"on3_quiz4_head", "Kvíz k osobám a svéprávnosti",
"Quiz on persons and capacity"},
{"on3_unit5", "Vlastnictví a škoda", "Ownership and damage"},
{"on3_unit5_sub", "2 snímky o vlastnictví, duševním vlastnictví a škodě a pak kvíz.",
"2 slides on ownership, intellectual property and damage, then a quiz."},
{"on3_ex5_title", "Kvíz: vlastnictví a škoda", "Quiz: ownership and damage"},
{"on3_quiz5_head", "Kvíz k vlastnictví a škodě",
"Quiz on ownership and damage"},
{"on3_unit6", "Smlouvy", "Contracts"},
{"on3_unit6_sub", "2 snímky o smlouvách a pak kvíz.",
"2 slides on contracts, then a quiz."},
{"on3_ex6_title", "Kvíz: smlouvy", "Quiz: contracts"},
{"on3_quiz6_head", "Kvíz ke smlouvám",
"Quiz on contracts"},
{"on3_unit7", "Spotřebitel", "The consumer"},
{"on3_unit7_sub", "2 snímky o reklamaci a odstoupení od smlouvy a pak kvíz.",
"2 slides on complaints and withdrawing from a contract, then a quiz."},
{"on3_ex7_title", "Kvíz: spotřebitel", "Quiz: the consumer"},
{"on3_quiz7_head", "Kvíz ke spotřebiteli",
"Quiz on the consumer"},
{"on3_unit8", "Dědictví", "Inheritance"},
{"on3_unit8_sub", "2 snímky o dědění a dluzích a pak kvíz.",
"2 slides on inheritance and debts, then a quiz."},
{"on3_ex8_title", "Kvíz: dědictví", "Quiz: inheritance"},
{"on3_quiz8_head", "Kvíz k dědictví",
"Quiz on inheritance"},
{"on3_unit9", "Rodina a právo", "Family and the law"},
{"on3_unit9_sub", "2 snímky o manželství, partnerství a péči o dítě a pak kvíz.",
"2 slides on marriage, partnership and care of a child, then a quiz."},
{"on3_ex9_title", "Kvíz: rodina a právo", "Quiz: family and the law"},
{"on3_quiz9_head", "Kvíz k rodině a právu",
"Quiz on family and the law"},
{"on3_unit10", "Pracovní právo", "Employment law"},
{"on3_unit10_sub", "2 snímky o pracovní smlouvě, výpovědi a bezpečnosti a pak kvíz.",
"2 slides on the employment contract, notice and safety, then a quiz."},
{"on3_ex10_title", "Kvíz: pracovní právo", "Quiz: employment law"},
{"on3_quiz10_head", "Kvíz k pracovnímu právu",
"Quiz on employment law"},
{"on3_unit11", "Soustava soudů", "The court system"},
{"on3_unit11_sub", "2 snímky o soustavě soudů a pak kvíz.",
"2 slides on the court system, then a quiz."},
{"on3_ex11_title", "Kvíz: soustava soudů", "Quiz: the court system"},
{"on3_quiz11_head", "Kvíz k soustavě soudů",
"Quiz on the court system"},
{"on3_unit12", "Soudní a správní řízení", "Court and administrative proceedings"},
{"on3_unit12_sub", "2 snímky o žalobě, odvolání a správním řízení a pak kvíz.",
"2 slides on lawsuits, appeals and administrative proceedings, then a quiz."},
{"on3_ex12_title", "Kvíz: řízení", "Quiz: proceedings"},
{"on3_quiz12_head", "Kvíz k soudnímu a správnímu řízení",
"Quiz on court and administrative proceedings"},
{"on3_unit13", "Právnická povolání", "Legal professions"},
{"on3_unit13_sub", "2 snímky o soudci, žalobci, advokátovi, notáři a exekutorovi a pak kvíz.",
"2 slides on judges, prosecutors, lawyers, notaries and bailiffs, then a quiz."},
{"on3_ex13_title", "Kvíz: právnická povolání", "Quiz: legal professions"},
{"on3_quiz13_head", "Kvíz k právnickým povoláním",
"Quiz on legal professions"},
{"on3_unit14", "Trestný čin a přestupek", "Crimes and misdemeanours"},
{"on3_unit14_sub", "2 snímky o trestném činu, přestupku a vině a pak kvíz.",
"2 slides on crimes, misdemeanours and guilt, then a quiz."},
{"on3_ex14_title", "Kvíz: trestný čin a přestupek", "Quiz: crimes and misdemeanours"},
{"on3_quiz14_head", "Kvíz k trestnému činu a přestupku",
"Quiz on crimes and misdemeanours"},
{"on3_unit15", "Tresty a trestní řízení", "Punishments and criminal procedure"},
{"on3_unit15_sub", "2 snímky o trestech, vězení a průběhu řízení a pak kvíz.",
"2 slides on punishments, prison and the course of a case, then a quiz."},
{"on3_ex15_title", "Kvíz: tresty a řízení", "Quiz: punishments and procedure"},
{"on3_quiz15_head", "Kvíz k trestům a trestnímu řízení",
"Quiz on punishments and criminal procedure"},
{"on3_unit16", "Mladiství, oběť a svědek", "Juveniles, victims and witnesses"},
{"on3_unit16_sub", "2 snímky o mladistvých a o tom, co dělat jako oběť nebo svědek, a pak kvíz.",
"2 slides on juveniles and what to do as a victim or witness, then a quiz."},
{"on3_ex16_title", "Kvíz: mladiství, oběť a svědek", "Quiz: juveniles, victims and witnesses"},
{"on3_quiz16_head", "Kvíz k mladistvým, oběti a svědkovi",
"Quiz on juveniles, victims and witnesses"},
{"czech_sub", "Vyberte oblast a začněte procvičovat.",
"Pick an area and start practicing."},
{"Literatura", "Literatura", "Literature"},
@ -1927,6 +2025,7 @@ void net_lessons_apply_lang(void);
void hw_lessons_apply_lang(void);
void on_lessons_apply_lang(void);
void on2_lessons_apply_lang(void);
void on3_lessons_apply_lang(void);
void net_rail_theme_reset(void);
void apply_language(void) {
@ -1943,5 +2042,6 @@ void apply_language(void) {
hw_lessons_apply_lang();
on_lessons_apply_lang();
on2_lessons_apply_lang();
on3_lessons_apply_lang();
search_apply_lang();
}

View file

@ -386,6 +386,7 @@ static gboolean run_smoke_test(gpointer data) {
static const char *pages[] = {
"welcome", "subjects", "roadmap", "stats",
"netyears", "netmap", "hwyears", "hwmap", "onyears", "onmap", "on2map",
"on3map",
"czechmap",
"mluvnice", "readinglist",
"cetba1984", "cetba1984quiz", "cetba1984dej",
@ -399,6 +400,7 @@ static gboolean run_smoke_test(gpointer data) {
"hwunit29", "hwex29",
"onunit1", "onex1", "onunit17", "onex17",
"on2unit1", "on2ex1", "on2unit16", "on2ex16",
"on3unit1", "on3ex1", "on3unit16", "on3ex16",
"unit1", "unit2", "unit3",
"u1e1", "u1e13", "u2e1", "u2e19", "u3e1", "u3e15",
"u1vocab", "u2vocab", "u3vocab",
@ -514,6 +516,8 @@ void activate(GtkApplication *app, gpointer user_data) {
add_on_pages(main_stack);
gtk_stack_add_named(main_stack, build_on2map_page(), "on2map");
add_on2_pages(main_stack);
gtk_stack_add_named(main_stack, build_on3map_page(), "on3map");
add_on3_pages(main_stack);
gtk_stack_add_named(main_stack, build_czechmap_page(), "czechmap");
gtk_stack_add_named(main_stack, build_mluvnice_page(), "mluvnice");
for (int n = 1; n <= 20; n++) {

View file

@ -3,8 +3,7 @@
/* Year 1 of Občanská nauka.
* Thematic unit "Člověk v lidském společenství" from the SOV framework
* (společenskovědní vzdělávání) and the MŠMT model syllabus, which schools
* place in the first year. Year 2 is the citizen and the state; years 3 and 4
* stay locked. */
* place in the first year. Years 2 and 3 are open; year 4 stays locked. */
#define ON_ENTRY(n) \
{ .n_slides = 2, .unit_page = "onunit" #n, .ex_page = "onex" #n }
@ -413,7 +412,7 @@ GtkWidget *build_onyears_page(void) {
GtkWidget *scroll;
GtkWidget *list;
int y;
static const char *targets[] = {"onmap", "on2map", NULL, NULL};
static const char *targets[] = {"onmap", "on2map", "on3map", NULL};
page = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_hexpand(page, TRUE);

View file

@ -3,8 +3,8 @@
/* Year 2 of Občanská nauka.
* Thematic unit "Člověk jako občan v demokratickém státě" from the MŠMT
* model syllabus (č.j. 18 396/2002-23) and the SOV civic framework, which
* schools place in the second year. Law, the economy and philosophy stay
* in later years. */
* schools place in the second year. Law is year 3; the economy and
* philosophy stay in the fourth year. */
#define ON2_ENTRY(n) \
{ .n_slides = 2, .unit_page = "on2unit" #n, .ex_page = "on2ex" #n }

1910
src/obcanka3.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -56,6 +56,7 @@ void load_progress(void) {
hw_load_progress();
on_load_progress();
on2_load_progress();
on3_load_progress();
}
/* Redraw the exercise rails of every unit that already has a page. */
@ -425,8 +426,8 @@ void mark_on_done(int lesson_id) {
}
void progress_for_on(ProgressSum *out) {
out->total_ex += ON_LESSONS + ON2_LESSONS;
out->open_units += ON_LESSONS + ON2_LESSONS;
out->total_ex += ON_LESSONS + ON2_LESSONS + ON3_LESSONS;
out->open_units += ON_LESSONS + ON2_LESSONS + ON3_LESSONS;
for (int i = 0; i < ON_LESSONS; i++) {
if (on_lessons[i].done) {
out->done_ex++;
@ -439,6 +440,12 @@ void progress_for_on(ProgressSum *out) {
out->done_units++;
}
}
for (int i = 0; i < ON3_LESSONS; i++) {
if (on3_lessons[i].done) {
out->done_ex++;
out->done_units++;
}
}
}
void on2_load_progress(void) {
@ -520,3 +527,83 @@ void mark_on2_done(int lesson_id) {
refresh_on2_completion_ui();
refresh_stats_ui();
}
void on3_load_progress(void) {
GKeyFile *kf = g_key_file_new();
GError *err = NULL;
if (!g_key_file_load_from_file(kf, PROGRESS_ON3, G_KEY_FILE_NONE, &err)) {
if (err)
g_error_free(err);
g_key_file_free(kf);
return;
}
for (int i = 0; i < ON3_LESSONS; i++) {
gchar key[8];
g_snprintf(key, sizeof(key), "%d", i + 1);
on3_lessons[i].done = g_key_file_get_boolean(kf, "done", key, NULL);
}
g_key_file_free(kf);
}
void on3_save_progress(void) {
GKeyFile *kf = g_key_file_new();
for (int i = 0; i < ON3_LESSONS; i++) {
gchar key[8];
g_snprintf(key, sizeof(key), "%d", i + 1);
g_key_file_set_boolean(kf, "done", key, on3_lessons[i].done);
}
if (g_mkdir_with_parents(PROGRESS_DIR, 0755) != 0) {
g_key_file_free(kf);
return;
}
gchar *data = g_key_file_to_data(kf, NULL, NULL);
g_key_file_free(kf);
if (data) {
GError *err = NULL;
g_file_set_contents(PROGRESS_ON3, data, -1, &err);
if (err)
g_error_free(err);
g_free(data);
}
}
void refresh_on3_completion_ui(void) {
for (int i = 0; i < ON3_LESSONS; i++) {
GtkWidget *node = on3_nodes[i];
GtkWidget *icon = on3_lessons[i].done_icon;
if (!node)
continue;
if (on3_lessons[i].done) {
gtk_widget_remove_css_class(node, "current");
gtk_widget_add_css_class(node, "done");
if (icon)
gtk_widget_set_visible(icon, TRUE);
} else {
gtk_widget_remove_css_class(node, "done");
gtk_widget_add_css_class(node, "current");
if (icon)
gtk_widget_set_visible(icon, FALSE);
}
}
}
void mark_on3_done(int lesson_id) {
if (lesson_id < 0 || lesson_id >= ON3_LESSONS)
return;
if (on3_lessons[lesson_id].done)
return;
on3_lessons[lesson_id].done = TRUE;
on3_save_progress();
refresh_on3_completion_ui();
refresh_stats_ui();
}

View file

@ -204,7 +204,7 @@ static void catalog_rebuild(void) {
catalog_add_key("on_year1", "search_lesson", "onmap", FALSE, 1, "rocnik");
catalog_add_key("on_year2", "search_lesson", "on2map", FALSE, 1, "rocnik");
catalog_add_key("on_year3", "search_lesson", "onyears", TRUE, 1, "rocnik");
catalog_add_key("on_year3", "search_lesson", "on3map", FALSE, 1, "rocnik");
catalog_add_key("on_year4", "search_lesson", "onyears", TRUE, 1, "rocnik");
for (i = 1; i <= ON_LESSONS; i++) {
g_snprintf(key, sizeof(key), "on_unit%d", i);
@ -220,6 +220,13 @@ static void catalog_rebuild(void) {
g_snprintf(page, sizeof(page), "on2ex%d", i);
catalog_add(tr(key), tr("search_exercise"), page, FALSE, 3, "kviz quiz");
}
for (i = 1; i <= ON3_LESSONS; i++) {
g_snprintf(key, sizeof(key), "on3_unit%d", i);
g_snprintf(page, sizeof(page), "on3unit%d", i);
catalog_add_key(key, "search_lesson", page, FALSE, 2, "obcanka");
g_snprintf(page, sizeof(page), "on3ex%d", i);
catalog_add(tr(key), tr("search_exercise"), page, FALSE, 3, "kviz quiz");
}
catalog_add_key("Český jazyk a literatura", "search_subject",
"czechmap", FALSE, 0, "cestina czech");

View file

@ -428,6 +428,7 @@ void apply_theme(void) {
hw_rail_theme_reset();
on_rail_theme_reset();
on2_rail_theme_reset();
on3_rail_theme_reset();
czech_rail_theme_reset();
book_rail_theme_reset();
}

View file

@ -22,6 +22,7 @@ char *app_progress_net;
char *app_progress_hw;
char *app_progress_on;
char *app_progress_on2;
char *app_progress_on3;
char *app_progress_mluvnice;
char *app_progress_cetba;
@ -162,6 +163,7 @@ static void set_progress_paths(const char *write_root) {
g_free(app_progress_hw);
g_free(app_progress_on);
g_free(app_progress_on2);
g_free(app_progress_on3);
g_free(app_progress_mluvnice);
g_free(app_progress_cetba);
@ -174,6 +176,7 @@ static void set_progress_paths(const char *write_root) {
app_progress_hw = g_build_filename(app_progress_dir, "hw.conf", NULL);
app_progress_on = g_build_filename(app_progress_dir, "on.conf", NULL);
app_progress_on2 = g_build_filename(app_progress_dir, "on2.conf", NULL);
app_progress_on3 = g_build_filename(app_progress_dir, "on3.conf", NULL);
app_progress_mluvnice = g_build_filename(app_progress_dir, "mluvnice.conf", NULL);
app_progress_cetba = g_build_filename(app_progress_dir, "cetba.conf", NULL);
}