<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cpwalinj</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cpwalinj"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Cpwalinj"/>
	<updated>2026-08-07T17:47:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156340</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156340"/>
		<updated>2024-04-24T00:32:06Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
===Current Problem===&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Key Deficiencies===&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2795 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Goal ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enhance the Expertiza bidding system, making it more intuitive and efficient for both instructors and students. Our primary focus areas include:&lt;br /&gt;
&lt;br /&gt;
*'''Clarity and Visibility:''' We aim to clearly present bidding results, featuring distinct columns for bid priorities and detailed team bid information.&lt;br /&gt;
&lt;br /&gt;
*'''Separation of Concerns:''' Based on prior feedback, the bidding logic will be separated from the assignment controller to improve system maintainability and adhere to the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
*'''Enhanced Logic and Navigation:''' The project will introduce refined logic for calculating preferred choice percentages to ensure fairness in topic assignments. Additionally, bidding results will be moved to a dedicated page, improving the user experience by providing a focused and intuitive navigation by adding tooltip to show percentage calculation.&lt;br /&gt;
&lt;br /&gt;
The UI/UX will be redesigned to minimize clutter, ensuring that information is visible only when necessary and enhancing the overall usability of the interface.&lt;br /&gt;
&lt;br /&gt;
By achieving these objectives, we intend to significantly improve the bidding system in Expertiza, ensuring it is a more effective tool for educational environments.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
* Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
* Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
 &lt;br /&gt;
* Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
* Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. We can also see the tooltip for the calculation of the percentages when we hover over the percentages.&lt;br /&gt;
[[File:Bidding_sum_view1.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flow of the Bidding Process ===&lt;br /&gt;
The instructor will login as an instructor, and access the assignments page. Next they will select the assignment from the assignment list and open it for editing. Check the &amp;quot;has topics&amp;quot; checkbox to activate the topics tab and visit it. Now instructor can add a new topic by filling the new topic form. Submit the form and update the topic list. Now the students can start bidding on the topics (assigning their 1st, 2nd and 3rd priorities.  Now the instructor can check the bidding details by clicking &amp;quot;show bids by priority&amp;quot; button on the topics page. &lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
====1. Display bidding summary based on priority details ====&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===2. Background Color according to percentage===&lt;br /&gt;
====[https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ====&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===3. Button to show bids by priority===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===4. Bidding Summary Table ===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. We can also see the tooltip for the calculation of the percentages when we hover over the percentages. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view1.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
#Test for the method calculate_bidding_summary_based_on_priority in lottery_controller.&lt;br /&gt;
The test verifies that the calculate_bidding_summary_based_on_priority method accurately computes and returns a structured summary of bids for topics within an assignment, detailing the number of first, second, and third priority bids, total bids, the percentage of first priority bids, and the teams bidding on each topic.&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Test for background color helper method&lt;br /&gt;
The test suite for LotteryHelper#background_color_by_percentage method checks that it returns appropriate CSS background colors for low, medium, and high percentage values, and defaults to no background when the percentage is out of the 0-100% range.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
===Mentor:===&lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Members: ===&lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156325</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156325"/>
		<updated>2024-04-24T00:24:29Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
===Current Problem===&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Key Deficiencies===&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2795 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Goal ==&lt;br /&gt;
&lt;br /&gt;
The goal of this project is to enhance the Expertiza bidding system, making it more intuitive and efficient for both instructors and students. Our primary focus areas include:&lt;br /&gt;
&lt;br /&gt;
*'''Clarity and Visibility:''' We aim to clearly present bidding results, featuring distinct columns for bid priorities and detailed team bid information.&lt;br /&gt;
&lt;br /&gt;
*'''Separation of Concerns:''' Based on prior feedback, the bidding logic will be separated from the assignment controller to improve system maintainability and adhere to the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
*'''Enhanced Logic and Navigation:''' The project will introduce refined logic for calculating preferred choice percentages to ensure fairness in topic assignments. Additionally, bidding results will be moved to a dedicated page, improving the user experience by providing a focused and intuitive navigation by adding tooltip to show percentage calculation.&lt;br /&gt;
&lt;br /&gt;
The UI/UX will be redesigned to minimize clutter, ensuring that information is visible only when necessary and enhancing the overall usability of the interface.&lt;br /&gt;
&lt;br /&gt;
By achieving these objectives, we intend to significantly improve the bidding system in Expertiza, ensuring it is a more effective tool for educational environments.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
* Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
* Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
 &lt;br /&gt;
* Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
* Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. We can also see the tooltip for the calculation of the percentages when we hover over the percentages.&lt;br /&gt;
[[File:Bidding_sum_view1.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flow of the Bidding Process ===&lt;br /&gt;
The instructor will login as an instructor, and access the assignments page. Next they will select the assignment from the assignment list and open it for editing. Check the &amp;quot;has topics&amp;quot; checkbox to activate the topics tab and visit it. Now instructor can add a new topic by filling the new topic form. Submit the form and update the topic list. Now the students can start bidding on the topics (assigning their 1st, 2nd and 3rd priorities.  Now the instructor can check the bidding details by clicking &amp;quot;show bids by priority&amp;quot; button on the topics page. &lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
====1. Display bidding summary based on priority details ====&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===2. Background Color according to percentage===&lt;br /&gt;
====[https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ====&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===3. Button to show bids by priority===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===4. Bidding Summary Table ===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. We can also see the tooltip for the calculation of the percentages when we hover over the percentages. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view1.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
* lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
===Mentor:===&lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Members: ===&lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Bidding_sum_view1.jpg&amp;diff=156322</id>
		<title>File:Bidding sum view1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Bidding_sum_view1.jpg&amp;diff=156322"/>
		<updated>2024-04-24T00:22:40Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=156054</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=156054"/>
		<updated>2024-04-23T17:45:50Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
#Instructors currently lack comprehensive visibility into the bidding process, hindering their ability to understand which topics are most sought after by teams and how teams prioritize their choices.&lt;br /&gt;
#The current system does not provide instructors with essential details such as which teams have bid on specific topics and the percentage of teams assigned their top-choice project.&lt;br /&gt;
#As a result, instructors resort to inefficient workarounds, such as logging in as students to view topic details, which complicates the process and delays access to critical bidding information.&lt;br /&gt;
#This lack of functionality fails to meet instructors' needs for a comprehensive overview of the bidding process, preventing them from effectively managing and allocating projects to teams.&lt;br /&gt;
#Enhancing the topics page and providing instructors with a summary view of the bidding process would empower them with valuable insights, streamline their workflow, and ensure they have the necessary tools to facilitate a fair and efficient project allocation process.&lt;br /&gt;
&lt;br /&gt;
=== Previous Implementations ===&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and scroll down to Bid Summary.&lt;br /&gt;
[[File:2410 2.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Assignment Controller '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/assignments_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.&lt;br /&gt;
* Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.&lt;br /&gt;
* Compiled a list of teams assigned to topics, excluding those on the waitlist.&lt;br /&gt;
* Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.&lt;br /&gt;
* Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.&lt;br /&gt;
* Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.&lt;br /&gt;
* Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Lottery Controller'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
(1) Fetching Assignment and Topics:&lt;br /&gt;
* The method retrieves an `Assignment` object based on the provided `id` parameter.&lt;br /&gt;
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.&lt;br /&gt;
&lt;br /&gt;
(2) Gathering Bids Data:&lt;br /&gt;
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.&lt;br /&gt;
* Iterates over each topic and queries the `Bid` model to fetch all bids associated with that topic. Each bid's team and priority information are encapsulated in a hash and stored in the `@bids_by_topic`, keyed by topic ID.&lt;br /&gt;
&lt;br /&gt;
(3) Team Assignments Tracking:&lt;br /&gt;
* Similarly, `@assigned_teams_by_topic` is prepared to hold information on teams assigned to each topic. This is populated by querying `SignedUpTeam` for non-waitlisted teams for each topic.&lt;br /&gt;
&lt;br /&gt;
(4) Dynamic Instance Variables for Priority Counts:&lt;br /&gt;
* The code dynamically initializes and updates three instance variables: `@count1`, `@count2`, and `@count3` for each priority level (1, 2, 3). These variables are hashes that count the number of bids at each priority level for each topic.&lt;br /&gt;
&lt;br /&gt;
(5) Percentage Calculations:&lt;br /&gt;
* After collecting bids and assigned teams, it calculates the total number of teams that made bids and computes the percentage of teams that received their first, second, and third choices. This is facilitated by helper methods `compute_priority_counts` and `compute_percentages`.&lt;br /&gt;
&lt;br /&gt;
(6) Overall Method Functionality:&lt;br /&gt;
* The method effectively prepares a comprehensive data structure detailing the bids for each topic within the assignment. This includes the number of bids at each priority level and the percentages of teams that were able to secure their preferences. This data is essential for presenting a clear picture of the bidding results to the instructors or other stakeholders.&lt;br /&gt;
&lt;br /&gt;
(7) End Result:&lt;br /&gt;
* The computed data is then used to render a view or to further business logic, providing insight into the distribution and success of bids across the different topics, thus aiding in intelligent assignment and team formation based on bidding data.&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Assignment Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/assignment.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Calculates the percentage of teams that have been awarded their first, second, and third choice topics based on bidding.&lt;br /&gt;
*  ⁠Utilizes a hash to keep count of the choices, initializing at zero for each choice level.&lt;br /&gt;
*  ⁠Iterates over each team to determine if they've been assigned a topic and subsequently increments the count of the choice they've made.&lt;br /&gt;
*  ⁠Counts the total number of teams to avoid division by zero errors when calculating percentages.&lt;br /&gt;
*  ⁠Transforms the counts into percentages by dividing by the total number of teams and multiplying by 100, rounding to two decimal places.&lt;br /&gt;
*  ⁠Provides the calculated percentages for use in views or other parts of the application.&lt;br /&gt;
&lt;br /&gt;
[[File:assignment model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156053</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=156053"/>
		<updated>2024-04-23T17:45:12Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
===Current Problem===&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Key Deficiencies===&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
* Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
* Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
 &lt;br /&gt;
* Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
* Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flow of the Bidding Process ===&lt;br /&gt;
The instructor will login as an instructor, and access the assignments page. Next they will select the assignment from the assignment list and open it for editing. Check the &amp;quot;has topics&amp;quot; checkbox to activate the topics tab and visit it. Now instructor can add a new topic by filling the new topic form. Submit the form and update the topic list. Now the students can start bidding on the topics (assigning their 1st, 2nd and 3rd priorities.  Now the instructor can check the bidding details by clicking &amp;quot;show bids by priority&amp;quot; button on the topics page. &lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
====1. Display bidding summary based on priority details ====&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===2. Background Color according to percentage===&lt;br /&gt;
====[https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ====&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===3. Button to show bids by priority===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===4. Bidding Summary Table ===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
* lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
===Mentor:===&lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Members: ===&lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155855</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155855"/>
		<updated>2024-04-22T21:35:47Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
===Current Problem===&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Key Deficiencies===&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
* Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
* Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
 &lt;br /&gt;
* Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
* Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flow of the Bidding Process ===&lt;br /&gt;
The instructor will login as an instructor, and access the assignments page. Next they will select the assignment from the assignment list and open it for editing. Check the &amp;quot;has topics&amp;quot; checkbox to activate the topics tab and visit it. Now instructor can add a new topic by filling the new topic form. Submit the form and update the topic list. Now the students can start bidding on the topics (assigning their 1st, 2nd and 3rd priorities.  Now the instructor can check the bidding details by clicking &amp;quot;show bids by priority&amp;quot; button on the topics page. &lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
====1. Display bidding summary based on priority details ====&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===2. Background Color according to percentage===&lt;br /&gt;
====[https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ====&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===3. Button to show bids by priority===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
===4. Bidding Summary Table ===&lt;br /&gt;
==== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ====&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
* lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
===Mentor:===&lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===Members: ===&lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155854</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155854"/>
		<updated>2024-04-22T21:32:24Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flow of the Bidding Process ===&lt;br /&gt;
The instructor will login as an instructor, and access the assignments page. Next they will select the assignment from the assignment list and open it for editing. Check the &amp;quot;has topics&amp;quot; checkbox to activate the topics tab and visit it. Now instructor can add a new topic by filling the new topic form. Submit the form and update the topic list. Now the students can start bidding on the topics (assigning their 1st, 2nd and 3rd priorities.  Now the instructor can check the bidding details by clicking &amp;quot;show bids by priority&amp;quot; button on the topics page. &lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155849</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155849"/>
		<updated>2024-04-22T21:20:53Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/saisanthoshG/expertiza Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://youtu.be/g9DzKE5otSU Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155836</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155836"/>
		<updated>2024-04-22T20:19:03Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/g9DzKE5otSU Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155835</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155835"/>
		<updated>2024-04-22T19:58:36Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155834</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155834"/>
		<updated>2024-04-22T19:56:57Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; lottery_controller_spec.rb&lt;br /&gt;
*tests for calculate_bidding_summary_based_on_priority in lottery_controller&lt;br /&gt;
 &amp;lt;pre&amp;gt;describe '#calculate_bidding_summary_based_on_priority' do&lt;br /&gt;
    it 'calculates and returns bidding summary data for topics' do&lt;br /&gt;
      # Setup test data&lt;br /&gt;
      assignment = create(:assignment)&lt;br /&gt;
      topic = create(:topic, assignment: assignment)&lt;br /&gt;
      team = create(:team, assignment: assignment)&lt;br /&gt;
      bid = create(:bid, topic: topic, team: team, priority: 1)&lt;br /&gt;
      team_name = create(:team_name, team: team)&lt;br /&gt;
&lt;br /&gt;
      allow(Assignment).to receive(:find).with(assignment.id).and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([topic])&lt;br /&gt;
      allow(topic).to receive_message_chain(:bids, :includes).and_return([bid])&lt;br /&gt;
      allow(bid).to receive_message_chain(:team, :name).and_return(team_name)&lt;br /&gt;
&lt;br /&gt;
      # Mock params&lt;br /&gt;
      params = { id: assignment.id }&lt;br /&gt;
      allow(controller).to receive(:params).and_return(params)&lt;br /&gt;
&lt;br /&gt;
      # Expected data structure from calculate_bidding_summary_based_on_priority&lt;br /&gt;
      expected_topic_data = [&lt;br /&gt;
        {&lt;br /&gt;
          id: topic.id,&lt;br /&gt;
          name: topic.topic_name,&lt;br /&gt;
          first_bids: 1,&lt;br /&gt;
          second_bids: 0,&lt;br /&gt;
          third_bids: 0,&lt;br /&gt;
          total_bids: 1,&lt;br /&gt;
          percentage_first: 100.0,&lt;br /&gt;
          bidding_teams: [team_name]&lt;br /&gt;
        }&lt;br /&gt;
      ]&lt;br /&gt;
&lt;br /&gt;
      # Call the method&lt;br /&gt;
      controller.instance_variable_set(:@assignment, assignment)&lt;br /&gt;
      expect(controller.calculate_bidding_summary_based_on_priority).to eq(expected_topic_data)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*tests for background color helper method&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  # Assuming your helper module is in the helpers folder&lt;br /&gt;
  RSpec.describe LotteryHelper, type: :helper do&lt;br /&gt;
  # Test for low percentage range&lt;br /&gt;
  describe '#background_color_by_percentage' do&lt;br /&gt;
    it 'returns light red for low percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(10)).to eq('background-color: #ffcccc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for medium percentage range&lt;br /&gt;
    it 'returns light orange for medium percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(50)).to eq('background-color: #ffcc99;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for high percentage range&lt;br /&gt;
    it 'returns light green for high percentages' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(80)).to eq('background-color: #ccffcc;')&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    # Test for percentage out of range&lt;br /&gt;
    it 'returns no background for percentages out of range' do&lt;br /&gt;
      expect(helper.background_color_by_percentage(101)).to eq('background-color: none;')&lt;br /&gt;
      expect(helper.background_color_by_percentage(-1)).to eq('background-color: none;')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155833</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155833"/>
		<updated>2024-04-22T19:51:54Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* View topics with their IDs,&lt;br /&gt;
* View topic names &lt;br /&gt;
* View number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* View the names of those teams&lt;br /&gt;
* View the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
* View the percentage of first bids with tooltip and custom background&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155832</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155832"/>
		<updated>2024-04-22T19:47:17Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/f111f8cc4edd9ebb904237fad185ab86eb4a4a86 Method for background color] ===&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/11f7b788f6f8bca8dbbfb9477873db07823fc8e9 Button view] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/b798b78c8c6b649caa139044635b05ecd446a62e Summary Table] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* view topics with their IDs,&lt;br /&gt;
* view topic names &lt;br /&gt;
* view number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* view the names of those teams&lt;br /&gt;
* view the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155831</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155831"/>
		<updated>2024-04-22T19:41:36Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* view topics with their IDs,&lt;br /&gt;
* view topic names &lt;br /&gt;
* view number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* view the names of those teams&lt;br /&gt;
* view the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155820</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155820"/>
		<updated>2024-04-22T18:59:55Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bidding Summary Table '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/lottery/calculate_bidding_summary_based_on_priority.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* view topics with their IDs,&lt;br /&gt;
* view topic names &lt;br /&gt;
* view number of teams that have bid on that specific topic as their 1st 2nd and 3rd priority bid, &lt;br /&gt;
* view the names of those teams&lt;br /&gt;
* view the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155819</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155819"/>
		<updated>2024-04-22T18:46:10Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Button to show bids by priority'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Button to visit the seperate page to view the results of bidding&lt;br /&gt;
[[File:3_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:3_button.jpg&amp;diff=155818</id>
		<title>File:3 button.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:3_button.jpg&amp;diff=155818"/>
		<updated>2024-04-22T18:45:51Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2_color.jpg&amp;diff=155817</id>
		<title>File:2 color.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2_color.jpg&amp;diff=155817"/>
		<updated>2024-04-22T18:42:16Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155816</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155816"/>
		<updated>2024-04-22T18:41:48Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Background Color according to percentage'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/helpers/lottery_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
* Light red for low percentages&lt;br /&gt;
* Light orange for medium percentages&lt;br /&gt;
* Light green for high percentages&lt;br /&gt;
* No background if outside range&lt;br /&gt;
[[File:2_color.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Assignment Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/assignment.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Calculates the percentage of teams that have been awarded their first, second, and third choice topics based on bidding.&lt;br /&gt;
*  ⁠Utilizes a hash to keep count of the choices, initializing at zero for each choice level.&lt;br /&gt;
*  ⁠Iterates over each team to determine if they've been assigned a topic and subsequently increments the count of the choice they've made.&lt;br /&gt;
*  ⁠Counts the total number of teams to avoid division by zero errors when calculating percentages.&lt;br /&gt;
*  ⁠Transforms the counts into percentages by dividing by the total number of teams and multiplying by 100, rounding to two decimal places.&lt;br /&gt;
*  ⁠Provides the calculated percentages for use in views or other parts of the application.&lt;br /&gt;
&lt;br /&gt;
[[File:assignment model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155815</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155815"/>
		<updated>2024-04-22T18:37:32Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Display bidding summary based on priority details '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `calculate_bidding_summary_based_on_priority` method to `lottery_controller` for aggregating bid data per topic.&lt;br /&gt;
* Prepares data for displaying the bidding details for each topic within an assignment.&lt;br /&gt;
* It calculates the number of bids for each priority (1, 2, 3) per topic and also computes&lt;br /&gt;
* The overall percentages of teams that received their first, second, and third choice.&lt;br /&gt;
* This method is responsible for calculating the bidding table data for an assignment.&lt;br /&gt;
* Computes the count of assigned teams for each priority level (1, 2, 3) across all topics.&lt;br /&gt;
* It checks each team associated with a topic and determines if the team's bid matches&lt;br /&gt;
&lt;br /&gt;
[[File:1_lottery_code.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Lottery Controller'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
(1) Fetching Assignment and Topics:&lt;br /&gt;
* The method retrieves an `Assignment` object based on the provided `id` parameter.&lt;br /&gt;
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.&lt;br /&gt;
&lt;br /&gt;
(2) Gathering Bids Data:&lt;br /&gt;
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.&lt;br /&gt;
* Iterates over each topic and queries the `Bid` model to fetch all bids associated with that topic. Each bid's team and priority information are encapsulated in a hash and stored in the `@bids_by_topic`, keyed by topic ID.&lt;br /&gt;
&lt;br /&gt;
(3) Team Assignments Tracking:&lt;br /&gt;
* Similarly, `@assigned_teams_by_topic` is prepared to hold information on teams assigned to each topic. This is populated by querying `SignedUpTeam` for non-waitlisted teams for each topic.&lt;br /&gt;
&lt;br /&gt;
(4) Dynamic Instance Variables for Priority Counts:&lt;br /&gt;
* The code dynamically initializes and updates three instance variables: `@count1`, `@count2`, and `@count3` for each priority level (1, 2, 3). These variables are hashes that count the number of bids at each priority level for each topic.&lt;br /&gt;
&lt;br /&gt;
(5) Percentage Calculations:&lt;br /&gt;
* After collecting bids and assigned teams, it calculates the total number of teams that made bids and computes the percentage of teams that received their first, second, and third choices. This is facilitated by helper methods `compute_priority_counts` and `compute_percentages`.&lt;br /&gt;
&lt;br /&gt;
(6) Overall Method Functionality:&lt;br /&gt;
* The method effectively prepares a comprehensive data structure detailing the bids for each topic within the assignment. This includes the number of bids at each priority level and the percentages of teams that were able to secure their preferences. This data is essential for presenting a clear picture of the bidding results to the instructors or other stakeholders.&lt;br /&gt;
&lt;br /&gt;
(7) End Result:&lt;br /&gt;
* The computed data is then used to render a view or to further business logic, providing insight into the distribution and success of bids across the different topics, thus aiding in intelligent assignment and team formation based on bidding data.&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Assignment Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/assignment.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Calculates the percentage of teams that have been awarded their first, second, and third choice topics based on bidding.&lt;br /&gt;
*  ⁠Utilizes a hash to keep count of the choices, initializing at zero for each choice level.&lt;br /&gt;
*  ⁠Iterates over each team to determine if they've been assigned a topic and subsequently increments the count of the choice they've made.&lt;br /&gt;
*  ⁠Counts the total number of teams to avoid division by zero errors when calculating percentages.&lt;br /&gt;
*  ⁠Transforms the counts into percentages by dividing by the total number of teams and multiplying by 100, rounding to two decimal places.&lt;br /&gt;
*  ⁠Provides the calculated percentages for use in views or other parts of the application.&lt;br /&gt;
&lt;br /&gt;
[[File:assignment model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:1_lottery_code.jpg&amp;diff=155814</id>
		<title>File:1 lottery code.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:1_lottery_code.jpg&amp;diff=155814"/>
		<updated>2024-04-22T18:37:19Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155811</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155811"/>
		<updated>2024-04-22T18:15:09Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Assignment Controller '''&lt;br /&gt;
=== [https://github.com/expertiza/expertiza/commit/92a7f87eaa07853678c0c922ce147a5e71c20661 Method for bidding analysis] ===&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/assignments_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.&lt;br /&gt;
* Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.&lt;br /&gt;
* Compiled a list of teams assigned to topics, excluding those on the waitlist.&lt;br /&gt;
* Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.&lt;br /&gt;
* Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.&lt;br /&gt;
* Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.&lt;br /&gt;
* Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Lottery Controller'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
(1) Fetching Assignment and Topics:&lt;br /&gt;
* The method retrieves an `Assignment` object based on the provided `id` parameter.&lt;br /&gt;
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.&lt;br /&gt;
&lt;br /&gt;
(2) Gathering Bids Data:&lt;br /&gt;
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.&lt;br /&gt;
* Iterates over each topic and queries the `Bid` model to fetch all bids associated with that topic. Each bid's team and priority information are encapsulated in a hash and stored in the `@bids_by_topic`, keyed by topic ID.&lt;br /&gt;
&lt;br /&gt;
(3) Team Assignments Tracking:&lt;br /&gt;
* Similarly, `@assigned_teams_by_topic` is prepared to hold information on teams assigned to each topic. This is populated by querying `SignedUpTeam` for non-waitlisted teams for each topic.&lt;br /&gt;
&lt;br /&gt;
(4) Dynamic Instance Variables for Priority Counts:&lt;br /&gt;
* The code dynamically initializes and updates three instance variables: `@count1`, `@count2`, and `@count3` for each priority level (1, 2, 3). These variables are hashes that count the number of bids at each priority level for each topic.&lt;br /&gt;
&lt;br /&gt;
(5) Percentage Calculations:&lt;br /&gt;
* After collecting bids and assigned teams, it calculates the total number of teams that made bids and computes the percentage of teams that received their first, second, and third choices. This is facilitated by helper methods `compute_priority_counts` and `compute_percentages`.&lt;br /&gt;
&lt;br /&gt;
(6) Overall Method Functionality:&lt;br /&gt;
* The method effectively prepares a comprehensive data structure detailing the bids for each topic within the assignment. This includes the number of bids at each priority level and the percentages of teams that were able to secure their preferences. This data is essential for presenting a clear picture of the bidding results to the instructors or other stakeholders.&lt;br /&gt;
&lt;br /&gt;
(7) End Result:&lt;br /&gt;
* The computed data is then used to render a view or to further business logic, providing insight into the distribution and success of bids across the different topics, thus aiding in intelligent assignment and team formation based on bidding data.&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Assignment Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/assignment.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Calculates the percentage of teams that have been awarded their first, second, and third choice topics based on bidding.&lt;br /&gt;
*  ⁠Utilizes a hash to keep count of the choices, initializing at zero for each choice level.&lt;br /&gt;
*  ⁠Iterates over each team to determine if they've been assigned a topic and subsequently increments the count of the choice they've made.&lt;br /&gt;
*  ⁠Counts the total number of teams to avoid division by zero errors when calculating percentages.&lt;br /&gt;
*  ⁠Transforms the counts into percentages by dividing by the total number of teams and multiplying by 100, rounding to two decimal places.&lt;br /&gt;
*  ⁠Provides the calculated percentages for use in views or other parts of the application.&lt;br /&gt;
&lt;br /&gt;
[[File:assignment model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which allows the instructor to see all topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid. This information will allow us to see which topic is most trending, ie, what is the topic most students want to work on, and which topics are not doing so well. This enables the instructor to get this information without having to login to the student view and figure this out manually. &lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://www.youtube.com/watch?v=4x_FmhwCU6s Demonstration Video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155804</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=155804"/>
		<updated>2024-04-22T17:23:00Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
'''Current Problem'''&lt;br /&gt;
*Instructors using Expertiza lack comprehensive visibility into the bidding process, impeding their ability to discern the most sought-after topics by teams and the prioritization of choices, leading to inefficient allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Key Deficiencies'''&lt;br /&gt;
*The absence of essential details, such as which teams have bid on specific topics and the percentage of teams assigning their top-choice projects, results in instructors resorting to cumbersome workarounds, hindering effective management and allocation of projects.&lt;br /&gt;
&lt;br /&gt;
'''Proposed Solution'''&lt;br /&gt;
*Enhancing Expertiza's interface with a dedicated view for instructors to access detailed statistics on topic bids, including priority rankings, team names, total bids, and the percentage of teams selecting each topic as their top choice. This solution aims to streamline workflow, empower instructors with valuable insights, and facilitate fair and efficient project allocation.&lt;br /&gt;
&lt;br /&gt;
== Previous Implementations ==&lt;br /&gt;
#[https://github.com/Shreshth-Malik/expertiza E2360 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2659 E2360 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding E2360 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=pGmHyqLj7PM Demo Video]&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/dnguyenv/expertiza/tree/beta E2245 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2392 E2245 Pull Request]&lt;br /&gt;
#[https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding E2245 Wiki Page]&lt;br /&gt;
#[https://www.youtube.com/watch?v=OTSRqRihahQ Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== E2410 Current Implementation ===&lt;br /&gt;
#[https://github.com/shiva1239/expertiza E2410 Github Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2768 E2410 Pull Request]&lt;br /&gt;
#[https://www.youtube.com/watch?v=rfnwqOjLOJ0 Demo Video]&lt;br /&gt;
&lt;br /&gt;
=== Issues With Previous Implementation ===&lt;br /&gt;
# Functions directly fetch and process bids in the controller, which could be better managed through model methods for improved organization.&lt;br /&gt;
# The use of instance variables for bid counts is not scalable and can become problematic with changes in the bidding process.&lt;br /&gt;
# The current approach of fetching topics and iterating for bids may result in inefficient N+1 queries.&lt;br /&gt;
# There's a risk of repeating logic related to bidding across different parts of the application.&lt;br /&gt;
# UI elements and logic are intertwined within the controller, which is not ideal for MVC patterns.&lt;br /&gt;
# The views have repetitive non-zero checks for bid counts, which could be streamlined.&lt;br /&gt;
# CSS styles are hard-coded in views, which should be abstracted to CSS files.&lt;br /&gt;
# Missing error handling could cause unhandled exceptions for nonexistent bids or topics.&lt;br /&gt;
# Tests might not cover all scenarios, such as incorrect bid priorities or unrepresented teams.&lt;br /&gt;
# The UI lacks dynamic feedback mechanisms like AJAX updates for user interactions.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
The design presented in this iteration of the project is very similar to the high-level design proposed last year in [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding Fall 2023 Design]. Since this pull request was not merged, we have included the proposed changes that are credible. Below is a comparable explanation of the previously offered remedy, as well as some new design decisions to improve upon the previous iteration of this issue.&lt;br /&gt;
&lt;br /&gt;
We've significantly improved the bidding system in Expertiza by enhancing the visibility and handling of bids for topics. Key improvements include detailed bidding data presentation, with distinct columns for each bid priority and clear team bid information. This offers users, both instructors and students, a transparent view into the bidding outcomes. Additionally, our refined logic more accurately calculates teams' preferred choice percentages, aiding better decision-making in topic assignments. This has also been moved to a separate page, to improve user-experience.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
=== Sequence Diagram for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:Sequence Diagramb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Current Flow === &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and click &amp;quot;Show bids by priority&amp;quot; button.&lt;br /&gt;
[[File:Topics_bid_button.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding,like the topics with their IDs, their respective topic names, number of teams that have put that specific topic as their 1st 2nd and 3rd priority bid, along with the names of those teams, the total number of bids and finally the percentage of teams that put the specific topic as their first bid.&lt;br /&gt;
[[File:Bidding_sum_view.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart for Bidding Process ===&lt;br /&gt;
&lt;br /&gt;
[[File:flow chartb.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Implementation Details ==&lt;br /&gt;
=== Files Modified During the implementation ===&lt;br /&gt;
&lt;br /&gt;
* assignments_controller.rb&lt;br /&gt;
* lottery_controller.rb&lt;br /&gt;
* assignment.rb&lt;br /&gt;
* bid.rb&lt;br /&gt;
* team.rb&lt;br /&gt;
* assignment_helper.rb&lt;br /&gt;
* _topics.html.erb&lt;br /&gt;
* bidding_details.html.erb&lt;br /&gt;
* _bid_summary_partial.html.erb&lt;br /&gt;
&lt;br /&gt;
=== New functions that are implemented ===&lt;br /&gt;
'''1. Assignment Controller '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/assignments_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.&lt;br /&gt;
* Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.&lt;br /&gt;
* Compiled a list of teams assigned to topics, excluding those on the waitlist.&lt;br /&gt;
* Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.&lt;br /&gt;
* Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.&lt;br /&gt;
* Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.&lt;br /&gt;
* Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Lottery Controller'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
(1) Fetching Assignment and Topics:&lt;br /&gt;
* The method retrieves an `Assignment` object based on the provided `id` parameter.&lt;br /&gt;
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.&lt;br /&gt;
&lt;br /&gt;
(2) Gathering Bids Data:&lt;br /&gt;
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.&lt;br /&gt;
* Iterates over each topic and queries the `Bid` model to fetch all bids associated with that topic. Each bid's team and priority information are encapsulated in a hash and stored in the `@bids_by_topic`, keyed by topic ID.&lt;br /&gt;
&lt;br /&gt;
(3) Team Assignments Tracking:&lt;br /&gt;
* Similarly, `@assigned_teams_by_topic` is prepared to hold information on teams assigned to each topic. This is populated by querying `SignedUpTeam` for non-waitlisted teams for each topic.&lt;br /&gt;
&lt;br /&gt;
(4) Dynamic Instance Variables for Priority Counts:&lt;br /&gt;
* The code dynamically initializes and updates three instance variables: `@count1`, `@count2`, and `@count3` for each priority level (1, 2, 3). These variables are hashes that count the number of bids at each priority level for each topic.&lt;br /&gt;
&lt;br /&gt;
(5) Percentage Calculations:&lt;br /&gt;
* After collecting bids and assigned teams, it calculates the total number of teams that made bids and computes the percentage of teams that received their first, second, and third choices. This is facilitated by helper methods `compute_priority_counts` and `compute_percentages`.&lt;br /&gt;
&lt;br /&gt;
(6) Overall Method Functionality:&lt;br /&gt;
* The method effectively prepares a comprehensive data structure detailing the bids for each topic within the assignment. This includes the number of bids at each priority level and the percentages of teams that were able to secure their preferences. This data is essential for presenting a clear picture of the bidding results to the instructors or other stakeholders.&lt;br /&gt;
&lt;br /&gt;
(7) End Result:&lt;br /&gt;
* The computed data is then used to render a view or to further business logic, providing insight into the distribution and success of bids across the different topics, thus aiding in intelligent assignment and team formation based on bidding data.&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''3. Assignment Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/assignment.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Calculates the percentage of teams that have been awarded their first, second, and third choice topics based on bidding.&lt;br /&gt;
*  ⁠Utilizes a hash to keep count of the choices, initializing at zero for each choice level.&lt;br /&gt;
*  ⁠Iterates over each team to determine if they've been assigned a topic and subsequently increments the count of the choice they've made.&lt;br /&gt;
*  ⁠Counts the total number of teams to avoid division by zero errors when calculating percentages.&lt;br /&gt;
*  ⁠Transforms the counts into percentages by dividing by the total number of teams and multiplying by 100, rounding to two decimal places.&lt;br /&gt;
*  ⁠Provides the calculated percentages for use in views or other parts of the application.&lt;br /&gt;
&lt;br /&gt;
[[File:assignment model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''4. Bid Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/bid.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* The method for merging bid data from different users was refined with clearer comments.&lt;br /&gt;
* The method now organizes bidding information into a matrix structure, keyed by topic, simplifying the representation of bids for analysis.&lt;br /&gt;
* A new method was introduced to calculate the percentages of teams receiving their preferred choices, with logic to prevent division by zero.&lt;br /&gt;
* The data is then normalized to percentages, providing a concise and accurate calculation for bid analytics.&lt;br /&gt;
&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Team Model '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/models/team.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Expanded the Team model with methods to fetch a team’s bid for a given topic.&lt;br /&gt;
* Added functionality to retrieve the assigned sign-up topic for a team.&lt;br /&gt;
* Refined the Team model's interface for interacting with associated bids and sign-up topics.&lt;br /&gt;
&lt;br /&gt;
[[File:bid model.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''6. Assignment Helper '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/helpers/assignment_helper.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
The ⁠ bid_intensity_class ⁠ method in the Assignment Helper serves the following functions:&lt;br /&gt;
&lt;br /&gt;
* Determines the CSS class to be applied based on the total number of bids for a topic.&lt;br /&gt;
* If the total bids are between 0 and 5, it returns the class name 'bid-low-intensity'.&lt;br /&gt;
* For total bids between 6 and 10, it returns 'bid-medium-intensity'.&lt;br /&gt;
* If the number of bids exceeds 10, it yields 'bid-high-intensity'.&lt;br /&gt;
* This method assists in visually differentiating the intensity of bidding on topics through color-coding or other styling cues in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:assignmenthelper.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''7. Topics view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
[[File:topics1.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics2.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
[[File:topics3.png|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''8. Bidding Details view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt;./app/views/assignments/bidding_details.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Displays the header &amp;quot;Bidding Details&amp;quot; along with the name of the current assignment.&lt;br /&gt;
* Iterates over each topic that has received bids.&lt;br /&gt;
* Retrieves and displays the name of each topic.&lt;br /&gt;
* Creates a table structure with headers &amp;quot;Team Name&amp;quot; and &amp;quot;Bid Priority&amp;quot;.&lt;br /&gt;
* Loops through the bids associated with each topic.&lt;br /&gt;
* For each bid, it displays the name of the team that placed the bid.&lt;br /&gt;
* Also for each bid, it displays the priority level of the bid (e.g., 1st priority, 2nd priority).&lt;br /&gt;
* Structures the data in a tabular format for clear visualization of teams and their bidding priorities per topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''9. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Accomplishment ==&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
Follow these instructions to manually test the below functionality:&lt;br /&gt;
&lt;br /&gt;
* Navigate to the assignments page and click on the pencil icon next to the 'Test OODD' assignment.&lt;br /&gt;
* Confirm that the 'Has Topics' checkbox is selected on the general assignment settings page.&lt;br /&gt;
* Move to the 'Topics' tab and check the 'Enable bidding for topics' option.&lt;br /&gt;
* Add a new topic for students to bid on by clicking the 'New Topic' button and entering relevant details.&lt;br /&gt;
* Log in as a student and bid on the new topic, choosing the priority level for the bid.&lt;br /&gt;
* Return to the 'Topics' tab as an instructor to view the updated bidding table with bids and priorities listed.&lt;br /&gt;
* Confirm that the total number of bids and the number of #1, #2, and #3 bids are displayed correctly for each topic.&lt;br /&gt;
* Check the background color coding (green, yellow, red) in the bidding table that reflects the intensity of bids for visual verification.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Topics_bid_button.jpg&amp;diff=155773</id>
		<title>File:Topics bid button.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Topics_bid_button.jpg&amp;diff=155773"/>
		<updated>2024-04-22T16:53:54Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Bidding_sum_view.jpg&amp;diff=155772</id>
		<title>File:Bidding sum view.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Bidding_sum_view.jpg&amp;diff=155772"/>
		<updated>2024-04-22T16:50:49Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155543</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155543"/>
		<updated>2024-04-09T02:22:52Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself Principle (DRY): ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
===Files for RSpec Testing ===&lt;br /&gt;
*assignment_controller_spec.rb: Tests `AssignmentController` actions for bidding details. &lt;br /&gt;
*assignment_spec.rb: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing Actions===&lt;br /&gt;
*assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
*assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
*Ensures individual components and model methods behave as expected. Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
===Tools===&lt;br /&gt;
*Utilizes RSpec for automated testing. Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
*Execution: Run tests via `rspec` command. Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155538</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155538"/>
		<updated>2024-04-09T02:21:32Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself Principle (DRY): ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
===Files for RSpec Testing ===&lt;br /&gt;
**assignment_controller_spec.rb: Tests `AssignmentController` actions for bidding details. &lt;br /&gt;
**assignment_spec.rb: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing Actions===&lt;br /&gt;
*assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
*assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
===Purpose===&lt;br /&gt;
Ensures individual components and model methods behave as expected. Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
===Tools===&lt;br /&gt;
Utilizes RSpec for automated testing. Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
*Execution: Run tests via `rspec` command. Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155535</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155535"/>
		<updated>2024-04-09T02:18:34Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
*Files for RSpec Testing: &lt;br /&gt;
**assignment_controller_spec.rb: Tests `AssignmentController` actions for bidding details. &lt;br /&gt;
**assignment_spec.rb: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
*RSpec Testing Actions:&lt;br /&gt;
**assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
**assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
*Purpose: Ensures individual components and model methods behave as expected. Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
*Tools: Utilizes RSpec for automated testing. Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
*Execution: Run tests via `rspec` command. Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155534</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155534"/>
		<updated>2024-04-09T02:18:06Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
*Files for RSpec Testing: &lt;br /&gt;
**assignment_controller_spec.rb: Tests `AssignmentController` actions for bidding details. &lt;br /&gt;
**assignment_spec.rb: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
*RSpec Testing Actions*:&lt;br /&gt;
**assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
**assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
*Purpose: Ensures individual components and model methods behave as expected. Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
*Tools: Utilizes RSpec for automated testing. Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
*Execution: Run tests via `rspec` command. Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155532</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155532"/>
		<updated>2024-04-09T02:16:57Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
*Files for RSpec Testing:&lt;br /&gt;
assignment_controller_spec.rb**: Tests `AssignmentController` actions for bidding details. assignment_spec.rb**: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
*RSpec Testing Actions*:&lt;br /&gt;
**assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
**assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
*Purpose:&lt;br /&gt;
Ensures individual components and model methods behave as expected.&lt;br /&gt;
Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
*Tools:&lt;br /&gt;
Utilizes RSpec for automated testing.&lt;br /&gt;
Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
*Execution:&lt;br /&gt;
Run tests via `rspec` command.&lt;br /&gt;
Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155531</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155531"/>
		<updated>2024-04-09T02:16:17Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
*Files for RSpec Testing:&lt;br /&gt;
assignment_controller_spec.rb**: Tests `AssignmentController` actions for bidding details. assignment_spec.rb**: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
*RSpec Testing Actions*:&lt;br /&gt;
**assignment_controller_spec.rb: Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
**assignment_spec.rb : Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
3. **Purpose**:&lt;br /&gt;
   - Ensures individual components and model methods behave as expected.&lt;br /&gt;
   - Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
4. **Tools**:&lt;br /&gt;
   - Utilizes RSpec for automated testing.&lt;br /&gt;
   - Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
5. **Execution**:&lt;br /&gt;
   - Run tests via `rspec` command.&lt;br /&gt;
   - Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155527</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155527"/>
		<updated>2024-04-09T02:15:08Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform and add meaningful comments where necessary.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
&lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
1. **Files for RSpec Testing**:&lt;br /&gt;
   - **assignment_controller_spec.rb**: Tests `AssignmentController` actions for bidding details.&lt;br /&gt;
   - **assignment_spec.rb**: Tests `Assignment` model methods for bidding calculations.&lt;br /&gt;
&lt;br /&gt;
2. **RSpec Testing Actions**:&lt;br /&gt;
   - **assignment_controller_spec.rb**:&lt;br /&gt;
     - Tests `bidding_details` and `bidding_details_for_topic` actions.&lt;br /&gt;
   - **assignment_spec.rb**:&lt;br /&gt;
     - Tests `calculate_percentage_of_teams_getting_choices`, `teams_bidding_for_each_topic`, `bidding_info_by_topic`, and `assigned_teams_for_topics` methods.&lt;br /&gt;
&lt;br /&gt;
3. **Purpose**:&lt;br /&gt;
   - Ensures individual components and model methods behave as expected.&lt;br /&gt;
   - Validates interaction between components for seamless functionality.&lt;br /&gt;
&lt;br /&gt;
4. **Tools**:&lt;br /&gt;
   - Utilizes RSpec for automated testing.&lt;br /&gt;
   - Optionally Capybara for integration testing.&lt;br /&gt;
&lt;br /&gt;
5. **Execution**:&lt;br /&gt;
   - Run tests via `rspec` command.&lt;br /&gt;
   - Address any failures promptly to maintain code quality.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155496</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155496"/>
		<updated>2024-04-09T01:52:05Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The project focuses on decluttering the bidding view interface to offer a more intuitive user experience. This will not only improve readability and maintainability but also ensure the code adheres to design principles such as the Single Responsibility Principle. The initiative promises to reduce redundancy and elevate the overall functionality of the platform, paving the way for a more robust and user-centric application.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155486</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155486"/>
		<updated>2024-04-09T01:46:54Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RSpec Testing==&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155483</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155483"/>
		<updated>2024-04-09T01:45:49Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===RSpec Testing===&lt;br /&gt;
&lt;br /&gt;
The assignment_controller_spec.rb has existing automated rspec tests in place. Furthermore following tests were added to the code to ensure the functionality is working as expected and thereby increasing code coverage:-&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#bidding_details' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details template' do&lt;br /&gt;
      allow(Assignment).to receive(:find).with('1').and_return(assignment)&lt;br /&gt;
      allow(assignment).to receive(:sign_up_topics).and_return([double('SignUpTopic', id: 1)])&lt;br /&gt;
      allow(Bid).to receive(:where).with(topic_id: 1).and_return([])&lt;br /&gt;
      allow(assignment).to receive(:calculate_percentage_of_teams_getting_choices).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:teams_bidding_for_each_topic).and_return({})&lt;br /&gt;
      allow(assignment).to receive(:assigned_teams_for_topics).and_return({})&lt;br /&gt;
      &lt;br /&gt;
      get :bidding_details, params: { id: 1 }&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:assignment)).to eq(assignment)&lt;br /&gt;
      expect(assigns(:bids_by_topic)).to eq({ 1 =&amp;gt; [] })&lt;br /&gt;
      expect(response).to render_template('bidding_details')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#bidding_details_for_topic' do&lt;br /&gt;
    it 'assigns necessary variables and renders bidding_details_for_topic template' do&lt;br /&gt;
      topic = double('SignUpTopic', id: 1)&lt;br /&gt;
      bids = [double('Bid')]&lt;br /&gt;
&lt;br /&gt;
      allow(SignUpTopic).to receive(:includes).with(:bids).and_return(SignUpTopic)&lt;br /&gt;
      allow(SignUpTopic).to receive(:find).with(1).and_return(topic)&lt;br /&gt;
      allow(topic).to receive(:bids).and_return(bids)&lt;br /&gt;
&lt;br /&gt;
      get :bidding_details_for_topic, params: { topic_id: 1 }, format: :js&lt;br /&gt;
      &lt;br /&gt;
      expect(assigns(:topic)).to eq(topic)&lt;br /&gt;
      expect(assigns(:bids)).to eq(bids)&lt;br /&gt;
      expect(response).to render_template('bidding_details_for_topic')&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the file assignment_spec.rb have the automated rspec tests in them, Few more test case were added to verify the functionalities added.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; assignment_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;describe '#calculate_percentage_of_teams_getting_choices' do&lt;br /&gt;
  it 'calculates the percentage of teams getting their choices' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    topic1 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    topic2 = build(:sign_up_topic, assignment_id: assignment.id)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive(:sign_up_topics).and_return([topic1, topic2])&lt;br /&gt;
    allow(Team).to receive(:where).and_return([team1, team2])&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic1).and_return(bid1)&lt;br /&gt;
    allow(team1).to receive(:bid_for_topic).with(topic2).and_return(bid2)&lt;br /&gt;
    allow(team2).to receive(:bid_for_topic).with(topic2).and_return(bid3)&lt;br /&gt;
&lt;br /&gt;
    # Perform the calculation&lt;br /&gt;
    percentages = assignment.calculate_percentage_of_teams_getting_choices&lt;br /&gt;
&lt;br /&gt;
    # Perform your assertions here&lt;br /&gt;
    expect(percentages[1]).to eq(50.0)&lt;br /&gt;
    expect(percentages[2]).to eq(100.0)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#teams_bidding_for_each_topic' do&lt;br /&gt;
  it 'returns teams bidding for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team)&lt;br /&gt;
    team2 = build(:team)&lt;br /&gt;
    bid1 = build(:bid, team: team1, topic: topic1)&lt;br /&gt;
    bid2 = build(:bid, team: team1, topic: topic2)&lt;br /&gt;
    bid3 = build(:bid, team: team2, topic: topic2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :map).and_return([['Team1', 1]])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :map).and_return([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.teams_bidding_for_each_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([['Team1', 1]])&lt;br /&gt;
    expect(result[2]).to eq([['Team1', 1], ['Team2', 2]])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#bidding_info_by_topic' do&lt;br /&gt;
  it 'returns bidding information by topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    bid1 = build(:bid, team: team1, priority: 1)&lt;br /&gt;
    bid2 = build(:bid, team: team2, priority: 2)&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:bids, :includes, :map).and_return([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.bidding_info_by_topic&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq([{ team_name: 'Team1', bid_priority: 1 }])&lt;br /&gt;
    expect(result[2]).to eq([{ team_name: 'Team2', bid_priority: 2 }])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
describe '#assigned_teams_for_topics' do&lt;br /&gt;
  it 'returns assigned teams for each topic' do&lt;br /&gt;
    # Mock necessary objects for the test&lt;br /&gt;
    assignment = build(:assignment)&lt;br /&gt;
    topic1 = build(:sign_up_topic, id: 1)&lt;br /&gt;
    topic2 = build(:sign_up_topic, id: 2)&lt;br /&gt;
    team1 = build(:team, name: 'Team1')&lt;br /&gt;
    team2 = build(:team, name: 'Team2')&lt;br /&gt;
    allow(assignment).to receive_message_chain(:sign_up_topics, :includes).and_return([topic1, topic2])&lt;br /&gt;
    allow(topic1).to receive_message_chain(:assigned_teams, :map).and_return(['Team1'])&lt;br /&gt;
    allow(topic2).to receive_message_chain(:assigned_teams, :map).and_return(['Team2'])&lt;br /&gt;
&lt;br /&gt;
    # Call the method&lt;br /&gt;
    result = assignment.assigned_teams_for_topics&lt;br /&gt;
&lt;br /&gt;
    # Perform assertions&lt;br /&gt;
    expect(result[1]).to eq(['Team1'])&lt;br /&gt;
    expect(result[2]).to eq(['Team2'])&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155464</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155464"/>
		<updated>2024-04-09T01:43:42Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
*Enhance the user interface of the bidding view to make it less cluttered and more user-friendly.&lt;br /&gt;
*Refactor the assignment_controller.rb by extracting the bidding logic into a separate controller, bidding_logic_controller.rb, to adhere to SRP.&lt;br /&gt;
*Improve the readability and maintainability of the codebase by implementing meaningful method names and adhering to design principles.&lt;br /&gt;
*Reduce redundancy in the code and promote reusability across different models within the platform.&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155456</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155456"/>
		<updated>2024-04-09T01:41:48Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155453</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155453"/>
		<updated>2024-04-09T01:41:20Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;b&amp;gt; &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠ &amp;lt;/b&amp;gt;&lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155450</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155450"/>
		<updated>2024-04-09T01:40:37Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠&lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155445</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155445"/>
		<updated>2024-04-09T01:39:45Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
====Refactoring assignment Controller:====&lt;br /&gt;
File: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb &lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
====Improving Bidding View:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/views/assignments/edit/_topics.html.erb&amp;lt;/code&amp;gt; ⁠, ⁠&amp;lt;code&amp;gt;app/views/assignments/n&amp;lt;/code&amp;gt; , &amp;lt;code&amp;gt;bidding_details.html.erb&amp;lt;/code&amp;gt;&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
====Meaningful Method Names:====&lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/bid.rb&amp;lt;/code&amp;gt; ⁠&lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
====Adherence to Design Principles:==== &lt;br /&gt;
Files: &amp;lt;code&amp;gt;app/controllers/assignment_controller.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/assignment.rb&amp;lt;/code&amp;gt; ⁠, ⁠ &amp;lt;code&amp;gt;app/models/team.rb&amp;lt;/code&amp;gt; ⁠, ⁠ app/models/bid.rb &amp;lt;/code&amp;gt;⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155441</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155441"/>
		<updated>2024-04-09T01:37:18Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
==Plan for Reimplementation of GradesController==&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Refactoring assignment Controller:&amp;lt;/b&amp;gt; &lt;br /&gt;
File: app/controllers/assignment_controller.rb &lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Improving Bidding View:&amp;lt;/b&amp;gt;&lt;br /&gt;
Files: app/views/assignments/edit/_topics.html.erb ⁠, ⁠app/views/assignments/n , bidding_details.html.erb&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Meaningful Method Names:&amp;lt;/b&amp;gt;&lt;br /&gt;
Files: app/controllers/assignment_controller.rb ⁠, ⁠ app/models/assignment.rb ⁠, ⁠ app/models/team.rb ⁠, ⁠ app/models/bid.rb ⁠&lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;⁠Adherence to Design Principles:&amp;lt;/b&amp;gt; &lt;br /&gt;
Files: app/controllers/assignment_controller.rb ⁠, ⁠ app/models/assignment.rb ⁠, ⁠ app/models/team.rb ⁠, ⁠ app/models/bid.rb ⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155437</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155437"/>
		<updated>2024-04-09T01:35:35Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Expertiza ==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source web application built on Ruby on Rails that enables instructors to create customized assignments with topic lists for students to choose from. It facilitates team formation, allowing students to collaborate on assignments and projects. Expertiza supports peer review processes where students can provide feedback on each other's submissions across various document formats, including URLs and wiki pages. This freely available platform provides a flexible and comprehensive solution for managing assignments, teamwork, and peer evaluations.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
We will be improving the UI for bidding view to appear less cluttered.&lt;br /&gt;
We're refactoring the assignment_controller.rb in Expertiza, adding a bidding_logic_controller.rb with a seperate method &amp;quot;topic_wise_bidding_teams&amp;quot; enhancing its codebase to adhere to design principles, improving readability, and reducing redundancy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The reimplementation project entails:&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Refactoring assignment Controller:&amp;lt;/b&amp;gt; &lt;br /&gt;
File: app/controllers/assignment_controller.rb &lt;br /&gt;
Refactor the bidding_details method to a more clear method nameEnhancing code clarity. Separate the bidding logic from the assignment controller to adhere to the Single Responsibility Principle (SRP).&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Improving Bidding View:&amp;lt;/b&amp;gt;&lt;br /&gt;
Files: app/views/assignments/edit/_topics.html.erb ⁠, ⁠app/views/assignments/n , bidding_details.html.erb&lt;br /&gt;
Consolidate the bidding details summary view into a single table for improved clarity and organization. Implement interactive features such as modals or tooltips to provide additional context or information.&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;Meaningful Method Names:&amp;lt;/b&amp;gt;&lt;br /&gt;
Files: app/controllers/assignment_controller.rb ⁠, ⁠ app/models/assignment.rb ⁠, ⁠ app/models/team.rb ⁠, ⁠ app/models/bid.rb ⁠&lt;br /&gt;
Review existing method names and replace generic or unclear names with descriptive ones that accurately reflect their purpose and functionality ensuring consistency.&lt;br /&gt;
&lt;br /&gt;
#&amp;lt;b&amp;gt;⁠Adherence to Design Principles:&amp;lt;/b&amp;gt; &lt;br /&gt;
Files: app/controllers/assignment_controller.rb ⁠, ⁠ app/models/assignment.rb ⁠, ⁠ app/models/team.rb ⁠, ⁠ app/models/bid.rb ⁠&lt;br /&gt;
Refactor code segments to eliminate redundancy and promote code reusability. Stick to the design principles listed below. &lt;br /&gt;
 &lt;br /&gt;
== Design Principles ==&lt;br /&gt;
&lt;br /&gt;
==== Single Responsibility Principle (SRP): ====&lt;br /&gt;
*Each action in the GradesController will be responsible for a specific task related to managing grades.&lt;br /&gt;
*Actions will be refactored to separate concerns such as data retrieval, computation, and view rendering.&lt;br /&gt;
*For example, the `view` action will focus solely on retrieving grading data and rendering the grading report.&lt;br /&gt;
&lt;br /&gt;
==== Don't Repeat Yourself (DRY) Principle: ====&lt;br /&gt;
*Code duplication in the GradesController will be eliminated by extracting common functionality into helper methods or modules.&lt;br /&gt;
*Repetitive logic, such as retrieving questions or calculating penalties, will be refactored to promote code reusability and maintainability.&lt;br /&gt;
&lt;br /&gt;
==== Dependency Inversion Principle (DIP): ====&lt;br /&gt;
*The GradesController will depend on abstractions, interfaces, or higher-level modules instead of concrete implementations.&lt;br /&gt;
*Dependency injection or inversion of control will be used to decouple the controller from specific database or service implementations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155325</id>
		<title>CSC/ECE 517 Spring 2024 - E2410 Reimplement View for results of bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410_Reimplement_View_for_results_of_bidding&amp;diff=155325"/>
		<updated>2024-04-09T00:36:08Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: Created page with &amp;quot;== Introduction == The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management.   Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic face...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
The [http://expertiza.ncsu.edu/ Expertiza] project is a dynamic collaboration between students and faculty at NC State University, built on the Ruby on Rails platform. It serves as a hub for fostering cooperative learning and academic collaboration, offering a suite of tools for efficient course and assignment management. &lt;br /&gt;
&lt;br /&gt;
Expertiza empowers instructors with comprehensive control over the learning process, providing insights into various academic facets such as user profiles, courses, assignments, questionnaires, and reviews. With its user-friendly interface and innovative features, Expertiza revolutionizes collaborative learning, facilitating seamless topic creation, group formation, and peer review. Join us in embracing the transformative potential of digital collaboration to redefine the educational experience.&lt;br /&gt;
&lt;br /&gt;
== Test Login Credentials ==&lt;br /&gt;
&amp;lt;li&amp;gt;UserId: instructor6&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Password: password&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Problem Statement: ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153610</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153610"/>
		<updated>2024-03-24T19:51:03Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
= Problem Statement: =&lt;br /&gt;
The topics page of the bidding shows bidding process and if assigned team for each project. There is no way for the instructor to know what percentage of teams got their first choice of project and which teams have bid on the projects.&lt;br /&gt;
Add a new feature which summaries the Bidding details, &lt;br /&gt;
&lt;br /&gt;
=Previous Work=&lt;br /&gt;
*[[CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding]]&lt;br /&gt;
&lt;br /&gt;
= Accomplishment =&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
==Implemented Code==&lt;br /&gt;
'''1. Assignment Controller '''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/assignments_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
* Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.&lt;br /&gt;
* Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.&lt;br /&gt;
* Compiled a list of teams assigned to topics, excluding those on the waitlist.&lt;br /&gt;
* Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.&lt;br /&gt;
* Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.&lt;br /&gt;
* Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.&lt;br /&gt;
* Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.&lt;br /&gt;
&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''2. Lottery Controller'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/controllers/lottery_controller.rb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
(1) Fetching Assignment and Topics:&lt;br /&gt;
* The method retrieves an `Assignment` object based on the provided `id` parameter.&lt;br /&gt;
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.&lt;br /&gt;
&lt;br /&gt;
(2) Gathering Bids Data:&lt;br /&gt;
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.&lt;br /&gt;
* Iterates over each topic and queries the `Bid` model to fetch all bids associated with that topic. Each bid's team and priority information are encapsulated in a hash and stored in the `@bids_by_topic`, keyed by topic ID.&lt;br /&gt;
&lt;br /&gt;
(3) Team Assignments Tracking:&lt;br /&gt;
* Similarly, `@assigned_teams_by_topic` is prepared to hold information on teams assigned to each topic. This is populated by querying `SignedUpTeam` for non-waitlisted teams for each topic.&lt;br /&gt;
&lt;br /&gt;
(4) Dynamic Instance Variables for Priority Counts:&lt;br /&gt;
* The code dynamically initializes and updates three instance variables: `@count1`, `@count2`, and `@count3` for each priority level (1, 2, 3). These variables are hashes that count the number of bids at each priority level for each topic.&lt;br /&gt;
&lt;br /&gt;
(5) Percentage Calculations:&lt;br /&gt;
* After collecting bids and assigned teams, it calculates the total number of teams that made bids and computes the percentage of teams that received their first, second, and third choices. This is facilitated by helper methods `compute_priority_counts` and `compute_percentages`.&lt;br /&gt;
&lt;br /&gt;
(6) Overall Method Functionality:&lt;br /&gt;
* The method effectively prepares a comprehensive data structure detailing the bids for each topic within the assignment. This includes the number of bids at each priority level and the percentages of teams that were able to secure their preferences. This data is essential for presenting a clear picture of the bidding results to the instructors or other stakeholders.&lt;br /&gt;
&lt;br /&gt;
(7) End Result:&lt;br /&gt;
* The computed data is then used to render a view or to further business logic, providing insight into the distribution and success of bids across the different topics, thus aiding in intelligent assignment and team formation based on bidding data.&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/assignment.rb&lt;br /&gt;
[[File:App-models-assignment.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/bid.rb&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''5. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/_bid_summary_partial.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.&lt;br /&gt;
*  ⁠It checks if there are any sign-up topics associated with the assignment.&lt;br /&gt;
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.&lt;br /&gt;
*  ⁠It also displays the names of teams that have placed bids on the topic.&lt;br /&gt;
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:&lt;br /&gt;
** Red for 0%, indicating no team got their first choice.&lt;br /&gt;
** Green for 100%, indicating all teams got their first choice.&lt;br /&gt;
** Orange for any percentage in between.&lt;br /&gt;
*  ⁠If no bids are present for a topic, it notes that.&lt;br /&gt;
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/bidding_details.html.erb&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Bid Summary view'''&lt;br /&gt;
&lt;br /&gt;
File : &amp;lt;code&amp;gt; ./app/views/assignments/edit/_topics.html.erb &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Functionality:&lt;br /&gt;
&lt;br /&gt;
*  ⁠Introduced conditional checks for displaying specific sections in the topics form based on the assignment's properties like whether it allows suggestions, is intelligent, has a staggered deadline, etc.&lt;br /&gt;
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.&lt;br /&gt;
*  ⁠Created a dynamic table that lists out the topic names, the count of first, second, and third priority bids, total bids, and names of bidding teams.&lt;br /&gt;
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.&lt;br /&gt;
*  ⁠Added modals to provide detailed bidding information for each topic, which will be populated via an AJAX call to a specified endpoint with the topic ID.&lt;br /&gt;
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.&lt;br /&gt;
&lt;br /&gt;
app/views/assignments/edit/_topics.html.erb&lt;br /&gt;
*./config/routes.rb&lt;br /&gt;
*./app/models/team.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Changes==&lt;br /&gt;
&lt;br /&gt;
= Use Case Diagram: =&lt;br /&gt;
=Current Flow: = &lt;br /&gt;
&lt;br /&gt;
*Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
*Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Now go to Topics section and scroll down to Bid Summary.&lt;br /&gt;
[[File:2410 2.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*Here you will be able to view various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=Demo Video=&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
=Reference=&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Assignments]]&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153524</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153524"/>
		<updated>2024-03-24T17:47:12Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
= Background: =&lt;br /&gt;
The topics page of the bidding shows bidding process and if assigned team for each project. There is no way for the instructor to know what percentage of teams got their first choice of project and which teams have bid on the projects.&lt;br /&gt;
&lt;br /&gt;
=Previous Work=&lt;br /&gt;
*[[CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding]]&lt;br /&gt;
&lt;br /&gt;
= Accomplishment =&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''Files involved:'''&lt;br /&gt;
The files that have been worked on are:&lt;br /&gt;
*./app/controllers/assignments_controller.rb&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/controllers/lottery_controller.rb&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/assignment.rb&lt;br /&gt;
[[File:App-models-assignment.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/bid.rb&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/_bid_summary_partial.html.erb&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/bidding_details.html.erb&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/edit/_topics.html.erb&lt;br /&gt;
*./config/routes.rb&lt;br /&gt;
*./app/models/team.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Changes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Use Case Diagram: =&lt;br /&gt;
=Current Flow: = &lt;br /&gt;
&lt;br /&gt;
Go to the assignments section, we have created a dummy a assignment, &amp;quot;Test OODD&amp;quot;, click edit icon next to it.&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
&lt;br /&gt;
Now make sure the &amp;quot;has topics&amp;quot; checkbox is selected.&lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
Now go to Topics section and scroll down to Bid Summary.&lt;br /&gt;
[[File:2410 2.jpeg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
Here you will be able to view various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
=Demo Video=&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
=Reference=&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Assignments]]&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153504</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153504"/>
		<updated>2024-03-24T17:27:28Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
= Background: =&lt;br /&gt;
The topics page of the bidding shows bidding process and if assigned team for each project. There is no way for the instructor to know what percentage of teams got their first choice of project and which teams have bid on the projects.&lt;br /&gt;
&lt;br /&gt;
=Previous Work=&lt;br /&gt;
*[[CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding]]&lt;br /&gt;
&lt;br /&gt;
= Accomplishment =&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''Files involved:'''&lt;br /&gt;
The files that have been worked on are:&lt;br /&gt;
*./app/controllers/assignments_controller.rb&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/controllers/lottery_controller.rb&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/assignment.rb&lt;br /&gt;
[[File:App-models-assignment.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/bid.rb&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/_bid_summary_partial.html.erb&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/bidding_details.html.erb&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/edit/_topics.html.erb&lt;br /&gt;
*./config/routes.rb&lt;br /&gt;
*./app/models/team.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code Changes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Use Case Diagram: =&lt;br /&gt;
=Current Flow: = &lt;br /&gt;
On the assignments&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
[[File:2410 2.jpeg|frameless|upright=3]]&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Demo Video=&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
=Reference=&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha Reddy Gutha (agutha@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Assignments]]&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153466</id>
		<title>CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2024_-_E2410._View_for_Results_of_Bidding&amp;diff=153466"/>
		<updated>2024-03-24T16:39:52Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
Expertiza is an open source project based on Ruby on Rails framework. It is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Expertiza enables the instructor to create new and customize existing assignments. It also enables the instructor to create a list of topics the students can sign up for as part of a project. Students can form teams in Expertiza to work on various projects and assignments. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
= Background: =&lt;br /&gt;
The topics page of the bidding shows bidding process and if assigned team for each project. There is no way for the instructor to know what percentage of teams got their first choice of project and which teams have bid on the projects.&lt;br /&gt;
&lt;br /&gt;
=Previous Work=&lt;br /&gt;
*[[CSC/ECE_517_Fall_2023_-_E2360._View_for_Results_of_Bidding]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2022_-_E2245:_View_for_results_of_bidding]]&lt;br /&gt;
&lt;br /&gt;
= Accomplishment =&lt;br /&gt;
This project has added a &amp;quot;Bid Summary&amp;quot;, which enables the instructor to see various stats of the bidding, like the percentage of teams that got their first choice of project, the number of teams that put the particular project as their first, second and third choice and the individual teams which bid on the particular project.&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
'''Files involved:'''&lt;br /&gt;
The files that have been worked on are:&lt;br /&gt;
*./app/controllers/assignments_controller.rb&lt;br /&gt;
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/controllers/lottery_controller.rb&lt;br /&gt;
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/models/assignment.rb&lt;br /&gt;
[[File:App-models-assignment.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*./app/models/bid.rb&lt;br /&gt;
[[File:App-models-bid.rb.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/_bid_summary_partial.html.erb&lt;br /&gt;
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
*./app/views/assignments/bidding_details.html.erb&lt;br /&gt;
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*./config/routes.rb&lt;br /&gt;
*./app/models/team.rb&lt;br /&gt;
&lt;br /&gt;
==Code Changes==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Use Case Diagram: =&lt;br /&gt;
=Current Flow: = &lt;br /&gt;
On the assignments&lt;br /&gt;
[[File:2410 1.jpeg|frameless|upright=3]] &lt;br /&gt;
[[File:24104.jpeg|frameless|upright=3]]&lt;br /&gt;
[[File:2410 2.jpeg|frameless|upright=3]]&lt;br /&gt;
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Demo Video=&lt;br /&gt;
You can watch this [https://youtu.be/rfnwqOjLOJ0 demo video]for a detailed demonstration of the project.&lt;br /&gt;
&lt;br /&gt;
=Reference=&lt;br /&gt;
*https://github.com/expertiza/expertiza&lt;br /&gt;
*http://expertiza.ncsu.edu/&lt;br /&gt;
*http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
'''Mentor:''' &lt;br /&gt;
*Anvitha &lt;br /&gt;
&lt;br /&gt;
'''Members: ''' &lt;br /&gt;
*Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)&lt;br /&gt;
*Sai Santhosh Garlapati (sgarlap@ncsu.edu)&lt;br /&gt;
*Chinmay Walinjkar (cpwalinj@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Assignments]]&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:App-views-assignments-bidding_details.jpg&amp;diff=153465</id>
		<title>File:App-views-assignments-bidding details.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:App-views-assignments-bidding_details.jpg&amp;diff=153465"/>
		<updated>2024-03-24T16:38:31Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:App-views-assignments-_bid_summary_partial.jpg&amp;diff=153462</id>
		<title>File:App-views-assignments- bid summary partial.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:App-views-assignments-_bid_summary_partial.jpg&amp;diff=153462"/>
		<updated>2024-03-24T16:34:32Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:App-models-bid.rb.jpg&amp;diff=153460</id>
		<title>File:App-models-bid.rb.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:App-models-bid.rb.jpg&amp;diff=153460"/>
		<updated>2024-03-24T16:31:51Z</updated>

		<summary type="html">&lt;p&gt;Cpwalinj: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Cpwalinj</name></author>
	</entry>
</feed>