Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/priority voting #61

Merged
merged 14 commits into from
Dec 18, 2023
Merged

Feature/priority voting #61

merged 14 commits into from
Dec 18, 2023

Conversation

pabpercab1
Copy link
Collaborator

@pabpercab1 pabpercab1 commented Dec 17, 2023

The purpose of this pull request is to introduce the functionality for a new priority-based voting system in Decide. Before executing the application or conducting tests, please follow these steps:

pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate

Given that the frontend interface for this feature hasn't been developed yet, testing will be performed through unit tests.

Key Changes and Concepts:

Used the multiple option voting structure: This new priority voting model is integrated in the current 'question_type' attribute.

Frontend Vote Format: For single-option voting, the format of a vote from the frontend is: vote: { "a": int, "b": int }. In contrast, for priority voting, the format is: vote: [ { "a": int, "b": int, "p": int }, ...]. The priority vote is structured as a list of dictionaries to ensure encrypted votes with chosen options reach the backend for decryption.

Implementation of the New Model in the Mixnet: Previous models (e.g., simple voting or multi-option voting) only consist of 'a' and 'b' parameters, while the priority voting requires an additional parameter ('p') to store the priority of the voted option.

White voting: Currently, it is not feasible to select white voting alongside priority voting due to the inherent contradiction. Allowing a combination of white voting with priority voting would undermine the purpose of the priority voting system. As such, it remains incompatible as it contradicts the nature of prioritizing and ranking options.

If you have any suggestions on how to enhance this feature or if you encounter a bug, please let me know!

@pabpercab1 pabpercab1 self-assigned this Dec 17, 2023
@pabpercab1 pabpercab1 linked an issue Dec 17, 2023 that may be closed by this pull request
Copy link

codacy-production bot commented Dec 17, 2023

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.20% 92.08% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (2678a18) 3071 2729 88.86%
Head commit (a8e6019) 3208 (+137) 2857 (+128) 89.06% (+0.20%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#61) 202 186 92.08%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

@pabpercab1 pabpercab1 added enhancement New feature or request Medium priority This issue should be solved whenever possible labels Dec 17, 2023
decide/voting/tests.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@marnunrey2 marnunrey2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks fine and working. Good job!

@pabpercab1 pabpercab1 merged commit 5018c05 into develop Dec 18, 2023
7 checks passed
@pabpercab1 pabpercab1 deleted the feature/priority-voting branch December 18, 2023 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Medium priority This issue should be solved whenever possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature -> zambrano-1 -> voting -> Priority voting
4 participants