Skip to content

Replace Absent Winners and Mark Them as Invalid for Future Rounds #2

@svg153

Description

@svg153

User Story

As an event organizer using the raffle application,
I want to be able to replace winners who are no longer at the event,
So that I can ensure prizes are awarded to attendees who are present.

Description

Currently, when a winner is drawn in the raffle, there is no way to handle the scenario where the winner has left the event before the prize can be awarded. We need a feature to:

  • Mark a winner as "absent" directly from their winner card.
  • Automatically draw a replacement winner when someone is marked as absent.
  • Ensure that absent winners are excluded from future draws in all rounds.
  • Visually distinguish between present winners and absent winners in the interface.

Acceptance Criteria

  • Add an "Absent" button to each winner card.
  • When the "Absent" button is clicked, mark the winner as absent and draw a new winner for that prize.
  • Store absent winners in session state and exclude them from all future draws.
  • Apply visual styling to indicate absent winners (e.g., grayed out or with a specific label).
  • Include absent winner information in the CSV export, marked appropriately.
  • Ensure the total count of winners remains accurate in the session information sidebar.

Technical Implementation Details

  • Modify the winner card display to include an "Absent" button.
  • Create a function to handle marking a winner as absent and redrawing.
  • Add a new session state variable to track absent participants.
  • Update the draw_winners function to exclude both previous winners and absent participants.
  • Modify the CSV export to include an "absent" status column.

Testing Scenarios

  • Test replacing a winner in a single-winner round.
  • Test replacing a winner in a multi-winner round.
  • Verify absent winners do not appear in subsequent rounds.
  • Test exporting results after marking winners as absent.
  • Test edge cases (e.g., when all remaining participants are absent or have won).

Priority

Medium

Effort Estimate

Medium (4-6 hours)

Dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions