Commit 0a925bf3 authored by Kantz's avatar Kantz
Browse files

entfernen des Uebung Levels, da es nicht verwendet wird

parent 72d5b5d1
...@@ -30,7 +30,6 @@ class TopicEntry(BaseModel): ...@@ -30,7 +30,6 @@ class TopicEntry(BaseModel):
topic_key: str topic_key: str
label: str label: str
refs: List[List[int]] refs: List[List[int]]
level: str
summary: str = "" summary: str = ""
......
...@@ -454,7 +454,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any] ...@@ -454,7 +454,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any]
return None return None
statement_parts, statement_images = _extract_text_and_images(task_entry.get("aufgabe", [])) statement_parts, statement_images = _extract_text_and_images(task_entry.get("aufgabe", []))
hint_parts, hint_images = _extract_text_and_images(task_entry.get("hinweise", [])) hint_parts, _ = _extract_text_and_images(task_entry.get("hinweise", []))
solution_parts, _ = _extract_text_and_images(task_entry.get("loesung", [])) solution_parts, _ = _extract_text_and_images(task_entry.get("loesung", []))
return { return {
...@@ -462,7 +462,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any] ...@@ -462,7 +462,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any]
"statement": "\n".join(statement_parts).strip(), "statement": "\n".join(statement_parts).strip(),
"hints": hint_parts, "hints": hint_parts,
"solution": "\n".join(solution_parts).strip(), "solution": "\n".join(solution_parts).strip(),
"images": statement_images + hint_images, "images": statement_images,
} }
...@@ -492,11 +492,10 @@ def _normalize_yaml_task_file(content: Any, path: Path) -> dict[str, Any] | None ...@@ -492,11 +492,10 @@ def _normalize_yaml_task_file(content: Any, path: Path) -> dict[str, Any] | None
intro = str(content.get("description", "")).strip() intro = str(content.get("description", "")).strip()
file_id = str(content.get("id", "")).strip() or path.stem file_id = str(content.get("id", "")).strip() or path.stem
slug = str(content.get("slug", "")).strip() or _slugify(title or file_id) slug = str(content.get("slug", "")).strip() or _slugify(title or file_id)
level = str(content.get("level", "")).strip()
subsections = _normalize_exercise_topics(content.get("exercise_topic", [])) subsections = _normalize_exercise_topics(content.get("exercise_topic", []))
topic_refs_raw = content.get("topic_refs", []) topic_refs_raw = content.get("topic_refs", [])
if not title or not file_id or not slug or not level: if not title or not file_id or not slug:
return None return None
tasks: list[dict[str, Any]] = [] tasks: list[dict[str, Any]] = []
...@@ -512,7 +511,6 @@ def _normalize_yaml_task_file(content: Any, path: Path) -> dict[str, Any] | None ...@@ -512,7 +511,6 @@ def _normalize_yaml_task_file(content: Any, path: Path) -> dict[str, Any] | None
"title": title, "title": title,
"intro": intro, "intro": intro,
"slug": slug, "slug": slug,
"level": level,
"subsections": subsections, "subsections": subsections,
"topic_refs": topic_refs_raw if isinstance(topic_refs_raw, list) else [], "topic_refs": topic_refs_raw if isinstance(topic_refs_raw, list) else [],
"tasks": tasks, "tasks": tasks,
......
...@@ -103,7 +103,6 @@ def convert_task_payload(payload: dict[str, Any], source_file_id: str, image_pat ...@@ -103,7 +103,6 @@ def convert_task_payload(payload: dict[str, Any], source_file_id: str, image_pat
return { return {
"id": source_file_id, "id": source_file_id,
"titel": title, "titel": title,
"level": DEFAULT_LEVEL,
"slug": slug, "slug": slug,
"description": intro, "description": intro,
"exercise_topic": _build_topic_entries(payload.get("subsections", [])), "exercise_topic": _build_topic_entries(payload.get("subsections", [])),
......
...@@ -95,6 +95,26 @@ class TaskCatalogSocraticTest(unittest.TestCase): ...@@ -95,6 +95,26 @@ class TaskCatalogSocraticTest(unittest.TestCase):
) )
self.assertEqual(catalog[0]["topics"], ["quadratische_gleichungen"]) self.assertEqual(catalog[0]["topics"], ["quadratische_gleichungen"])
def test_normalize_yaml_task_entry_excludes_images_from_hints(self) -> None:
task_entry = {
"aufgabe": [
{"type": "text", "text": "Bestimme f(x)."},
],
"hinweise": [
{"type": "text", "text": "Nutze den Graphen."},
{"type": "image", "src": "analysis/h1.png", "alt": "Hinweisgrafik."},
],
"loesung": [
{"type": "text", "text": "f(x)=x^2"},
],
}
normalized = task_catalog._normalize_yaml_task_entry(task_entry, 1)
self.assertIsNotNone(normalized)
self.assertEqual(normalized["hints"], ["Nutze den Graphen."])
self.assertEqual(normalized["images"], [])
def test_socratic_build_subsection_catalog_returns_response_shape(self) -> None: def test_socratic_build_subsection_catalog_returns_response_shape(self) -> None:
with patch( with patch(
"app.deterministic_services.socratic_oranisator.load_initial_prompt_items", "app.deterministic_services.socratic_oranisator.load_initial_prompt_items",
......
...@@ -23,7 +23,6 @@ export type TopicOption = { ...@@ -23,7 +23,6 @@ export type TopicOption = {
topic_key: string; topic_key: string;
label: string; label: string;
refs: [number, number, number, number][]; refs: [number, number, number, number][];
level: string;
summary: string; summary: string;
}; };
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment