Integriere Gamification-Persistenz & Hooks in alle 27 Kapitel (test_aufgabe.py & index.html)
This commit is contained in:
parent
86532b15bb
commit
48ed3bb828
59 changed files with 395 additions and 29 deletions
|
|
@ -10,5 +10,5 @@
|
||||||
"streak_tage": 1,
|
"streak_tage": 1,
|
||||||
"letzter_aktiver_tag": "2026-08-29",
|
"letzter_aktiver_tag": "2026-08-29",
|
||||||
"historie": [],
|
"historie": [],
|
||||||
"zuletzt_aktualisiert": "2026-08-29T14:51:01.563840"
|
"zuletzt_aktualisiert": "2026-08-29T14:53:37.686061"
|
||||||
}
|
}
|
||||||
|
|
@ -205,5 +205,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,12 @@ class TestKapitel00(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -287,5 +287,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -81,4 +81,12 @@ class TestKapitel01(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -214,5 +214,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,12 @@ class TestKapitel02(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -194,5 +194,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -98,4 +98,12 @@ class TestKapitel03(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -201,5 +201,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,12 @@ class TestKapitel04(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -314,5 +314,9 @@ sudo snap install --classic code</code></pre>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -210,5 +210,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -197,5 +197,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -84,4 +84,12 @@ class TestKapitel05(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -175,5 +175,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,12 @@ class TestKapitel06(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -211,5 +211,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -95,4 +95,12 @@ class TestKapitel07(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -276,5 +276,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -139,4 +139,12 @@ class TestKapitel08(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -295,5 +295,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -172,4 +172,12 @@ class TestKapitel09Meta(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -355,5 +355,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -190,4 +190,12 @@ class TestKapitel10(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -388,5 +388,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -175,4 +175,12 @@ class TestKapitel11(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -255,5 +255,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -163,4 +163,12 @@ class TestKapitel12(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -243,5 +243,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -141,4 +141,12 @@ class TestKapitel13(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -348,5 +348,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -263,4 +263,12 @@ class TestKapitel14GUI(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -312,5 +312,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -338,4 +338,12 @@ class TestKapitel15(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -323,5 +323,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -424,4 +424,12 @@ class Test07GUIHeadless(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -11,7 +11,7 @@ window.GAMIFICATION_DATA = {
|
||||||
"streak_tage": 1,
|
"streak_tage": 1,
|
||||||
"letzter_aktiver_tag": "2026-08-29",
|
"letzter_aktiver_tag": "2026-08-29",
|
||||||
"historie": [],
|
"historie": [],
|
||||||
"zuletzt_aktualisiert": "2026-08-29T14:51:01.563840"
|
"zuletzt_aktualisiert": "2026-08-29T14:53:37.686061"
|
||||||
};
|
};
|
||||||
window.GAMIFICATION_BADGES_KATALOG = {
|
window.GAMIFICATION_BADGES_KATALOG = {
|
||||||
"rechenkonegin": {
|
"rechenkonegin": {
|
||||||
|
|
|
||||||
|
|
@ -301,5 +301,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -124,4 +124,12 @@ class TestKapitelG01(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -252,5 +252,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -110,4 +110,12 @@ class TestKapitelG02(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -255,5 +255,9 @@ return f"Steckbrief: {name} | Größe: {groesse_m:.2f} m | Gewicht: {gewicht_kg:
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -142,4 +142,12 @@ class TestKapitelG03(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -287,5 +287,9 @@ return False</code></pre>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -157,4 +157,12 @@ class TestKapitelG04(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -328,5 +328,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -175,4 +175,12 @@ class TestKapitelG05(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -281,5 +281,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -164,4 +164,12 @@ class TestKapitelG06(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -272,5 +272,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -120,4 +120,12 @@ class TestKapitelG07(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -227,5 +227,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -94,4 +94,12 @@ class TestKapitelG08(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -301,5 +301,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -139,4 +139,12 @@ class TestKapitelG09(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -251,5 +251,9 @@
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Lokale Gamification-Scripts (funktionieren auch offline per Doppelklick via file://) -->
|
||||||
|
<script src="../assets/gamification_data.js"></script>
|
||||||
|
<script src="../assets/gamification.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -140,4 +140,12 @@ class TestKapitelG10(unittest.TestCase):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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)
|
||||||
|
|
@ -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
|
# Singleton-Instanz
|
||||||
manager = GamificationManager()
|
manager = GamificationManager()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue