File size: 763 Bytes
637f42c
 
 
 
 
 
 
 
 
efa2d2a
637f42c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Task registry — single source of truth for all available tasks."""
from __future__ import annotations
from typing import Any, Dict
from . import easy_task, medium_task, hard_task, bonus_task

TASK_REGISTRY: Dict[str, Any] = {
    easy_task.TASK_ID:   easy_task,
    medium_task.TASK_ID: medium_task,
    hard_task.TASK_ID:   hard_task,
    bonus_task.TASK_ID:  bonus_task,
}

# The 3 scored tasks for the hackathon (easy, medium, hard)
SCORED_TASK_IDS = [
    easy_task.TASK_ID,
    medium_task.TASK_ID,
    hard_task.TASK_ID,
]

ALL_TASK_IDS = list(TASK_REGISTRY.keys())

def get_task(task_id: str) -> Any:
    if task_id not in TASK_REGISTRY:
        raise KeyError(f"Unknown task '{task_id}'. Available: {ALL_TASK_IDS}")
    return TASK_REGISTRY[task_id]