diff --git a/build.py b/build.py index ae82066..e364d8b 100644 --- a/build.py +++ b/build.py @@ -6,11 +6,11 @@ conf = config.Config() # Build Everything: bd = build.Build(conf) bd.build_website() -bd.build_edition("N") -bd.build_edition("E") -bd.build_edition("A") -bd.build_edition("NE") -bd.build_edition("EA") -bd.build_edition("NEA") +# bd.build_edition("N") +# bd.build_edition("E") +# bd.build_edition("A") +# bd.build_edition("NE") +# bd.build_edition("EA") +# bd.build_edition("NEA") bd.build_assets() -bd.build_brightspots() +bd.build_solutions() diff --git a/src/build.py b/src/build.py index 8a88c84..ad1f8a4 100644 --- a/src/build.py +++ b/src/build.py @@ -103,7 +103,7 @@ class Build: picture_question = "" alt_text_question = "" - brightspot_file = self.config.p_data_brightspots / f"{number}.md" + solution_file = self.config.p_data_solutions / f"{number}.md" return question_template.render( question=question["question"], @@ -114,7 +114,7 @@ class Build: answer_pictures=answer_pictures, alt_text_answers=alt_text_answers, alt_text_question=alt_text_question, - brightspot=brightspot_file.exists(), + has_solution=solution_file.exists(), ) def __build_question_slide(self, input): @@ -454,11 +454,11 @@ class Build: self.__build_html_page(contents, "pruefung") self.__build_html_page(contents, "infos") - def build_brightspots(self): - for brightspot_file in self.config.p_data_brightspots.glob("*.md"): - with brightspot_file.open() as file: + def build_solutions(self): + for solution_file in self.config.p_data_solutions.glob("*.md"): + with solution_file.open() as file: content = file.read() - with (self.config.p_build / f"{brightspot_file.stem}.html").open("w") as file: + with (self.config.p_build / f"{solution_file.stem}.html").open("w") as file: with FiftyOhmHtmlRenderer( question_renderer=self.__build_question, picture_handler=self.__picture_handler, @@ -466,12 +466,10 @@ class Build: include_handler=self.__include_handler, ) as renderer: question = self.__build_question( - brightspot_file.stem, template_file="html/brightspot_question.html" + solution_file.stem, template_file="html/solution_question.html" ) - brightspot_template = self.env.get_template("html/brightspot.html") + solution_template = self.env.get_template("html/solution.html") solution = renderer.render(Document(content)) - page = brightspot_template.render( - question=question, solution=solution, number=brightspot_file.stem - ) + page = solution_template.render(question=question, solution=solution, number=solution_file.stem) page = self.__build_page(page, course_wrapper=False) file.write(page) diff --git a/src/config.py b/src/config.py index edac069..81433f3 100644 --- a/src/config.py +++ b/src/config.py @@ -26,7 +26,7 @@ class Config: self.p_data_slides = self.p_data_contents / "slides" self.p_data_snippets = self.p_data_contents / "snippets" self.p_data_static = self.p_data_contents / "static" - self.p_data_brightspots = self.p_data_contents / "brightspots" + self.p_data_solutions = self.p_data_contents / "solutions" self.p_data_fragenkatalog = self.p_data_questions / "fragenkatalog3b.json" self.p_data_metadata = self.p_data_questions / "metadata3b.json" diff --git a/templates/html/brightspot_question.html b/templates/html/brightspot_question.html deleted file mode 100644 index 931eaee..0000000 --- a/templates/html/brightspot_question.html +++ /dev/null @@ -1,22 +0,0 @@ -
-
{{ number }}: {{ question }}
- {% if picture_question %} -
{{ alt_text_question }}
- {% endif %} -
- {% if answers[0] %} - Richtig: {{ answers[0] }}
- Falsch: {{ answers[1] }}
- Falsch: {{ answers[2] }}
- Falsch: {{ answers[3] }}
- {% endif %} - {% if answer_pictures[0] %} - Richtig:
{{ alt_text_answers[0] }}

- Falsch:
{{ alt_text_answers[1] }}

- Falsch:
{{ alt_text_answers[2] }}

- Falsch:
{{ alt_text_answers[3] }}

- {% endif %} -
-
- - \ No newline at end of file diff --git a/templates/html/brightspot.html b/templates/html/solution.html similarity index 100% rename from templates/html/brightspot.html rename to templates/html/solution.html diff --git a/templates/html/solution_question.html b/templates/html/solution_question.html new file mode 100644 index 0000000..409d67c --- /dev/null +++ b/templates/html/solution_question.html @@ -0,0 +1,21 @@ +
+
Frage: {{ question }}
+ {% if picture_question %} +
{{ alt_text_question }}
+ {% endif %} +
+ {% for i in range(1) %} +
+ {{ 'Lösung:' if i == 0 else 'Falsch:' }} + {% if answers[i] %} + {{ answers[i] }} + {% endif %} + {% if answer_pictures[i] %} +
{{ alt_text_answers[i] }}
+ {% endif %} +
+ {% endfor %} +
+
+ + \ No newline at end of file