From c71d14c0493bc55c4f9b523264e657187b0b2bbe Mon Sep 17 00:00:00 2001 From: Cameron Brown Date: Wed, 29 May 2024 23:34:14 -0500 Subject: [PATCH] Add skip button for grading reports --- src/reports.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/reports.py b/src/reports.py index f1c697e..80a4a93 100644 --- a/src/reports.py +++ b/src/reports.py @@ -296,6 +296,25 @@ async def callback(self, interaction: discord.Interaction): self.view.stop() +class SkipReportButton(ReportReviewButton): + def __init__(self, bot: MILBot, student: Student): + self.bot = bot + self.student = student + super().__init__( + bot, + student, + label="Skip (no score)", + emoji="⏩", + style=discord.ButtonStyle.secondary, + row=3, + ) + + async def callback(self, interaction: discord.Interaction): + await interaction.response.defer() + assert self.view is not None + self.view.stop() + + class ReportsReviewView(MILBotView): def __init__(self, bot: MILBot, student: Student): self.bot = bot @@ -304,6 +323,7 @@ def __init__(self, bot: MILBot, student: Student): self.add_item(NegativeReportButton(bot, student)) self.add_item(WarningReportButton(bot, student)) self.add_item(GoodReportButton(bot, student)) + self.add_item(SkipReportButton(bot, student)) class StartReviewView(MILBotView):