# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.


from .interface import IGrader


class GraderRegistry:
    _grader_registry: dict[str, IGrader] = {}

    @staticmethod
    def register_grader(grader_id: str, grader: IGrader):
        GraderRegistry._grader_registry[grader_id] = grader

    @staticmethod
    def get_grader(grader_id: str) -> IGrader:
        return GraderRegistry._grader_registry[grader_id]

    @staticmethod
    def get_grader_ids() -> list[str]:
        return list(GraderRegistry._grader_registry.keys())
