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):
topic_key: str
label: str
refs: List[List[int]]
level: str
summary: str = ""
......
......@@ -454,7 +454,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any]
return None
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", []))
return {
......@@ -462,7 +462,7 @@ def _normalize_yaml_task_entry(task_entry: Any, position: int) -> dict[str, Any]
"statement": "\n".join(statement_parts).strip(),
"hints": hint_parts,
"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
intro = str(content.get("description", "")).strip()
file_id = str(content.get("id", "")).strip() or path.stem
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", []))
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
tasks: list[dict[str, Any]] = []
......@@ -512,7 +511,6 @@ def _normalize_yaml_task_file(content: Any, path: Path) -> dict[str, Any] | None
"title": title,
"intro": intro,
"slug": slug,
"level": level,
"subsections": subsections,
"topic_refs": topic_refs_raw if isinstance(topic_refs_raw, list) else [],
"tasks": tasks,
......
......@@ -103,7 +103,6 @@ def convert_task_payload(payload: dict[str, Any], source_file_id: str, image_pat
return {
"id": source_file_id,
"titel": title,
"level": DEFAULT_LEVEL,
"slug": slug,
"description": intro,
"exercise_topic": _build_topic_entries(payload.get("subsections", [])),
......
......@@ -95,6 +95,26 @@ class TaskCatalogSocraticTest(unittest.TestCase):
)
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:
with patch(
"app.deterministic_services.socratic_oranisator.load_initial_prompt_items",
......
......@@ -23,7 +23,6 @@ export type TopicOption = {
topic_key: string;
label: string;
refs: [number, number, number, number][];
level: 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