Skip to content

Spoil rate doesn't work in sample ballot generation #161

@rkorsak

Description

@rkorsak

The cast_spoil_ratio is meant to represent the desired percentage of ballots to spoil when generating sample data.
The current logic uses a random int and a modulo operator, which results in approximately 1% of ballots being spoiled no matter what ratio you use:

if randint(0, 100) % cast_spoil_ratio == 0:
    accepted_ballots.append(ballot_box.spoil(ballot))

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions