CSC/ECE 517 Spring 2024 - E2410. View for Results of Bidding: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
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.
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.


= Background: =
= Problem Statement: =
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.
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.
Add a new feature which summaries the Bidding details,


=Previous Work=
=Previous Work=
Line 13: Line 14:
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]


'''Files involved:'''
==Implemented Code==
The files that have been worked on are:
'''1. Assignment Controller '''
*./app/controllers/assignments_controller.rb
 
File : <code> ./app/controllers/assignments_controller.rb </code>
 
Functionality:
 
* Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.
* Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.
* Compiled a list of teams assigned to topics, excluding those on the waitlist.
* Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.
* Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.
* Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.
* Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.
 
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]
[[File:App-controller-assignments_controller.jpg|frameless|upright=3]]


*./app/controllers/lottery_controller.rb
'''2. Lottery Controller'''
 
File : <code> ./app/controllers/lottery_controller.rb </code>
 
Functionality:
 
(1) Fetching Assignment and Topics:
* The method retrieves an `Assignment` object based on the provided `id` parameter.
* It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.
 
(2) Gathering Bids Data:
* It initializes an empty hash `@bids_by_topic` to store bid information by topic.
* 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.
 
(3) Team Assignments Tracking:
* 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.
 
(4) Dynamic Instance Variables for Priority Counts:
* 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.
 
(5) Percentage Calculations:
* 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`.
 
(6) Overall Method Functionality:
* 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.
 
(7) End Result:
* 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.
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]
[[File:App-controllers-lottery controller.rb.jpg|frameless|upright=3]]


Line 27: Line 67:
[[File:App-models-bid.rb.jpg|frameless|upright=3]]
[[File:App-models-bid.rb.jpg|frameless|upright=3]]


*./app/views/assignments/_bid_summary_partial.html.erb
'''5. Bid Summary view'''
 
File : <code> ./app/views/assignments/_bid_summary_partial.html.erb </code>
 
Functionality:
 
*  ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.
*  ⁠It checks if there are any sign-up topics associated with the assignment.
*  ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.
*  ⁠It also displays the names of teams that have placed bids on the topic.
*  ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:
** Red for 0%, indicating no team got their first choice.
** Green for 100%, indicating all teams got their first choice.
** Orange for any percentage in between.
*  ⁠If no bids are present for a topic, it notes that.
*  ⁠If there are no topics created for the assignment, it informs the user accordingly.
 
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]
[[File:App-views-assignments- bid summary partial.jpg|frameless|upright=3]]


Line 33: Line 89:
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]
[[File:App-views-assignments-bidding details.jpg|frameless|upright=3]]


*./app/views/assignments/edit/_topics.html.erb
 
'''7. Bid Summary view'''
 
File : <code> ./app/views/assignments/edit/_topics.html.erb </code>
 
Functionality:
 
* ⁠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.
*  ⁠Added a summary section to display aggregated bidding data if bidding is enabled.
*  ⁠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.
*⁠  ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.
*  ⁠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.
*  ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.
 
app/views/assignments/edit/_topics.html.erb
*./config/routes.rb
*./config/routes.rb
*./app/models/team.rb
*./app/models/team.rb
Line 39: Line 109:


==Code Changes==
==Code Changes==


= Use Case Diagram: =
= Use Case Diagram: =
=Current Flow: =  
=Current Flow: =  


Go to the assignments section, we have created a dummy a assignment, "Test OODD", click edit icon next to it.
*Go to the assignments section, we have created a dummy a assignment, "Test OODD", click edit icon next to it.
[[File:2410 1.jpeg|frameless|upright=3]]  
[[File:2410 1.jpeg|frameless|upright=3]]  


Now make sure the "has topics" checkbox is selected.
*Now make sure the "has topics" checkbox is selected.
[[File:24104.jpeg|frameless|upright=3]]
[[File:24104.jpeg|frameless|upright=3]]


Now go to Topics section and scroll down to Bid Summary.
*Now go to Topics section and scroll down to Bid Summary.
[[File:2410 2.jpeg|frameless|upright=3]]
[[File:2410 2.jpeg|frameless|upright=3]]


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.
*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.
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]
[[File:Screenshot 2024-03-24 at 11.42.05 AM.jpg|frameless|upright=3]]



Revision as of 19:51, 24 March 2024

Introduction

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.

Problem Statement:

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. Add a new feature which summaries the Bidding details,

Previous Work

Accomplishment

This project has added a "Bid Summary", 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.

Implemented Code

1. Assignment Controller

File : ./app/controllers/assignments_controller.rb

Functionality:

  • Added `bidding_details` method to `AssignmentController` for aggregating bid data per topic.
  • Implemented data retrieval for each topic's bids within an assignment using `@assignment.sign_up_topics`.
  • Compiled a list of teams assigned to topics, excluding those on the waitlist.
  • Introduced dynamic counting of bids per priority (1, 2, 3) for each topic and stored the results in `@count1`, `@count2`, and `@count3`.
  • Calculated the total number of teams and their respective percentages for obtaining their first, second, and third choice topics.
  • Created `bidding_details_for_topic` method to handle AJAX requests and render bid details for a specific topic.
  • Structured bid data retrieval to support interactive, on-the-fly updates in the user interface.

2. Lottery Controller

File : ./app/controllers/lottery_controller.rb

Functionality:

(1) Fetching Assignment and Topics:

  • The method retrieves an `Assignment` object based on the provided `id` parameter.
  • It then fetches all `SignUpTopic` objects associated with this assignment, storing them in the `@topics` instance variable.

(2) Gathering Bids Data:

  • It initializes an empty hash `@bids_by_topic` to store bid information by topic.
  • 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.

(3) Team Assignments Tracking:

  • 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.

(4) Dynamic Instance Variables for Priority Counts:

  • 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.

(5) Percentage Calculations:

  • 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`.

(6) Overall Method Functionality:

  • 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.

(7) End Result:

  • 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.

  • ./app/models/assignment.rb

  • ./app/models/bid.rb

5. Bid Summary view

File : ./app/views/assignments/_bid_summary_partial.html.erb

Functionality:

  • ⁠The snippet is part of a view template that generates a summary of bidding data for assignment topics.
  • ⁠It checks if there are any sign-up topics associated with the assignment.
  • ⁠For each topic, it lists out the total number of bids, along with a breakdown of bids by priority level: first, second, and third.
  • ⁠It also displays the names of teams that have placed bids on the topic.
  • ⁠The percentage of teams that got their first choice is calculated and displayed, color-coded to indicate the outcome:
    • Red for 0%, indicating no team got their first choice.
    • Green for 100%, indicating all teams got their first choice.
    • Orange for any percentage in between.
  • ⁠If no bids are present for a topic, it notes that.
  • ⁠If there are no topics created for the assignment, it informs the user accordingly.

  • ./app/views/assignments/bidding_details.html.erb


7. Bid Summary view

File : ./app/views/assignments/edit/_topics.html.erb

Functionality:

  • ⁠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.
  • ⁠Added a summary section to display aggregated bidding data if bidding is enabled.
  • ⁠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.
  • ⁠ ⁠Implemented a method to classify bid intensity into low, medium, and high based on the total number of bids.
  • ⁠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.
  • ⁠Set up a JavaScript function to handle click events on information buttons, triggering AJAX calls and displaying bid details in modals.

app/views/assignments/edit/_topics.html.erb

  • ./config/routes.rb
  • ./app/models/team.rb


Code Changes

Use Case Diagram:

Current Flow:

  • Go to the assignments section, we have created a dummy a assignment, "Test OODD", click edit icon next to it.

  • Now make sure the "has topics" checkbox is selected.

  • Now go to Topics section and scroll down to Bid Summary.

  • 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.

Demo Video

You can watch this demo videofor a detailed demonstration of the project.

Reference

Team

Mentor:

  • Anvitha Reddy Gutha (agutha@ncsu.edu)

Members:

  • Shiva Vara Prasad Kandhagatla (skandha@ncsu.edu)
  • Sai Santhosh Garlapati (sgarlap@ncsu.edu)
  • Chinmay Walinjkar (cpwalinj@ncsu.edu)