الوحدة {unit_idx}: {escape(unit['unit_name'])}
""") # مخرجات الوحدة if 'unit_outcome' in unit and unit['unit_outcome']: html_parts.append(f"""🎯 مخرجات التعلم للوحدة
{escape_html(unit['unit_outcome'])}
{unit_idx}.{topic_idx} {escape(topic['topic_title'])}
""") # معالجة المحاور الفرعية (Subtopics) if 'subtopics' in topic and isinstance(topic['subtopics'], list): for subtopic_idx, subtopic in enumerate(topic['subtopics'], 1): subtopic_id = f"unit-{unit_idx}-topic-{topic_idx}-subtopic-{subtopic_idx}" html_parts.append(f"""{unit_idx}.{topic_idx}.{subtopic_idx} {escape(subtopic.get('title', ''))}
""") # الوصف if 'description' in subtopic and subtopic['description']: html_parts.append(f"""المصادر:
') html_parts.append('- ')
for source in subtopic['sources']:
if source.strip():
html_parts.append(f"""
- {escape(source.strip())} """) html_parts.append("