diff --git a/.gamification.json b/.gamification.json index 15de29d..b7035af 100644 --- a/.gamification.json +++ b/.gamification.json @@ -10,5 +10,5 @@ "streak_tage": 1, "letzter_aktiver_tag": "2026-08-29", "historie": [], - "zuletzt_aktualisiert": "2026-08-29T14:51:01.563840" + "zuletzt_aktualisiert": "2026-08-29T14:53:37.686061" } \ No newline at end of file diff --git a/00_fehlersuche_und_grundlagen/index.html b/00_fehlersuche_und_grundlagen/index.html index 87e6534..ffd2baa 100644 --- a/00_fehlersuche_und_grundlagen/index.html +++ b/00_fehlersuche_und_grundlagen/index.html @@ -205,5 +205,9 @@ + + + + diff --git a/00_fehlersuche_und_grundlagen/test_aufgabe.py b/00_fehlersuche_und_grundlagen/test_aufgabe.py index 9015efe..9c67d7e 100644 --- a/00_fehlersuche_und_grundlagen/test_aufgabe.py +++ b/00_fehlersuche_und_grundlagen/test_aufgabe.py @@ -60,4 +60,12 @@ class TestKapitel00(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/01_einstieg_klassen/index.html b/01_einstieg_klassen/index.html index 9e3b1d6..cde1e08 100644 --- a/01_einstieg_klassen/index.html +++ b/01_einstieg_klassen/index.html @@ -287,5 +287,9 @@ + + + + diff --git a/01_einstieg_klassen/test_aufgabe.py b/01_einstieg_klassen/test_aufgabe.py index 366cd07..165f468 100644 --- a/01_einstieg_klassen/test_aufgabe.py +++ b/01_einstieg_klassen/test_aufgabe.py @@ -81,4 +81,12 @@ class TestKapitel01(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/02_init_und_self/index.html b/02_init_und_self/index.html index d6667b9..e2b0ab2 100644 --- a/02_init_und_self/index.html +++ b/02_init_und_self/index.html @@ -214,5 +214,9 @@ + + + + diff --git a/02_init_und_self/test_aufgabe.py b/02_init_und_self/test_aufgabe.py index b9f84e7..6d94b3f 100644 --- a/02_init_und_self/test_aufgabe.py +++ b/02_init_und_self/test_aufgabe.py @@ -82,4 +82,12 @@ class TestKapitel02(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/03_methoden_und_verhalten/index.html b/03_methoden_und_verhalten/index.html index dccdff5..3d6f208 100644 --- a/03_methoden_und_verhalten/index.html +++ b/03_methoden_und_verhalten/index.html @@ -194,5 +194,9 @@ + + + + diff --git a/03_methoden_und_verhalten/test_aufgabe.py b/03_methoden_und_verhalten/test_aufgabe.py index 974c576..9726e35 100644 --- a/03_methoden_und_verhalten/test_aufgabe.py +++ b/03_methoden_und_verhalten/test_aufgabe.py @@ -98,4 +98,12 @@ class TestKapitel03(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/04_str_und_darstellung/index.html b/04_str_und_darstellung/index.html index 82e3720..79cb3e2 100644 --- a/04_str_und_darstellung/index.html +++ b/04_str_und_darstellung/index.html @@ -201,5 +201,9 @@ + + + + diff --git a/04_str_und_darstellung/test_aufgabe.py b/04_str_und_darstellung/test_aufgabe.py index c7ff7ef..f5def7a 100644 --- a/04_str_und_darstellung/test_aufgabe.py +++ b/04_str_und_darstellung/test_aufgabe.py @@ -65,4 +65,12 @@ class TestKapitel04(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/04b_umstieg_vscode/index.html b/04b_umstieg_vscode/index.html index fb4a751..917784d 100644 --- a/04b_umstieg_vscode/index.html +++ b/04b_umstieg_vscode/index.html @@ -314,5 +314,9 @@ sudo snap install --classic code + + + + diff --git a/04c_git_und_versionskontrolle/index.html b/04c_git_und_versionskontrolle/index.html index e5b4ae6..9e99b23 100644 --- a/04c_git_und_versionskontrolle/index.html +++ b/04c_git_und_versionskontrolle/index.html @@ -210,5 +210,9 @@ + + + + diff --git a/05_objekte_kombinieren/index.html b/05_objekte_kombinieren/index.html index 9c3e670..3b10944 100644 --- a/05_objekte_kombinieren/index.html +++ b/05_objekte_kombinieren/index.html @@ -197,5 +197,9 @@ + + + + diff --git a/05_objekte_kombinieren/test_aufgabe.py b/05_objekte_kombinieren/test_aufgabe.py index 0b57f13..2137db9 100644 --- a/05_objekte_kombinieren/test_aufgabe.py +++ b/05_objekte_kombinieren/test_aufgabe.py @@ -84,4 +84,12 @@ class TestKapitel05(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/06_abschlussprojekt_tamagotchi/index.html b/06_abschlussprojekt_tamagotchi/index.html index 96a0eb5..3d4b3cd 100644 --- a/06_abschlussprojekt_tamagotchi/index.html +++ b/06_abschlussprojekt_tamagotchi/index.html @@ -175,5 +175,9 @@ + + + + diff --git a/06_abschlussprojekt_tamagotchi/test_aufgabe.py b/06_abschlussprojekt_tamagotchi/test_aufgabe.py index f838849..622d511 100644 --- a/06_abschlussprojekt_tamagotchi/test_aufgabe.py +++ b/06_abschlussprojekt_tamagotchi/test_aufgabe.py @@ -108,4 +108,12 @@ class TestKapitel06(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/07_referenzen_und_speicher/index.html b/07_referenzen_und_speicher/index.html index 8ea1d97..96113a6 100644 --- a/07_referenzen_und_speicher/index.html +++ b/07_referenzen_und_speicher/index.html @@ -211,5 +211,9 @@ + + + + diff --git a/07_referenzen_und_speicher/test_aufgabe.py b/07_referenzen_und_speicher/test_aufgabe.py index dfd0924..a07ee4e 100644 --- a/07_referenzen_und_speicher/test_aufgabe.py +++ b/07_referenzen_und_speicher/test_aufgabe.py @@ -95,4 +95,12 @@ class TestKapitel07(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/08_operator_overloading_dunder/index.html b/08_operator_overloading_dunder/index.html index e7ed610..cc15c87 100644 --- a/08_operator_overloading_dunder/index.html +++ b/08_operator_overloading_dunder/index.html @@ -276,5 +276,9 @@ + + + + diff --git a/08_operator_overloading_dunder/test_aufgabe.py b/08_operator_overloading_dunder/test_aufgabe.py index beed836..cf3c9e4 100644 --- a/08_operator_overloading_dunder/test_aufgabe.py +++ b/08_operator_overloading_dunder/test_aufgabe.py @@ -139,4 +139,12 @@ class TestKapitel08(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/09_eigene_unit_tests_schreiben/index.html b/09_eigene_unit_tests_schreiben/index.html index e440567..de5de3d 100644 --- a/09_eigene_unit_tests_schreiben/index.html +++ b/09_eigene_unit_tests_schreiben/index.html @@ -295,5 +295,9 @@ + + + + diff --git a/09_eigene_unit_tests_schreiben/test_aufgabe.py b/09_eigene_unit_tests_schreiben/test_aufgabe.py index 35fa8c7..5afd5b7 100644 --- a/09_eigene_unit_tests_schreiben/test_aufgabe.py +++ b/09_eigene_unit_tests_schreiben/test_aufgabe.py @@ -172,4 +172,12 @@ class TestKapitel09Meta(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/10_vererbung_und_super/index.html b/10_vererbung_und_super/index.html index 3de36f0..c3a28b5 100644 --- a/10_vererbung_und_super/index.html +++ b/10_vererbung_und_super/index.html @@ -355,5 +355,9 @@ + + + + diff --git a/10_vererbung_und_super/test_aufgabe.py b/10_vererbung_und_super/test_aufgabe.py index 1498879..e850478 100644 --- a/10_vererbung_und_super/test_aufgabe.py +++ b/10_vererbung_und_super/test_aufgabe.py @@ -190,4 +190,12 @@ class TestKapitel10(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/11_polymorphie_und_interfaces/index.html b/11_polymorphie_und_interfaces/index.html index 6469b26..1092ca9 100644 --- a/11_polymorphie_und_interfaces/index.html +++ b/11_polymorphie_und_interfaces/index.html @@ -388,5 +388,9 @@ + + + + diff --git a/11_polymorphie_und_interfaces/test_aufgabe.py b/11_polymorphie_und_interfaces/test_aufgabe.py index 4d3031f..a89c8f0 100644 --- a/11_polymorphie_und_interfaces/test_aufgabe.py +++ b/11_polymorphie_und_interfaces/test_aufgabe.py @@ -175,4 +175,12 @@ class TestKapitel11(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/12_exceptions_und_fehlerbehandlung/index.html b/12_exceptions_und_fehlerbehandlung/index.html index 22d7df3..99bf5b5 100644 --- a/12_exceptions_und_fehlerbehandlung/index.html +++ b/12_exceptions_und_fehlerbehandlung/index.html @@ -255,5 +255,9 @@ + + + + diff --git a/12_exceptions_und_fehlerbehandlung/test_aufgabe.py b/12_exceptions_und_fehlerbehandlung/test_aufgabe.py index 9757690..8788c76 100644 --- a/12_exceptions_und_fehlerbehandlung/test_aufgabe.py +++ b/12_exceptions_und_fehlerbehandlung/test_aufgabe.py @@ -163,4 +163,12 @@ class TestKapitel12(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/13_persistenz_json_und_csv/index.html b/13_persistenz_json_und_csv/index.html index 901379d..a789a74 100644 --- a/13_persistenz_json_und_csv/index.html +++ b/13_persistenz_json_und_csv/index.html @@ -243,5 +243,9 @@ + + + + diff --git a/13_persistenz_json_und_csv/test_aufgabe.py b/13_persistenz_json_und_csv/test_aufgabe.py index aa5c6e6..1953f21 100644 --- a/13_persistenz_json_und_csv/test_aufgabe.py +++ b/13_persistenz_json_und_csv/test_aufgabe.py @@ -141,4 +141,12 @@ class TestKapitel13(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/14_gui_mit_tkinter/index.html b/14_gui_mit_tkinter/index.html index ea16cd9..cd60b12 100644 --- a/14_gui_mit_tkinter/index.html +++ b/14_gui_mit_tkinter/index.html @@ -348,5 +348,9 @@ + + + + diff --git a/14_gui_mit_tkinter/test_aufgabe.py b/14_gui_mit_tkinter/test_aufgabe.py index 731a471..14f72dc 100644 --- a/14_gui_mit_tkinter/test_aufgabe.py +++ b/14_gui_mit_tkinter/test_aufgabe.py @@ -263,4 +263,12 @@ class TestKapitel14GUI(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/15_parameter_und_container/index.html b/15_parameter_und_container/index.html index 2a25bfa..410bed5 100644 --- a/15_parameter_und_container/index.html +++ b/15_parameter_und_container/index.html @@ -312,5 +312,9 @@ + + + + diff --git a/15_parameter_und_container/test_aufgabe.py b/15_parameter_und_container/test_aufgabe.py index 963b079..1f5fb21 100644 --- a/15_parameter_und_container/test_aufgabe.py +++ b/15_parameter_und_container/test_aufgabe.py @@ -338,4 +338,12 @@ class TestKapitel15(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/16_master_abschlussprojekt/index.html b/16_master_abschlussprojekt/index.html index d4b2c58..afadc7d 100644 --- a/16_master_abschlussprojekt/index.html +++ b/16_master_abschlussprojekt/index.html @@ -323,5 +323,9 @@ + + + + diff --git a/16_master_abschlussprojekt/test_aufgabe.py b/16_master_abschlussprojekt/test_aufgabe.py index cd20304..5b5c7f1 100644 --- a/16_master_abschlussprojekt/test_aufgabe.py +++ b/16_master_abschlussprojekt/test_aufgabe.py @@ -424,4 +424,12 @@ class Test07GUIHeadless(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/assets/gamification_data.js b/assets/gamification_data.js index ef17816..819dd2a 100644 --- a/assets/gamification_data.js +++ b/assets/gamification_data.js @@ -11,7 +11,7 @@ window.GAMIFICATION_DATA = { "streak_tage": 1, "letzter_aktiver_tag": "2026-08-29", "historie": [], - "zuletzt_aktualisiert": "2026-08-29T14:51:01.563840" + "zuletzt_aktualisiert": "2026-08-29T14:53:37.686061" }; window.GAMIFICATION_BADGES_KATALOG = { "rechenkonegin": { diff --git a/g01_erste_schritte_taschenrechner/index.html b/g01_erste_schritte_taschenrechner/index.html index 7fd39be..ae8cd7c 100644 --- a/g01_erste_schritte_taschenrechner/index.html +++ b/g01_erste_schritte_taschenrechner/index.html @@ -301,5 +301,9 @@ + + + + diff --git a/g01_erste_schritte_taschenrechner/test_aufgabe.py b/g01_erste_schritte_taschenrechner/test_aufgabe.py index fba2f9b..a0bafba 100644 --- a/g01_erste_schritte_taschenrechner/test_aufgabe.py +++ b/g01_erste_schritte_taschenrechner/test_aufgabe.py @@ -124,4 +124,12 @@ class TestKapitelG01(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g02_variablen_und_datentypen/index.html b/g02_variablen_und_datentypen/index.html index 11c6133..4c12a37 100644 --- a/g02_variablen_und_datentypen/index.html +++ b/g02_variablen_und_datentypen/index.html @@ -252,5 +252,9 @@ + + + + diff --git a/g02_variablen_und_datentypen/test_aufgabe.py b/g02_variablen_und_datentypen/test_aufgabe.py index d15cff7..9603fa2 100644 --- a/g02_variablen_und_datentypen/test_aufgabe.py +++ b/g02_variablen_und_datentypen/test_aufgabe.py @@ -110,4 +110,12 @@ class TestKapitelG02(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g03_ein_und_ausgabe/index.html b/g03_ein_und_ausgabe/index.html index 224f3b4..0204190 100644 --- a/g03_ein_und_ausgabe/index.html +++ b/g03_ein_und_ausgabe/index.html @@ -255,5 +255,9 @@ return f"Steckbrief: {name} | Größe: {groesse_m:.2f} m | Gewicht: {gewicht_kg: + + + + diff --git a/g03_ein_und_ausgabe/test_aufgabe.py b/g03_ein_und_ausgabe/test_aufgabe.py index 3d431eb..0b00794 100644 --- a/g03_ein_und_ausgabe/test_aufgabe.py +++ b/g03_ein_und_ausgabe/test_aufgabe.py @@ -142,4 +142,12 @@ class TestKapitelG03(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g04_verzweigungen_und_bedingungen/index.html b/g04_verzweigungen_und_bedingungen/index.html index 7a99c28..6cd6e83 100644 --- a/g04_verzweigungen_und_bedingungen/index.html +++ b/g04_verzweigungen_und_bedingungen/index.html @@ -287,5 +287,9 @@ return False + + + + diff --git a/g04_verzweigungen_und_bedingungen/test_aufgabe.py b/g04_verzweigungen_und_bedingungen/test_aufgabe.py index da3e0fb..9809e5b 100644 --- a/g04_verzweigungen_und_bedingungen/test_aufgabe.py +++ b/g04_verzweigungen_und_bedingungen/test_aufgabe.py @@ -157,4 +157,12 @@ class TestKapitelG04(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g05_schleifen_und_wiederholungen/index.html b/g05_schleifen_und_wiederholungen/index.html index 204134c..0b63ac3 100644 --- a/g05_schleifen_und_wiederholungen/index.html +++ b/g05_schleifen_und_wiederholungen/index.html @@ -328,5 +328,9 @@ + + + + diff --git a/g05_schleifen_und_wiederholungen/test_aufgabe.py b/g05_schleifen_und_wiederholungen/test_aufgabe.py index 196be77..fe3eda6 100644 --- a/g05_schleifen_und_wiederholungen/test_aufgabe.py +++ b/g05_schleifen_und_wiederholungen/test_aufgabe.py @@ -175,4 +175,12 @@ class TestKapitelG05(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g06_funktionen_und_module/index.html b/g06_funktionen_und_module/index.html index 5079e0e..bc5ee21 100644 --- a/g06_funktionen_und_module/index.html +++ b/g06_funktionen_und_module/index.html @@ -281,5 +281,9 @@ + + + + diff --git a/g06_funktionen_und_module/test_aufgabe.py b/g06_funktionen_und_module/test_aufgabe.py index 265b93a..91a7d5c 100644 --- a/g06_funktionen_und_module/test_aufgabe.py +++ b/g06_funktionen_und_module/test_aufgabe.py @@ -164,4 +164,12 @@ class TestKapitelG06(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g07_listen_und_sequenzen/index.html b/g07_listen_und_sequenzen/index.html index 292051c..e36df88 100644 --- a/g07_listen_und_sequenzen/index.html +++ b/g07_listen_und_sequenzen/index.html @@ -272,5 +272,9 @@ + + + + diff --git a/g07_listen_und_sequenzen/test_aufgabe.py b/g07_listen_und_sequenzen/test_aufgabe.py index 9b242d0..bad711a 100644 --- a/g07_listen_und_sequenzen/test_aufgabe.py +++ b/g07_listen_und_sequenzen/test_aufgabe.py @@ -120,4 +120,12 @@ class TestKapitelG07(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g08_textverarbeitung_und_strings/index.html b/g08_textverarbeitung_und_strings/index.html index e6780e7..6814efc 100644 --- a/g08_textverarbeitung_und_strings/index.html +++ b/g08_textverarbeitung_und_strings/index.html @@ -227,5 +227,9 @@ + + + + diff --git a/g08_textverarbeitung_und_strings/test_aufgabe.py b/g08_textverarbeitung_und_strings/test_aufgabe.py index f9d48ad..d59c10a 100644 --- a/g08_textverarbeitung_und_strings/test_aufgabe.py +++ b/g08_textverarbeitung_und_strings/test_aufgabe.py @@ -94,4 +94,12 @@ class TestKapitelG08(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g09_dictionaries_und_sets/index.html b/g09_dictionaries_und_sets/index.html index d4f4b0a..7d99603 100644 --- a/g09_dictionaries_und_sets/index.html +++ b/g09_dictionaries_und_sets/index.html @@ -301,5 +301,9 @@ + + + + diff --git a/g09_dictionaries_und_sets/test_aufgabe.py b/g09_dictionaries_und_sets/test_aufgabe.py index 50c7135..1e9d16a 100644 --- a/g09_dictionaries_und_sets/test_aufgabe.py +++ b/g09_dictionaries_und_sets/test_aufgabe.py @@ -139,4 +139,12 @@ class TestKapitelG09(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/g10_comprehensions_datum_algorithmen/index.html b/g10_comprehensions_datum_algorithmen/index.html index b60ca2d..9c57e28 100644 --- a/g10_comprehensions_datum_algorithmen/index.html +++ b/g10_comprehensions_datum_algorithmen/index.html @@ -251,5 +251,9 @@ + + + + diff --git a/g10_comprehensions_datum_algorithmen/test_aufgabe.py b/g10_comprehensions_datum_algorithmen/test_aufgabe.py index 90e1208..1f3fca8 100644 --- a/g10_comprehensions_datum_algorithmen/test_aufgabe.py +++ b/g10_comprehensions_datum_algorithmen/test_aufgabe.py @@ -140,4 +140,12 @@ class TestKapitelG10(unittest.TestCase): if __name__ == "__main__": - unittest.main(verbosity=2) + res = unittest.main(verbosity=2, exit=False) + try: + from pathlib import Path + sys.path.insert(0, str(Path(__file__).parent.parent)) + from gamification import report_single_chapter_result + report_single_chapter_result(Path(__file__).parent.name, res.result.wasSuccessful(), res.result.testsRun) + except Exception: + pass + sys.exit(0 if res.result.wasSuccessful() else 1) \ No newline at end of file diff --git a/gamification.py b/gamification.py index f594756..637be44 100644 --- a/gamification.py +++ b/gamification.py @@ -308,5 +308,39 @@ window.GAMIFICATION_LEVEL_STUFEN = {json.dumps(LEVEL_STUFEN, indent=2, ensure_as } +def report_single_chapter_result(kapitel_ordner: str, tests_erfolgreich: bool, tests_anzahl: int): + """ + Wird von einzelnen test_aufgabe.py Skripten aufgerufen, wenn sie direkt ausgeführt werden. + Aktualisiert den Spielstand und gibt motivierendes Feedback im Terminal aus. + """ + gm = GamificationManager() + aktuelle_geloeste = set(gm.state.get("geloeste_kapitel", [])) + + if tests_erfolgreich and tests_anzahl > 0: + war_bereits_geloest = kapitel_ordner in aktuelle_geloeste + aktuelle_geloeste.add(kapitel_ordner) + + # Gesamtbestandene Tests schätzen/updaten + alte_tests = gm.state.get("bestandene_tests", 0) + neue_tests = alte_tests if war_bereits_geloest else alte_tests + tests_anzahl + + events = gm.sync_mit_test_ergebnissen(list(aktuelle_geloeste), neue_tests) + lvl = events["lvl_info"] + + print("\n" + "═" * 60) + print(f"🎉 KAPITEL BESTANDEN! ⭐ {lvl['titel']} (Level {lvl['level']})") + print(f"💎 Aktuelle XP: {events['gesamt_xp']} XP | Rang: {lvl['rang']}") + + if events.get("level_up"): + print(f"🚀 LEVEL UP! Du bist aufgestiegen zu Level {lvl['level']}!") + + if events.get("neue_badges"): + for b in events["neue_badges"]: + print(f"🏆 NEUE TROPHÄE: {b['icon']} {b['name']} (+{b['xp_bonus']} XP Bonus!)") + + print(f"💡 Zeige deinen Fortschrittspass mit: python3 profil.py") + print("═" * 60 + "\n") + + # Singleton-Instanz manager = GamificationManager()