Spaces:
Sleeping
Sleeping
| def proficiency_to_level(proficiency: int) -> str: | |
| """Map proficiency integer (0-100) to skill level string. | |
| Boundaries (inclusive on the upper edge): | |
| 0-40 β BEGINNER | |
| 41-60 β INTERMEDIATE | |
| 61-100 β ADVANCED | |
| Note: these boundaries are the *display* mapping for the UI. The gap | |
| analysis engine uses separate `LEVEL_THRESHOLDS` (BEGINNER=40, | |
| INTERMEDIATE=60, ADVANCED=100) against raw proficiency β see | |
| `apps.analysis.services`. | |
| """ | |
| if proficiency <= 40: | |
| return 'BEGINNER' | |
| elif proficiency <= 60: | |
| return 'INTERMEDIATE' | |
| else: | |
| return 'ADVANCED' | |