<?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=Kvankad</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=Kvankad"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Kvankad"/>
	<updated>2026-08-11T18:55:27Z</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_2023&amp;diff=147592</id>
		<title>CSC/ECE 517 Spring 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023&amp;diff=147592"/>
		<updated>2023-03-21T20:31:45Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Create new page for spring 2023&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
[[CSC/ECE 517 Spring_2023 - E2320. Reimplement the Question hierarchy]]&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023-_E2320._Reimplement_the_Question_hierarchy&amp;diff=147591</id>
		<title>CSC/ECE 517 Spring 2023- E2320. Reimplement the Question hierarchy</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023-_E2320._Reimplement_the_Question_hierarchy&amp;diff=147591"/>
		<updated>2023-03-21T20:31:17Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Kvankad moved page CSC/ECE 517 Spring 2023- E2320. Reimplement the Question hierarchy to CSC/ECE 517 Spring 2023 - E2320. Reimplement the Question hierarchy: Changing title to conform to format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CSC/ECE 517 Spring 2023 - E2320. Reimplement the Question hierarchy]]&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2320._Reimplement_the_Question_hierarchy&amp;diff=147590</id>
		<title>CSC/ECE 517 Spring 2023 - E2320. Reimplement the Question hierarchy</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2023_-_E2320._Reimplement_the_Question_hierarchy&amp;diff=147590"/>
		<updated>2023-03-21T20:31:17Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Kvankad moved page CSC/ECE 517 Spring 2023- E2320. Reimplement the Question hierarchy to CSC/ECE 517 Spring 2023 - E2320. Reimplement the Question hierarchy: Changing title to conform to format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a [http://rubyonrails.org/ Ruby on Rails] based open source project. Instructors have the ability to add new projects, assignments, etc., as well as edit existing ones. Later on, they can view student submissions and grade them. Students can also use Expertiza to organize into teams to work on different projects and assignments and submit their work. They can also review other students' submissions.&lt;br /&gt;
&lt;br /&gt;
==Question Hierarchy==&lt;br /&gt;
&lt;br /&gt;
The Question class and its subclasses are used to implement all rubric items, quiz questions, and survey questions in Expertiza.  Here is the hierarchy.&lt;br /&gt;
&lt;br /&gt;
Choice question&lt;br /&gt;
   Scored question&lt;br /&gt;
    Scale [√]&lt;br /&gt;
    Criterion [√]&lt;br /&gt;
   Unscored question&lt;br /&gt;
    Dropdown [√]&lt;br /&gt;
    MultipleChoice&lt;br /&gt;
    CheckBox [√]  [should this be a Scored question?}&lt;br /&gt;
&lt;br /&gt;
TextResponse&lt;br /&gt;
    TextArea [√]&lt;br /&gt;
    TextField [√]&lt;br /&gt;
&lt;br /&gt;
UploadFile [√]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Dropdown, MultipleChoice, and Scale questions have a lot in common: you display the alternatives and let the user choose one of them.  They also differ, in that only Scale is required to have a numeric sequence of choices; Dropdown and MultipleChoice may, but also may have selections that don’t correspond to anything numeric.  We would like to write a single piece of code to display all three types of questions&lt;br /&gt;
&lt;br /&gt;
==Files Modified==&lt;br /&gt;
&lt;br /&gt;
Below are the files we changed as part of the reimplementation&lt;br /&gt;
&lt;br /&gt;
question.rb&lt;br /&gt;
scale.rb&lt;br /&gt;
criterion.rb&lt;br /&gt;
text_area.rb&lt;br /&gt;
text_field.rb&lt;br /&gt;
text_response.rb&lt;br /&gt;
questionnaires_controller.rb&lt;br /&gt;
answer.rb&lt;br /&gt;
checkbox.rb&lt;br /&gt;
choice_question.rb&lt;br /&gt;
dropdown.rb&lt;br /&gt;
multiple_choice_checkbox.rb&lt;br /&gt;
multiple_choice_radio.rb&lt;br /&gt;
question.rb&lt;br /&gt;
question_advice.rb&lt;br /&gt;
questionnaire.rb&lt;br /&gt;
quiz_question.rb&lt;br /&gt;
quiz_question_choice.rb&lt;br /&gt;
scored_question.rb&lt;br /&gt;
unscored_question.rb&lt;br /&gt;
&lt;br /&gt;
==Reimplementation==&lt;br /&gt;
As a part of the reimplementation project, Migrations are created, added relevant old code files and partials are included in the old code files to avoid HTML concatenation.&lt;br /&gt;
&lt;br /&gt;
== Testing  Plan ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Team==&lt;br /&gt;
=====Mentor===== &lt;br /&gt;
* Prof. Edward F. Gehringer&lt;br /&gt;
* Priyam Garg&lt;br /&gt;
&lt;br /&gt;
=====Members===== &lt;br /&gt;
* Colleen Britt&lt;br /&gt;
* Kimberly Jones&lt;br /&gt;
* Priyanka Arghode&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[https://expertiza.ncsu.edu/ Expertiza]&lt;br /&gt;
#[https://stackoverflow.com/questions/3425971/organizing-partials-for-a-polymorphic-resource Organizing Partials]&lt;br /&gt;
#[https://www.amberbit.com/blog/2011/12/27/render-views-and-partials-outside-controllers-in-rails-3 Render Views and Partials Outside Controllers]&lt;br /&gt;
#[https://github.com/pparghod/reimplementation-back-end Github Repo]&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=147589</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=147589"/>
		<updated>2023-03-21T20:25:37Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Added link for Spring 2023&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
* [[Expertiza documentation]]&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Summer 2008]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2010]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2011]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2012]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2013]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2017]]&lt;br /&gt;
* [[CSC/Independent Study Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2019]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Summer 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2023]]&lt;br /&gt;
* [[CSC 456 Spring 2011|CSC 456 Spring 2012]]&lt;br /&gt;
* [[ECE 633]]&lt;br /&gt;
* [[KCU]]&lt;br /&gt;
* [[Progress reports]]&lt;br /&gt;
* [[ReactJs Frontend]]&lt;br /&gt;
* [[Front-End/Back-End]]&lt;br /&gt;
&lt;br /&gt;
==Application Behavior==&lt;br /&gt;
* [[Grading]]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
* [[CSC/ECE_517_Spring_2013/ch1b_1k_hf|Lecture on Metaprogramming]]&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
''Expertiza now has a Java dependency, so the machine you are using to develop Expertiza on should have the JVM installed.''&lt;br /&gt;
&lt;br /&gt;
* [[Setting Up a Development Machine]]&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
* [[Using git and github for projects]]&lt;br /&gt;
* [[Using heroku to deploy your projects]]&lt;br /&gt;
* [[How to Begin a Project from the Current Expertiza Repository]]&lt;br /&gt;
* [[Git]]&lt;br /&gt;
* [[How to Change a User's Password on a Development Machine]]&lt;br /&gt;
* [[Debugging Rails]]&lt;br /&gt;
* [http://rajanalwan.com/ui_guidelines/ Design Template]&lt;br /&gt;
&lt;br /&gt;
==Production==&lt;br /&gt;
* [[Deploying to Production]]&lt;br /&gt;
* [[Downloading Production Data]]&lt;br /&gt;
* [[Accessing the Production Server]]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
* [[Using Cucumber with Expertiza]]&lt;br /&gt;
* [[Rails Testing Overview]]&lt;br /&gt;
* [[Expertiza Continuous Integration]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [[Object-Oriented Design and Programming]]&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144998</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144998"/>
		<updated>2022-04-12T05:05:02Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: waitlist classes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
&lt;br /&gt;
Waitlist feature is utilized during subject assignment in an assignment. For example, during the topic allocation of the Final Project (and design doc), each team had the opportunity to sign up for a topic in which they were interested or to add to a waitlist of a topic in which they were not interested. When a team is added to the queue, many circumstances emerge. The waitlist feature currently does not adhere to the open-closed design paradigm. As a result, our task in this project is to resolve these issues by rewriting the waitlist functionality.&lt;br /&gt;
&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
* '''The topic is available''': In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ). This is pretty straightforward.&lt;br /&gt;
&lt;br /&gt;
* '''The topic is unavailable''': In this case, the team is waitlisted for the topic. When any other team drops this topic, a waitlisted team will be assigned for this topic. &lt;br /&gt;
&lt;br /&gt;
Our task is to simplify the way we are handling the second case. For each topic, we will have to have a waitlist object associated with it. If a team has requested for a topic that is not available, the team would just be queued on to the waitlist for this topic. In the waitlist object, we will have to maintain the team_id and the topic id for which this team will be waitlisted. In the current implementation, the waitlisting functionality is scattered across multiple files. All this has to be consolidated and placed in fewer number of places ( model file and helper class ).&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
The current implementation has multiple models and controllers ( sign_up_topic.rb, waitlist.rb, invitation.rb, lottery_controller.rb, suggestion_controller.rb and signed_up_team.rb etc ) perform actions that indirectly affect the waitlist ( adding or removing teams from waitlist ). As a result, modifying the waitlist is being performed by multiple models and controllers. So, there is a lot of redundancy associated with basic waitlist operations in multiple files.&lt;br /&gt;
&lt;br /&gt;
== Solution ==&lt;br /&gt;
&lt;br /&gt;
To simplify waitlist functionality, to reduce code redundancy and to fix the Single-responsibility principle that is being violated, we will rewrite or move the functions/methods to multiple controllers and model files that manipulate waitlists of a topic. All these classes will now just invoke methods of waitlist.rb. The following files contains the waitlist functionality, so we plan to either refactor or add the functionality.&lt;br /&gt;
&lt;br /&gt;
1) ''signed_up_team.rb''&lt;br /&gt;
&lt;br /&gt;
2) ''waitlist.rb''&lt;br /&gt;
&lt;br /&gt;
3) ''sign_up_sheet_controller.rb''&lt;br /&gt;
&lt;br /&gt;
4) ''sign_up_sheet.rb''&lt;br /&gt;
&lt;br /&gt;
5) ''sign_up_topic.rb''&lt;br /&gt;
&lt;br /&gt;
6) ''suggestion_controller.rb''&lt;br /&gt;
&lt;br /&gt;
7) ''invitation.rb''&lt;br /&gt;
&lt;br /&gt;
== Proposed design ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this. We will be testing the existing features so that we are not breaking what was working before we deployed our fix.&lt;br /&gt;
Our goal is to make the experiza system more reliable and have code that is consistent with the standards of object-oriented design.&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
In this Unified Modeling Language (UML), we summarize the details of the system's users and their interactions with the system. &amp;lt;br&amp;gt;&lt;br /&gt;
We have two users to the system '''Student''' and '''Instructor'''. The interactions these users have with the system are stated below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Student Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1. Student should be able to perform an action to add their own team to the waitlist.  &amp;lt;br&amp;gt;&lt;br /&gt;
2. Student should be able to drop their own team from the waitlist but not others team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Instructor Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1.  Delete or purge on the waitlist items are those actions that have to be performed by the instructor/admin and student should not be given access to delete action.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Instructor should be able to add any team to the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Instructor should be able to drop any team from the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Instructor should be able to fetch the details of the teams in a waitlist for a particular topic.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Instructor should be able to fetch the details of the topics in which a team is waitlisted. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
Tables associated with '''waitlist_teams''' table are&amp;lt;br&amp;gt;&lt;br /&gt;
1. teams&amp;lt;br&amp;gt;&lt;br /&gt;
2. signed_up_teams&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waitlist_teams table is referred by the signed_up_teams and teams table as Foreign Key Relationship.&lt;br /&gt;
&lt;br /&gt;
'''team_id''' : foreign key in waitlists_team table which is a reference to the teams table &amp;lt;br&amp;gt;&lt;br /&gt;
'''topic_id''' : foreign key in waitlists_team table which is a reference to the signed_up_teams table &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
These relationships along with the attributes of the classes are depicted in the class diagram below.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
== Plan of action ==&lt;br /&gt;
&lt;br /&gt;
Following are the sections of changes that we will be doing in this project : &amp;lt;br&amp;gt;&lt;br /&gt;
1. Update the SIGNED_UP_TEAMS table. &amp;lt;br&amp;gt;&lt;br /&gt;
2. Refactoring files that contains waitlist functionality &amp;lt;br&amp;gt;&lt;br /&gt;
3. Add new WAITLIST_TEAMS table using scaffold. &amp;lt;br&amp;gt;&lt;br /&gt;
4. Migrate the data to WAITLIST_TEAMS table from SIGNED_UP_TEAMS table. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Add/Move the business logic to ''waitlist_teams.rb'' file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 1.Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&lt;br /&gt;
=== 2. Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to the is_waitlisted boolean flag should be removed and waitlists must be determined by using the new waitlist_team table. &lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate model class 'WaitlistTeam' which will contain the business logic for managing and modifying waitlisted teams. We also plan on using a helper class 'WaitlistTeamHelper' to add the logic of waitlisting which is called in multiple places across the code. The helper class will help avoid redundant code and make sure the code is implemented in a DRY manner. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===3. Adding new waitlist_teams Table ===&lt;br /&gt;
We plan to add a new table ''waitlist_teams''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The attributes for the table are team_id(refers to the ''teams'' table), topic_id (refers to the ''sign_up_topics'' table)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This table only stores the waitlisted teams for each topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Having separated tables for signups and waitlists will help in managing entries and enforcing constraints and make it easier to implement and extend functionality if required.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The waitlist_helper class will perform the following operations &lt;br /&gt;
#Delete all waitlists for team&lt;br /&gt;
#Purge all waitlists for topic &lt;br /&gt;
#Add team to waitlist&lt;br /&gt;
#Delete specific team from waitlist&lt;br /&gt;
#Get all waitlisted topics for team&lt;br /&gt;
#Get all waitlisted teams for topic&lt;br /&gt;
#Get first team in waitlist for topic&lt;br /&gt;
#Check waitlist empty for topic&lt;br /&gt;
#Check if team has any waitlists &lt;br /&gt;
#Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
=== 4. Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== 5. Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
'''Student's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student_waitlist_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Instructor's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_signup_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''Instructor's View With Waitlists'''&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlist.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Test 1:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to add their team to the waitlist by clicking on '''Check''' icon (see the image above) if the team has not signed up in any topic.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 2:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to drop the team from the waitlist by clicking on '''Delete''' icon (see the image above) if they are no longer interested in it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 3:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to add a student to the topic by clicking on '''Check''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 4:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to delete a student to the topic by clicking on '''Delete''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 5:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the students signup for a topic in the page displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 6:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the topics available &lt;br /&gt;
&lt;br /&gt;
''' Test 7:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view waitlisted and signed up teams for all the topics in the assignment&lt;br /&gt;
&lt;br /&gt;
''' Test 8:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to drop waitlisted team for a topics in the assignment&lt;br /&gt;
&lt;br /&gt;
we will be adding more test cases as the project progress.&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144585</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144585"/>
		<updated>2022-04-07T03:44:54Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
* '''The topic is available''': In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ). This is pretty straightforward.&lt;br /&gt;
&lt;br /&gt;
* '''The topic is unavailable''': In this case, the team is waitlisted for the topic. When any other team drops this topic, a waitlisted team will be assigned for this topic. &lt;br /&gt;
&lt;br /&gt;
Our task is to simplify the way we are handling the second case. For each topic, we will have to have a waitlist object associated with it. If a team has requested for a topic that is not available, the team would just be queued on to the waitlist for this topic. In the waitlist object, we will have to maintain the team_id and the topic id for which this team will be waitlisted. In the current implementation, the waitlisting functionality is scattered across multiple files. All this has to be consolidated and placed in fewer number of places ( model file and helper class ).&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
The current implementation has multiple models and controllers ( sign_up_topic.rb, waitlist.rb, invitation.rb, lottery_controller.rb, suggestion_controller.rb and signed_up_team.rb etc ) perform actions that indirectly affect the waitlist ( adding or removing teams from waitlist ). As a result, modifying the waitlist is being performed by multiple models and controllers. So, there is a lot of redundancy associated with basic waitlist operations in multiple files.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
To simplify waitlist functionality and to reduce code redundancy, we will be moving all the functions present in multiple controllers and model files that manipulate waitlists to waitlist.rb. All these classes will now just invoke methods of waitlist.rb. The list of files and methods which will be modified are &lt;br /&gt;
&lt;br /&gt;
1) signed_up_team.rb&lt;br /&gt;
&lt;br /&gt;
2) waitlist.rb&lt;br /&gt;
&lt;br /&gt;
3) sign_up_sheet_controller.rb&lt;br /&gt;
&lt;br /&gt;
4) sign_up_sheet.rb&lt;br /&gt;
&lt;br /&gt;
5) sign_up_topic.rb&lt;br /&gt;
&lt;br /&gt;
6) suggestion_controller.rb&lt;br /&gt;
&lt;br /&gt;
7) invitation.rb&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this. We will be testing the existing features so that we are not breaking what was working before we deployed our fix.&lt;br /&gt;
Our goal is to make the experiza system more reliable and have code that is consistent with the standards of object-oriented design.&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
In this Unified Modeling Language (UML), we summarize the details of the system's users such as instructors and students and their interactions with the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Student Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1. Student should be able to perform an action to add their own team to the waitlist.  &amp;lt;br&amp;gt;&lt;br /&gt;
2. Student should be able to drop their own team from the waitlist but not others team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Instructor Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1.  Delete or purge on the waitlist items are those actions that have to be performed by the instructor/admin and student should not be given access to delete action.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Instructor should be able to add any team to the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Instructor should be able to drop any team from the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Instructor should be able to fetch the details of the teams in a waitlist for a particular topic.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Instructor should be able to fetch the details of the topics in which a team is waitlisted. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
Tables associated with '''waitlist_teams''' table:&amp;lt;br&amp;gt;&lt;br /&gt;
1. teams&amp;lt;br&amp;gt;&lt;br /&gt;
2. signed_up_teams&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waitlist_teams table is referred by the signed_up_teams and teams table as Foreign Key Relationship.&lt;br /&gt;
&lt;br /&gt;
'''team_id''' : foreign key in waitlists_team table referenced by teams table &amp;lt;br&amp;gt;&lt;br /&gt;
'''topic_id''' : foreign key in waitlists_team table reference by signed_up_teams table &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
We plan to add a new table ''waitlist_teams''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The attributes for the table are team_id(refers to the ''teams'' table), topic_id (refers to the ''sign_up_topics'' table)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This table only stores the waitlisted teams for each topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Having separated tables for signups and waitlists will help in managing entries and enforcing constraints and make it easier to implement and extend functionality if required.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The waitlist_helper class will perform the following operations &lt;br /&gt;
#Delete all waitlists for team&lt;br /&gt;
#Purge all waitlists for topic &lt;br /&gt;
#Add team to waitlist&lt;br /&gt;
#Delete specific team from waitlist&lt;br /&gt;
#Get all waitlisted topics for team&lt;br /&gt;
#Get all waitlisted teams for topic&lt;br /&gt;
#Get first team in waitlist for topic&lt;br /&gt;
#Check waitlist empty for topic&lt;br /&gt;
#Check if team has any waitlists &lt;br /&gt;
#Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
'''Student's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student_waitlist_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Instructor's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_signup_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''Instructor's View With Waitlists'''&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlist.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Test 1:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to add their team to the waitlist by clicking on '''Check''' icon (see the image above) if the team has not signed up in any topic.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 2:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to drop the team from the waitlist by clicking on '''Delete''' icon (see the image above) if they are no longer interested in it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 3:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to add a student to the topic by clicking on '''Check''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 4:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to delete a student to the topic by clicking on '''Delete''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 5:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the students signup for a topic in the page displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 6:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the topics available &lt;br /&gt;
&lt;br /&gt;
''' Test 7:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view waitlisted and signed up teams for all the topics in the assignment&lt;br /&gt;
&lt;br /&gt;
''' Test 8:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to drop waitlisted team for a topics in the assignment&lt;br /&gt;
&lt;br /&gt;
we will be adding more test cases as the project progress.&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144584</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144584"/>
		<updated>2022-04-07T03:41:17Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: add waitlist&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
* '''The topic is available''': In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ). This is pretty straightforward.&lt;br /&gt;
&lt;br /&gt;
* '''The topic is unavailable''': In this case, the team is waitlisted for the topic. When any other team drops this topic, a waitlisted team will be assigned for this topic. &lt;br /&gt;
&lt;br /&gt;
Our task is to simplify the way we are handling the second case. For each topic, we will have to have a waitlist object associated with it. If a team has requested for a topic that is not available, the team would just be queued on to the waitlist for this topic. In the waitlist object, we will have to maintain the team_id and the topic id for which this team will be waitlisted. In the current implementation, the waitlisting functionality is scattered across multiple files. All this has to be consolidated and placed in fewer number of places ( model file and helper class ).&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
The current implementation has multiple models and controllers ( sign_up_topic.rb, waitlist.rb, invitation.rb, lottery_controller.rb, suggestion_controller.rb and signed_up_team.rb etc ) perform actions that indirectly affect the waitlist ( adding or removing teams from waitlist ). As a result, modifying the waitlist is being performed by multiple models and controllers. So, there is a lot of redundancy associated with basic waitlist operations in multiple files.&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
To simplify waitlist functionality and to reduce code redundancy, we will be moving all the functions present in multiple controllers and model files that manipulate waitlists to waitlist.rb. All these classes will now just invoke methods of waitlist.rb. The list of files and methods which will be modified are &lt;br /&gt;
&lt;br /&gt;
1) signed_up_team.rb&lt;br /&gt;
&lt;br /&gt;
2) waitlist.rb&lt;br /&gt;
&lt;br /&gt;
3) sign_up_sheet_controller.rb&lt;br /&gt;
&lt;br /&gt;
4) sign_up_sheet.rb&lt;br /&gt;
&lt;br /&gt;
5) sign_up_topic.rb&lt;br /&gt;
&lt;br /&gt;
6) suggestion_controller.rb&lt;br /&gt;
&lt;br /&gt;
7) invitation.rb&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
In this Unified Modeling Language (UML), we summarize the details of the system's users such as instructors and students and their interactions with the system. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Student Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1. Student should be able to perform an action to add their own team to the waitlist.  &amp;lt;br&amp;gt;&lt;br /&gt;
2. Student should be able to drop their own team from the waitlist but not others team.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Instructor Interactions''' &amp;lt;br&amp;gt;&lt;br /&gt;
1.  Delete or purge on the waitlist items are those actions that have to be performed by the instructor/admin and student should not be given access to delete action.&amp;lt;br&amp;gt;&lt;br /&gt;
2. Instructor should be able to add any team to the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Instructor should be able to drop any team from the waitlist.&amp;lt;br&amp;gt;&lt;br /&gt;
4. Instructor should be able to fetch the details of the teams in a waitlist for a particular topic.&amp;lt;br&amp;gt;&lt;br /&gt;
5. Instructor should be able to fetch the details of the topics in which a team is waitlisted. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
Tables associated with '''waitlist_teams''' table:&amp;lt;br&amp;gt;&lt;br /&gt;
1. teams&amp;lt;br&amp;gt;&lt;br /&gt;
2. signed_up_teams&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
waitlist_teams table is referred by the signed_up_teams and teams table as Foreign Key Relationship.&lt;br /&gt;
&lt;br /&gt;
'''team_id''' : foreign key in waitlists_team table referenced by teams table &amp;lt;br&amp;gt;&lt;br /&gt;
'''topic_id''' : foreign key in waitlists_team table reference by signed_up_teams table &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
We plan to add a new table ''waitlist_teams''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The attributes for the table are team_id(refers to the ''teams'' table), topic_id (refers to the ''sign_up_topics'' table)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This table only stores the waitlisted teams for each topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Having separated tables for signups and waitlists will help in managing entries and enforcing constraints and make it easier to implement and extend functionality if required.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The waitlist_helper class will perform the following operations &lt;br /&gt;
#Delete all waitlists for team&lt;br /&gt;
#Purge all waitlists for topic &lt;br /&gt;
#Add team to waitlist&lt;br /&gt;
#Delete specific team from waitlist&lt;br /&gt;
#Get all waitlisted topics for team&lt;br /&gt;
#Get all waitlisted teams for topic&lt;br /&gt;
#Get first team in waitlist for topic&lt;br /&gt;
#Check waitlist empty for topic&lt;br /&gt;
#Check if team has any waitlists &lt;br /&gt;
#Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
'''Student's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student_waitlist_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Instructor's View'''&lt;br /&gt;
&lt;br /&gt;
[[File:Instructor_signup_page.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
'''Instructor's View With Waitlists'''&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlist.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Test 1:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to add their team to the waitlist by clicking on '''Check''' icon (see the image above) if the team has not signed up in any topic.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 2:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Student should be able to drop the team from the waitlist by clicking on '''Delete''' icon (see the image above) if they are no longer interested in it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Test 3:'''&amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to add a student to the topic by clicking on '''Check''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 4:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to delete a student to the topic by clicking on '''Delete''' (see the image above) icon. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 5:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the students signup for a topic in the page displayed. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Test 6:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view all the topics available &lt;br /&gt;
&lt;br /&gt;
''' Test 7:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to view waitlisted and signed up teams for all the topics in the assignment&lt;br /&gt;
&lt;br /&gt;
''' Test 8:''' &amp;lt;br&amp;gt;&lt;br /&gt;
Instructor should be able to drop waitlisted team for a topics in the assignment&lt;br /&gt;
&lt;br /&gt;
we will be adding more test cases as the project progress.&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Waitlist.png&amp;diff=144583</id>
		<title>File:Waitlist.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Waitlist.png&amp;diff=144583"/>
		<updated>2022-04-07T03:38:00Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144456</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144456"/>
		<updated>2022-04-06T23:07:39Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
We plan to add a new table ''waitlist_teams''&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The attributes for the table are team_id(refers to the ''teams'' table), topic_id (refers to the ''sign_up_topics'' table)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This table only stores the waitlisted teams for each topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Having separated tables for signups and waitlists will help in managing entries and enforcing constraints and make it easier to implement and extend functionality if required.&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
The waitlist_helper class will perform the following operations &lt;br /&gt;
#Delete all waitlists for team&lt;br /&gt;
#Purge all waitlists for topic &lt;br /&gt;
#Add team to waitlist&lt;br /&gt;
#Delete specific team from waitlist&lt;br /&gt;
#Get all waitlisted topics for team&lt;br /&gt;
#Get all waitlisted teams for topic&lt;br /&gt;
#Get first team in waitlist for topic&lt;br /&gt;
#Check waitlist empty for topic&lt;br /&gt;
#Check if team has any waitlists &lt;br /&gt;
#Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144445</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144445"/>
		<updated>2022-04-06T22:49:31Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Managing entries and enforcing constraints will be easier to implement and extend if required.&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144444</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144444"/>
		<updated>2022-04-06T22:48:07Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Managing entries and enforcing constraints will be easier to implement and extend if required.&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Testing ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144443</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144443"/>
		<updated>2022-04-06T22:43:35Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Managing entries and enforcing constraints will be easier to implement and extend if required.&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144441</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144441"/>
		<updated>2022-04-06T22:41:56Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Managing entries and enforcing constraints will be easier to implement and extend if required.&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Reddy Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Kumar Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144440</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144440"/>
		<updated>2022-04-06T22:37:12Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: signed_up_teams table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
signed_up_teams table consists of a mapping of team_id, topic_id, is_waitlisted. This table was being used for multiple purposes, one to store the signed up teams and also the waitlisted teams for a topic.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
We plan on retiring/removing the waitlist flag from the signed_up_teams table and separating this functionality. &lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
All existing references to the is_waitlisted flag will be rewritten to make use of the new table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Managing entries and enforcing constraints will be easier to implement and extend if required.&lt;br /&gt;
&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144438</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144438"/>
		<updated>2022-04-06T22:27:18Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: add operation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to the waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When a student gets added to a team that already has a signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then the old team's waitlist should be dropped&lt;br /&gt;
##Get the number of waitlisted teams for all topics in an assignment&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144437</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144437"/>
		<updated>2022-04-06T22:24:37Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: add migration details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
===Migrating existing waitlists to use new table===&lt;br /&gt;
Since the signed_up_teams table will no longer be used to store the waitlists we will move all the entries for waitlisted teams to the new table so that all the existing waitlists don't get affected.&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
We plan on writing a migration script to move the waitlists from signed_up_teams table to waitlist_teams table.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
This will ensure minimal regression breakages and retain existing functionalities.&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144435</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144435"/>
		<updated>2022-04-06T22:16:46Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: add other files to the refactor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
##All references to is_waitlisted should be removed and waitlists must be determined by using the new waitlist_team table.&lt;br /&gt;
#waitlist.rb&lt;br /&gt;
##This class must be scrapped away and we will use a separate helper class to add all the logic of waitlisting which will be called by other methods. &lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code) - This method currently does 2 things, it cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144430</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144430"/>
		<updated>2022-04-06T22:10:17Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: sign_up_topic changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
&lt;br /&gt;
=== UML Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_uml_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Class Diagram ===&lt;br /&gt;
&lt;br /&gt;
[[File:Waitlists_class_diagram.png|600px|]]&lt;br /&gt;
&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
##cancel_all_wailists (typo in code)&lt;br /&gt;
###Does 2 things - cancels waitlist and also updates the signed_up_team topic which needs to be split&lt;br /&gt;
##create_SignUpTeam&lt;br /&gt;
###It checks if topic has slots if yes it adds to signed up team, else creates a signup as waitlist&lt;br /&gt;
###This method should use the new table and call the helper functions of waitlist to perform actions on waitlists&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
##users_on_waiting_list - Move method to fetch all users on waitlist for a topic to waitlist_teams method.&lt;br /&gt;
##assign_to_first_waiting_team - The same functionality is being called in multiple places, it should be made DRY and moved to the waitlist_teams model&lt;br /&gt;
##reassign_topic - Use methods that perform actions on waitlist that should be moved to waitlist_helper, also use transactions to make it atomic.&lt;br /&gt;
##update_waitlisted_users - Move method to waitlist_teams model and use the new table&lt;br /&gt;
##find_slots_waitlisted - Move method to waitlist_teams model&lt;br /&gt;
##find_waitlisted_topics - Move method to waitlist_teams model&lt;br /&gt;
&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144419</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144419"/>
		<updated>2022-04-06T21:36:23Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: invitation changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
Whenever a team requests for a topic, there are two things that can happen. &lt;br /&gt;
&lt;br /&gt;
'''The topic is available''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team will be assigned this topic ( Assuming that there is no bidding for the assignment ).&lt;br /&gt;
&lt;br /&gt;
'''The topic is unavailable''':&lt;br /&gt;
&lt;br /&gt;
In this case, the team is waitlisted for the topic. When any other team drops this topic, then a waitlisted team will be assigned for this topic.&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
##notification&lt;br /&gt;
##Clean waitlist functionality should be moved to a method in waitlist_teams model. team id should be passed as a parameter to delete the waitlist for that team.&lt;br /&gt;
&lt;br /&gt;
#invitation.rb&lt;br /&gt;
##remove_waitlists_for_team&lt;br /&gt;
###Removing from waitlist and adding to team to sign up should be as a single transaction&lt;br /&gt;
###There should be additional checks to make sure that there is enough space left before adding team to signed_up_sheet&lt;br /&gt;
###All functionality should be moved to waitlist_helper and implemented in a robust and dry manner&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144390</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144390"/>
		<updated>2022-04-06T20:25:51Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: files changed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files and methods to be refactored ===&lt;br /&gt;
&lt;br /&gt;
#signed_up_team.rb&lt;br /&gt;
#sign_up_sheet_controller.rb&lt;br /&gt;
##switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
###Change usage of is_waitlisted attribute in the signed_up_teams table to use the new table&lt;br /&gt;
###Add additional checks and transactions to make sure perform operations in an atomic way in case of failures.&lt;br /&gt;
&lt;br /&gt;
#sign_up_sheet.rb&lt;br /&gt;
#sign_up_topic.rb&lt;br /&gt;
#suggestion_controller.rb&lt;br /&gt;
#invitation.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to the waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The topic for an assignment has available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be enrolled for the topic.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted topics getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Student gets enrolled into a course for which he was waitlisted before.&lt;br /&gt;
  Then: The team that the student is a part of should be dropped from the remaining waitlisted topics.&lt;br /&gt;
&lt;br /&gt;
Scenario: All waitlisted teams getting dropped&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The deadline for a topic passes.&lt;br /&gt;
  Then: All the waitlisted teams for that particular topic must be dropped.&lt;br /&gt;
&lt;br /&gt;
Scenario: Getting enrolled in a topic&lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: The enrolled team for a topic drops&lt;br /&gt;
  Then: The team that was waitlisted earlier for the topics must be enrolled.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144358</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144358"/>
		<updated>2022-04-06T19:43:19Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Reordered segments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Problem Statement==&lt;br /&gt;
&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
=== Issues with existing functionality ===&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
== Proposed design and Plan of action ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
=== Changes to the signed_up_teams Table ===&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
&lt;br /&gt;
===Adding new waitlist_teams Table ===&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
##Check if team has any waitlists &lt;br /&gt;
&lt;br /&gt;
===Refactoring and Design Patterns===&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Topic for a assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144333</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144333"/>
		<updated>2022-04-06T18:06:51Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: added new cases&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Overview ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the signed_up_teams Table====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Adding new waitlist_teams Table ====&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
&lt;br /&gt;
Check if team has any waitlists&lt;br /&gt;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##Team requests a topic that has no slot available.&lt;br /&gt;
##When capacity/max choosers for a topic is increased&lt;br /&gt;
##When student gets added to a team which has signed up topic&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Topic for a assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144298</id>
		<title>CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2240._Re-write_waitlist_functionality&amp;diff=144298"/>
		<updated>2022-04-06T15:31:16Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Initial Commit with skeleton&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Project Overview ==&lt;br /&gt;
=== Feature Overview ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overview of Major Changes ===&lt;br /&gt;
&lt;br /&gt;
=== Files Involved ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Testing ===&lt;br /&gt;
&lt;br /&gt;
==== Issues with Existing Tests ====&lt;br /&gt;
&lt;br /&gt;
== Statement of Problem ==&lt;br /&gt;
&lt;br /&gt;
== Plan and List of Work Done ==&lt;br /&gt;
&lt;br /&gt;
=== General Design Goals ===&lt;br /&gt;
====Changes to the signed_up_teams Table====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Adding new waitlist_teams Table ====&lt;br /&gt;
#Add a new table waitlist_teams&lt;br /&gt;
#The attributes for the table are team_id(refers to the teams table), topic_id (refers to the sign_up_topics table)&lt;br /&gt;
#This table only stores the waitlisted teams for each topic.&lt;br /&gt;
#The default timestamp in the table will be used to check the first team waitlisted instead of using queues to implement the functionality.&lt;br /&gt;
#The waitlist_helper class will perform the following operations &lt;br /&gt;
##Delete all waitlists for team&lt;br /&gt;
##Purge all waitlists for topic &lt;br /&gt;
##Add team to waitlist&lt;br /&gt;
##Delete specific team from waitlist&lt;br /&gt;
##Get all waitlisted topics for team&lt;br /&gt;
##Get all waitlisted teams for topic&lt;br /&gt;
##Get first team in waitlist for topic&lt;br /&gt;
##Check waitlist empty for topic&lt;br /&gt;
&lt;br /&gt;
Check if team has any waitlists&lt;br /&gt;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Specific Tasks Completed ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
=== Video Demonstration ===&lt;br /&gt;
''will be added for the final submission''&lt;br /&gt;
=== Testing Goals and Test Objects ===&lt;br /&gt;
&lt;br /&gt;
''Drawing from the project objectives:''&lt;br /&gt;
#Ways to get added to waitlist for a topic&lt;br /&gt;
##team requests a topic that has no slot available.&lt;br /&gt;
#Ways to get off a waitlist&lt;br /&gt;
##team gets the topic they are waiting for ( all other waitlists are dropped for the team)&lt;br /&gt;
##team drops off the waitlist&lt;br /&gt;
##instructor drops team from the waitlist&lt;br /&gt;
##a drop-topic deadline passes&lt;br /&gt;
##team is deleted&lt;br /&gt;
##student gets added to a new team, then old team's waitlist should be dropped&lt;br /&gt;
&lt;br /&gt;
=== RSpec Unit Tests ===&lt;br /&gt;
'''''Test cases provided here, will add RSpec code blocks for the final submission'''''&lt;br /&gt;
*Student Waitlist&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Getting added to the waitlist for a topic &lt;br /&gt;
 Given: Logged in as a Student&lt;br /&gt;
  When: Topic for a assignment has no available slots&lt;br /&gt;
   And: Student tries to signup for a topic&lt;br /&gt;
  Then: The team that the student is a part of should be added to waitlist for the topic.&lt;br /&gt;
&lt;br /&gt;
=== Manual UI Tests ===&lt;br /&gt;
*Student ID in header&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Scenario: Student ID in grading history view &lt;br /&gt;
Logged in as an Instructor/Admin&lt;br /&gt;
  On Assignment page, click on Grading History&lt;br /&gt;
   Resulting Grading History Table is shown&lt;br /&gt;
    Student ID appears in the header, not in any table columns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regression Testing ===&lt;br /&gt;
''In order to ensure complete coverage, testing of the changes done between the end of last semester and this project will be done to ensure that ''&lt;br /&gt;
''old test cases still pass.''&lt;br /&gt;
&lt;br /&gt;
# Make sure all existing waitlist functionality still passes&lt;br /&gt;
&lt;br /&gt;
== Conclusions and Future Work ==&lt;br /&gt;
=== Comprehensive Testing and Scope ===&lt;br /&gt;
* ''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
=== Conclusion ===&lt;br /&gt;
''will be added for final submission''&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
Pull request&lt;br /&gt;
&lt;br /&gt;
Deployed application with changes&lt;br /&gt;
&lt;br /&gt;
Forked repository&lt;br /&gt;
&lt;br /&gt;
== Contributors ==&lt;br /&gt;
=== Students ===&lt;br /&gt;
*Krishna Saurabh Vankadaru (''kvankad'')&lt;br /&gt;
*Samson Mulkur (''smulkur'')&lt;br /&gt;
*Akhil Mengani (''amengan'')&lt;br /&gt;
*Sai Naga Vamshi Chidara (''schidar'')&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
*Naman Shrimali (''nshrima'')&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=144291</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=144291"/>
		<updated>2022-04-06T14:34:05Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: Added E2242 fix teammate -review page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2200: Testing advice_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2203: Adding tests for courses_controller, eula_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2204: Adding tests for markup_styles_controller, lock_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2208: Testing for submission_records_controller, profile_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2218: Refactor response_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2217: Refactor questionnaires_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2216: Refactor late_policies_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2215: Refactor student_quizzes_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2214: Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2219: Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2211: Testing for summary_helper]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2225: Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2221: Refactor submitted content controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2206: Testing for users_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2207: Testing for submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2205: Testing for participants_controller, versions_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2212: Testing for hamer.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2200: Refactoring evaluation of SQL queries (Java/JUnit)]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2222: Refactor impersonate_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2202- Testing for badges_controller, publishing_controller]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2022 - E2220: Refactor reputation_web_service_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2224: Refactor review_mapping_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2209: Testing for analytic helper.rb, join team requests helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2227: SQL Injection Fix]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2201: Testing for assignment_questionnaire_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2243. Refactor student_teams functionality]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2245: View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2241: Heatgrid fixes and improvements]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2237: Grading audit trail]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - S2201: Improving User Experience for SQLFE]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2236: Fix issues related to deadlines and late policies]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2231: Allow reviewers to bid on what to review]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2233. Improving search facility in Expertiza]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2234. Calibration submissions should be copied along with calibration assignments]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2244. Support for saying your team pair-programmed]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2246: Email your authors/reviewers, with complete tests]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2229: Track the time students look at other submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2239: Further refactoring and improvement of review mapping helper.rb ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2240. Re-write waitlist functionality ]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2242. Fix teammate-review view ]]&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143799</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143799"/>
		<updated>2022-03-28T03:57:21Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: added test plan heading&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments. It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issues pertaining to the below mentioned fixes and had to debug the file extensively. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2291/commits/673fe2099991c21237c59c71d7ee51f063e55b70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make the code compact&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Test Plan &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Manual Testing &amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the changes manually use the following link to access the reputation web service endpoint.&lt;br /&gt;
&amp;lt;br/&amp;gt;http://152.7.177.155:8080/reputation_web_service/client&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Username :&amp;lt;/b&amp;gt; instructor6 &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Password :&amp;lt;/b&amp;gt; password &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Enter assignment id which is a mandatory field, the secondary assignment id is optional. Enter the round number for which we want to calculate the reputation for (1-3) &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Select the type of algorithm to calculate the reputation for the peer reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Based on the type of algorithm selected, some of the additional information is automatically passed. Other additional information is optional.&lt;br /&gt;
&amp;lt;p&amp;gt; Click send request (This might take a few minutes, please be patient)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On clicking the send request, the JSON for the post request to the reputation web service is formed, and then sent. &amp;lt;br/&amp;gt;On receiving the response, we parse it and update the reputation of participants of the assignment provided. &amp;lt;br/&amp;gt;The request and response JSONs can be seen in both minified and beautified versions.&lt;br /&gt;
&amp;lt;br/&amp;gt; There is also a summary of the choices selected above the beautified JSONs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Testing via rspec &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Only a few methods and flows have automated test cases. Adding test cases is not in the scope of this project, and will be taken up later, to make the entire controller robust.&amp;lt;br/&amp;gt; However, we have made sure that all the existing test cases are not broken and working as they are supposed to be.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; To run the automated rspec cases run the below command to verify if all the test cases are working.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143532</id>
		<title>CSC/ECE 517 Spring 2022 - E2220: Refactor reputation web service controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022_-_E2220:_Refactor_reputation_web_service_controller&amp;diff=143532"/>
		<updated>2022-03-22T04:57:27Z</updated>

		<summary type="html">&lt;p&gt;Kvankad: added description for testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides information about the refactoring work done on the reputation web service controller as part of the OSS project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Team &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Mentor &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Naman Shrimali (nshrima)&lt;br /&gt;
&amp;lt;h3&amp;gt; Team Members (MissingSemicolon) &amp;lt;/h3&amp;gt;&lt;br /&gt;
* Eshwar Chandra Vidhyasagar Theda (ethedla)&lt;br /&gt;
* Gokul Krishna Koganti (gkogant)&lt;br /&gt;
* Krishna Saurabh Vankadaru (kvankad)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Expertiza &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza is an assignment management portal. This portal can be used by instructors to create assignments. It can be used by students to submit their academic works and peer review others' works. Expertiza allows students to &lt;br /&gt;
create, join and work in teams.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Background of reputation web service controller &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expertiza provides a way for students to peer review others' works. The motive of this provision is to encourage students to learn more while reviewing others' works and utilize the reviews to reflect on the grades. However, to depend on the peer reviews, the reviews' credibility has to be established. This credibility can be evaluated through reputation scores computed by reputation systems. These systems are deployed as web services and facilitate the calculation of past and present assignment scores for peer review research.&lt;br /&gt;
&lt;br /&gt;
In the project's scope, we focus on the aspect of refactoring the file reputation_web_service_controller.rb. This is a controller file used for the calculation of reputation scores. This is measured based on how close the current review scores are to the other.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;h2&amp;gt; Issues identified &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some methods are violating the single responsibility principle, i.e, some methods are doing more than one tasks. These methods must be broken down such that each method performs only one task. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request, references to specific assignments, such as 724, 735, and 756 are no longer relevant and must be removed. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some method names followed bad naming convention. These method names are general and are in noun forms. Specific relevant names must be used as method names.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Detailed method descriptions are needed to be inserted into the code as comments.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; There is a lot of unused/commented code, which should be removed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Some spelling mistakes are identified in the code.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Enhancements &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Functionality Fixes&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; The controller we received to perform refactoring work on, was not in a working condition. We found many issues pertaining to the below mentioned fixes and had to debug the file extensively. Later refactoring work is done on the debugged and working code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The case of when a post request to reputation web service fails is not handled properly, resulting in a long error message on the view. This error has been handled to display formatted error on the page. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/84c9f30f9ee29759b5a41c9d11cda53c298fe49b &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; Commented out the part of encryption and decryption as the public key files are not available.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/15/commits/db83d497dd284cf0700d219f1b225f2d6c508ac8 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; In send_post_request (old version, currently prepare_request_body), init_header has been removed and requested &amp;amp; response JSON has been displayed in the beautify JSON for the implemented algorithms. This is done by using constant objects instead of URL strings. &amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/17/commits/f343438383d56d577648ef4dd91de4fc3501449a&amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; When the control is redirected to the client, in the older versions, the data was being passed through the use of instance variables. Now, the parameters are being passed using flash.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt; Commit link: &amp;lt;/b&amp;gt;https://github.com/krishnasaurabh/expertiza/pull/15/commits/bf2ab75eb7b25e6d0b79791610beb371383b6042&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt; Refactoring &amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;h4&amp;gt; Introduced single responsibility principle to the functions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; All the functions are modified in a way to concur with the single responsibility principle i.e, each function performs only one considerable task.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;The following functions violated SRP:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method not only queries, but calculates sums.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method not only generates json, but also queries the database based on the ‘type’ it receives.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; not only sends a post request, but generates a body based on parameters received, encrypts the data, hits the post request, decrypts the response data, and updates participants.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;SRP is introduced in the following ways:&amp;lt;/p&amp;gt;&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;db_query&amp;lt;/b&amp;gt; method is split into calculate_peer_review_grade and get_peer_reviews methods. &amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews uses get_peer_reviews_for_responses method, which further calls get_valid_answers_for_response, get_max_question_score , calculate_peer_review_grade methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/5/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;json_generator&amp;lt;/b&amp;gt; method is split into generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores.These functions further use helper methods to abide by the SRP principle.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_peer_reviews calls get_peer_reviews and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_peer_reviews  calls get_peer_reviews_for_responses method.&amp;lt;br/&amp;gt;&lt;br /&gt;
generate_json_for_quiz_scores calls get_quiz_score and generate_json_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
get_quiz_score calls get_ids_list and get_scores methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt; The &amp;lt;b&amp;gt;send_post_request&amp;lt;/b&amp;gt; is split into prepare_request_body and process_response_body methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
prepare_request_method uses add_expert_grades, add_quiz_scores, add_hamer_reputation_values, add_lauw_reputation_values, encrypt_request_body, format_into_JSON to prepare the request body.&amp;lt;br/&amp;gt; process_response_body makes use of decrypt_response and update_participants to process the response received.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary references in the send_post_request body&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In  send_post_request, there are references to specific assignments, such as 724, 735, and 756. They were put in to gather data for a paper published in 2015. They are no longer relevant and are removed. Relevant tests are also removed.&amp;lt;/p&amp;gt; &lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/d5d0a6de203b9643bcb1750328261ea6e9abdde5&lt;br /&gt;
&amp;lt;h4&amp;gt; Changed method names to make them more meaningful&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;  Method names should be verbs, and should say what the method does. Method names should not be so general that they could apply to many different methods. Bad method names are observed in the methods, db_query and json_generator. These method names are too general and needed changing.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; db_query is changed to get_peer_reviews method.&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/3c5b2b5e33675aaf121a954180eee11f31a8cb36 &amp;lt;/li&amp;gt;&lt;br /&gt;
 &amp;lt;li&amp;gt; json_generator is split into various methods with specific method names: generate_json_body, generate_json_for_peer_reviews, generate_json_for_quiz_scores. .&amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/3/commits/b305e98448538dd342640e62a1cd4c2fae6b3b5d &amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Function descriptions&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In the older version, controller's functions did not have function descriptions. In the current version, a detailed functional description has been added to each method. Additionally, descriptions include what parameters are accepted and what is returned. Proper convention is followed in accordance with the industry standards for the method descriptions, parameters and return specifications.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/pull/20/commits/d8c86b0c0a073c894e0700e6f4f971a1ec845cee&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Removed unnecessary code&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Commented code blocks that are unused are found and deleted from the controller's body. RSA Encryption and Decryption are not being used for now. Such code is commented out for potential future use. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2291/commits/673fe2099991c21237c59c71d7ee51f063e55b70&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Corrected spelling mistakes &amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Only one instance of spelling error has been identified i.e, dimention. It has been corrected.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/expertiza/expertiza/pull/2226/commits/efc4b4dcbd5d3b1f783d660f70ac18abfb451ab7&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Used map functionality instead of for loop to make the code compact&amp;lt;/h4&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; In some functions table's records are replaced with the record's ID. This is done by looping the table and changing each record. We improved this by using the map functionality to map the records with their respective IDs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Commit link: &amp;lt;/b&amp;gt; https://github.com/krishnasaurabh/expertiza/commit/36bc4fa30d7c6548cb64e59ebca2a3afe4c9c4a9&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Manual Testing &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the changes manually use the following link to access the reputation web service endpoint.&lt;br /&gt;
&amp;lt;br/&amp;gt;http://152.7.177.155:8080/reputation_web_service/client&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Enter assignment id which is a mandatory field, the secondary assignment id is optional. Enter the round number for which we want to calculate the reputation for (1-3) &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Select the type of algorithm to calculate the reputation for the peer reviews.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; Based on the type of algorithm selected, some of the additional information is automatically passed. Other additional information is optional.&lt;br /&gt;
&amp;lt;p&amp;gt; Click send request (This might take a few minutes, please be patient)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; On clicking the send request, the JSON for the post request to the reputation web service is formed, and then sent. &amp;lt;br/&amp;gt;On receiving the response, we parse it and update the reputation of participants of the assignment provided. &amp;lt;br/&amp;gt;The request and response JSONs can be seen in both minified and beautified versions.&lt;br /&gt;
&amp;lt;br/&amp;gt; There is also a summary of the choices selected above the beautified JSONs.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
[[File:Manual_Testing.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Testing via rspec &amp;lt;/h2&amp;gt;&lt;br /&gt;
Only a few methods and flows have automated test cases. Adding test cases is not in the scope of this project, and will be taken up later, to make the entire controller robust.&amp;lt;br/&amp;gt; However, we have made sure that all the existing test cases are not broken and working as they are supposed to be.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt; To run the automated rspec cases run the below command to verify if all the test cases are working.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt; rspec spec/controllers/reputation_web_service_controller_spec.rb &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; Future Work &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client view has checkboxes for choosing between the action to be performed. But only the first checked action is being considered. This has to be fixed by the use of radio buttons.&lt;br /&gt;
&amp;lt;li&amp;gt; Hamer and Lauw actions are not resulting in any functional implementations. These algorithms have to be implemented.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Need to fix the usage of assignment_id and another_assignment_id for the Hamer and Lauw algorithms&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Client is a bad method name and needs to be changed.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Formatting string into JSON can be improved. Instead of prepending characters like '{', dictionaries can be used and then converted into JSON.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt; GitHub Repository and Pull Request links &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Link to the Expertiza repository: https://github.com/expertiza/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the forked repository: https://github.com/krishnasaurabh/expertiza/tree/beta &amp;lt;br/&amp;gt;&lt;br /&gt;
Link to the pull request: https://github.com/expertiza/expertiza/pull/2291 &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Kvankad</name></author>
	</entry>
</feed>