def create_grading(self, grade: int, participation_id: int): grading = Grading() grading.set_grade(grade) grading.set_participation_id(participation_id) with GradingMapper() as mapper: mapper.insert(grading)
def create_grading_for_participation(self, participation): """Eine Bewertung anlegen""" grading = Grading() grading.set_id(participation.get_id) grading.set_id(1) with GradingMapper() as mapper: return mapper.insert(grading)
def get_grading_by_participation_id(self, participation): """Die Bewertung von einer Teilnahme auslesen""" with GradingMapper() as mapper: return mapper.get_grading_by_participation(participation)
def get_all_gradings(self): """Alle Bewertungen ausgeben""" with GradingMapper() as mapper: return mapper.find_all()
def get_grading_by_id(self, id): """Eine Bewertung anhand ihrer ID auslesen""" with GradingMapper() as mapper: return mapper.find_by_id(id)
def delete_grading(self, grading): """Eine Bewertung löschen""" with GradingMapper() as mapper: mapper.delete(grading)
def save_grading(self, grading): """Eine Bewertung speichern""" with GradingMapper() as mapper: mapper.update(grading)