diff --git a/klausur-service/backend/grid_editor_api.py b/klausur-service/backend/grid_editor_api.py index 82c04ad..0ba002f 100644 --- a/klausur-service/backend/grid_editor_api.py +++ b/klausur-service/backend/grid_editor_api.py @@ -889,8 +889,8 @@ async def _build_grid_core( col_ipa_count[ct] = col_ipa_count.get(ct, 0) + 1 if col_ipa_count: en_col_type = max(col_ipa_count, key=col_ipa_count.get) - elif ipa_mode in ("all", "de", "en"): - # Force mode without auto-detection: pick column with most cells + elif ipa_mode == "all": + # Force-all mode without auto-detection: pick column with most cells col_cell_count: Dict[str, int] = {} for cell in all_cells: ct = cell.get("col_type", "") @@ -1510,10 +1510,12 @@ async def _build_grid_core( _syllable_eligible = True # For language-specific modes, determine allowed columns _syllable_col_filter: Optional[set] = None # None = all columns - if syllable_mode == "en" and en_col_type: - _syllable_col_filter = {en_col_type} - elif syllable_mode == "de" and en_col_type: - _syllable_col_filter = all_content_cols - {en_col_type} if total_cols >= 3 else None + if syllable_mode == "en": + _syllable_col_filter = {en_col_type} if en_col_type else set() + elif syllable_mode == "de": + if en_col_type and total_cols >= 3: + _syllable_col_filter = all_content_cols - {en_col_type} + # else None → all columns (correct for German-only dicts) if _syllable_eligible: try: from cv_syllable_detect import insert_syllable_dividers