CSC/ECE 517 Fall 2023 - E2360. View for Results of Bidding (Phase2)

From Expertiza_Wiki
Revision as of 02:38, 16 November 2023 by Schen76 (talk | contribs)
Jump to navigation Jump to search

Design Doc

1. Work Plan

Based on the project's objectives and feedback received from our mentor, we have identified specific areas for improvement:

i) Refactor variable names within methods such as "bidding_details" and variables like "Topic name" and "Bidding teams" to enhance clarity and specificity.

ii) Adjust capitalization for certain components, ensuring that only the first word is capitalized for consistency.

iii) Introduce calculations to determine percentages based on additional data, such as the total number of teams and the number of teams for each priority, within the "lottery_controller."

iv) Conduct thorough testing of the modified controller and view to ensure optimal functionality.


2. Design

To add functionality for showing the percentages of the number of teams that got their #1, #2, and #3 choices. We can follow these high-level steps:

Lottery_Controller:


i) Calculate the Total Number of Teams: Before we can calculate percentages, we need to know the total number of teams that participated in the bidding process. This will be our denominator in the percentage calculation.

ii) Calculate the Number of Teams for Each Priority: From our `bidding_details` method, we already have counts for how many teams bid on each topic as their #1, #2, and #3 choice (`@count1`, `@count2`, `@count3`). However, these counts are currently organized by topic. We would need to modify this to count how many teams got their #1, #2, and #3 choices as their assigned topic.

iii) Calculate Percentages: Once we have the number of teams that got their #1, #2, and #3 choices, we can calculate the percentages by dividing these numbers by the total number of teams and multiplying by 100.

Bidding_detail view:

i) Update the View and Display Percentages: Above the table in our previous view, we can add a section to display these percentages.

ii) Format the Display: We will use a bold heading for each percentage type and format the number to a fixed number of decimal places.

iii) Ensure Responsiveness: Make sure the display of these percentages adjusts well to different screen sizes, maintaining readability and layout consistency.

3. Test Plan