Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
550 B
2
Indexable
Never

    def update_note_by_id(self, note_uuid, new_note: enum):

        if self.note_uuid == note_uuid:
            if self.term == Term.BOARD_EXAM:
                raise ValueError("Board exam note cannot be updated!")
            else:
                self.note_value = new_note
                if self.term == Term.FIRST:
                    self.term = Term.SECOND
                elif self.term == Term.SECOND:
                    self.term = Term.THIRD
                elif self.term == Term.THIRD:
                    self.term = Term.BOARD_EXAM