from src.errors.errors import GradeValueAlreadySetError


class Grade():
    def __init__(self, assignment_id: str, student_id: str, grade_value: float) -> None:
        self.__assignment_id = assignment_id
        self.__student_id = student_id
        self.__grade_value = grade_value

    def get_assignment_id(self) -> str:
        return self.__assignment_id
    
    def get_student_id(self) -> str:
        return self.__student_id
    
    def get_grade_value(self) -> float:
        return self.__grade_value
    
    def set_assignment_id(self, assignment_id: str) -> None:
        self.__assignment_id = assignment_id
    
    def set_student_id(self, student_id: str) -> None:
        self.__student_id = student_id
    
    def set_grade_value(self, grade_value: float) -> None:
        self.__grade_value = grade_value
    
    def __str__(self) -> str:
        return f"Assignment id: {self.__assignment_id}, student id: {self.__student_id}, grade value: {self.__grade_value}"
    
    def toJson(self) -> dict:
        return {
            "assignment_id": self.__assignment_id,
            "student_id": self.__student_id,
            "grade_value": self.__grade_value
        }