From 416af8a324b52578b21e12395a97996877a98d93 Mon Sep 17 00:00:00 2001 From: saver Date: Sun, 23 Jan 2022 02:16:49 +1000 Subject: [PATCH] Add unit header to html --- EGE/Html.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EGE/Html.py b/EGE/Html.py index d71d259..1506085 100644 --- a/EGE/Html.py +++ b/EGE/Html.py @@ -80,7 +80,8 @@ def make_question_html(q): + "\n" for i, v in enumerate(q.variants)) if q.export_type() == 'di': result = li(q.correct) + "\n" - return div(f"{q.text}\n" + ol("\n" + result) + "\n", class_='q') + "\n" + unit = str(type(q)).split('.')[-2] + return div(f"

{unit}

{q.text}\n" + ol("\n" + result) + "\n", class_='q') + "\n" def make_html(questions): return global_head() + tag('body', map(make_question_html, questions)) + '\n'