Verified Commit 5cee58cd authored by Vladimír Štill's avatar Vladimír Štill
Browse files

checker: Allow non-three-letter task codes

parent ba3fbd94
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6,11 +6,12 @@ import signal


def get_task(string: str) -> Tuple[str, str]:
    assert len(string) >= 7, "Teacher solution could not be parsed correctly."
    assert '-' in string, "Teacher solution could not be parsed correctly."
    teacher_type, task = string.split("-", 1)
    if len(task) > 3:
    if '-' in task:
        task, _ = task.split("-", 1)
    assert len(teacher_type) == 3 and len(task) == 3, "Teacher solution could not be parsed correctly."
    assert len(teacher_type) != 0, "Teacher solution code must not ne empty"
    assert len(task) != 0, "Task code must not be empty"

    return (teacher_type, task)