Skip to main content

AI Content Workflows & Multilingual Translation

High-quality content authoring and localized accessibility are essential pillars of LearnWay’s mission to build the learning infrastructure for Africa’s AI era. This document covers the automated AI Quiz Studio and the Multilingual Translation Subsystem inside learnway-ai-service.

1. AI Quiz Studio (AiQuizStudioService)

The AI Quiz Studio automates the synthesis of interactive, pedagogical multiple-choice questions (MCQs) directly from course lesson transcripts, documentation, or domain topics.

Distractor Quality & Label Sanitization

To ensure questions test deep conceptual understanding rather than pattern memorization, the synthesis pipeline enforces strict rules:
  • Plausible Distractors: Generates 3 realistic incorrect answers (distractors) reflecting common misconceptions.
  • Label Normalization: Strips hardcoded prefixes (such as "A)", "B)") so questions can be dynamically shuffled in real-time PvP quiz battles without revealing the answer order.
  • Detailed Explanations: Generates concise pedagogical rationales explaining why the correct answer is right and why distractors are invalid.

2. Two-Step Hybrid Multilingual Translation Engine (AiTranslationService)

To make advanced technical curricula accessible across diverse African linguistic landscapes, LearnWay combines the structural accuracy of Google Cloud Translation API with the contextual nuances of Google Gemini.

Supported Regional Languages & Dialects

The translation pipeline natively supports major African and international languages:
  • Swahili (sw) (East Africa)
  • Yoruba (yo) (West Africa)
  • Hausa (ha) (West/Central Africa)
  • Igbo (ig) (West Africa)
  • French (fr) (Francophone Africa)
  • Portuguese (pt) (Lusophone Africa)
  • Spanish (es) & Arabic (ar)

Technical Syntax & Code Preservation

Translating technical programming courses requires strict preservation of code blocks, variable names, and HTML formatting:
  1. Tag & Token Masking: Code blocks (fenced code), inline tags (<code>, <span>), and LaTeX formulas are shielded before translation.
  2. Contextual Polishing: Gemini reviews the draft translation to ensure technical idioms sound natural without translating reserved keywords (such as import, function, async/await, or contract).
  3. Automated Content Caching: Translated modules are persisted in translated_contents to eliminate recurring translation latency and LLM costs.