<?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=Jdbenavi</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=Jdbenavi"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jdbenavi"/>
	<updated>2026-07-05T11:49:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147140</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147140"/>
		<updated>2022-12-06T00:06:26Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
Old  ( in def update_existing_topic )&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to_sign_up(params[:id])&lt;br /&gt;
New:&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to edit_assignment_path(params[:id], anchor: 'tabs-2')&lt;br /&gt;
&lt;br /&gt;
With this change we were also able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also updated the corresponding rspec tests to reflect the change:&lt;br /&gt;
&lt;br /&gt;
old:&lt;br /&gt;
   expect(response).to redirect_to('/signup_sheet/add_signup_topics?id=1')&lt;br /&gt;
new:&lt;br /&gt;
   expect(response).to redirect_to('/assignments/1/edit#tabs-2')&lt;br /&gt;
&lt;br /&gt;
commits:&lt;br /&gt;
&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/5dec776b7355290efde7e2249de83d89fd0dd259&lt;br /&gt;
&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/8ab175b02cf825f5f414e04e33f1790da0f1bd93&lt;br /&gt;
&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/1dcd1b8107657fbeaaea60a586e6705dc0cf3404&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147139</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147139"/>
		<updated>2022-12-06T00:05:23Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
Old  ( in def update_existing_topic )&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to_sign_up(params[:id])&lt;br /&gt;
New:&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to edit_assignment_path(params[:id], anchor: 'tabs-2')&lt;br /&gt;
&lt;br /&gt;
With this change we were also able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also updated the corresponding rspec tests to reflect the change:&lt;br /&gt;
&lt;br /&gt;
old:&lt;br /&gt;
   expect(response).to redirect_to('/signup_sheet/add_signup_topics?id=1')&lt;br /&gt;
new:&lt;br /&gt;
   expect(response).to redirect_to('/assignments/1/edit#tabs-2')&lt;br /&gt;
&lt;br /&gt;
commits:&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/5dec776b7355290efde7e2249de83d89fd0dd259&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/8ab175b02cf825f5f414e04e33f1790da0f1bd93&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/1dcd1b8107657fbeaaea60a586e6705dc0cf3404&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147138</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147138"/>
		<updated>2022-12-06T00:04:59Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
Old  ( in def update_existing_topic )&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to_sign_up(params[:id])&lt;br /&gt;
New:&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to edit_assignment_path(params[:id], anchor: 'tabs-2')&lt;br /&gt;
&lt;br /&gt;
With this change we were also able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also updated the corresponding rspec tests to reflect the change:&lt;br /&gt;
&lt;br /&gt;
old:&lt;br /&gt;
   expect(response).to redirect_to('/signup_sheet/add_signup_topics?id=1')&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
new:&lt;br /&gt;
   expect(response).to redirect_to('/assignments/1/edit#tabs-2')&lt;br /&gt;
&lt;br /&gt;
commits:&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/5dec776b7355290efde7e2249de83d89fd0dd259&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/8ab175b02cf825f5f414e04e33f1790da0f1bd93&lt;br /&gt;
https://github.com/weichic-ncsu/expertiza/commit/1dcd1b8107657fbeaaea60a586e6705dc0cf3404&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147137</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147137"/>
		<updated>2022-12-06T00:03:43Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics (Juan)'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
Old  ( in def update_existing_topic )&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to_sign_up(params[:id])&lt;br /&gt;
New:&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to edit_assignment_path(params[:id], anchor: 'tabs-2')&lt;br /&gt;
&lt;br /&gt;
With this change we were also able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also updated the corresponding rspec tests to reflect the change:&lt;br /&gt;
&lt;br /&gt;
old:&lt;br /&gt;
   expect(response).to redirect_to('/signup_sheet/add_signup_topics?id=1')&lt;br /&gt;
          &lt;br /&gt;
&lt;br /&gt;
new:&lt;br /&gt;
   expect(response).to redirect_to('/assignments/1/edit#tabs-2')&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147136</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147136"/>
		<updated>2022-12-06T00:00:52Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics (Juan)'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
Old :&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to_sign_up(params[:id])&lt;br /&gt;
New:&lt;br /&gt;
    topic.update_attributes(topic_params)&lt;br /&gt;
    redirect_to edit_assignment_path(params[:id], anchor: 'tabs-2')&lt;br /&gt;
&lt;br /&gt;
With this change we were also able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
and updated the corresponding rspec tests to reflect the change:&lt;br /&gt;
&lt;br /&gt;
old:&lt;br /&gt;
&lt;br /&gt;
new:&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147135</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147135"/>
		<updated>2022-12-05T23:59:11Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics (Juan)'''&lt;br /&gt;
&lt;br /&gt;
Previously we encountered an error page when attempting to create a topic with the same name as an existing topic. The functionality was set up to update the attributes of the existing topic and then redirect the user to add_signup_topics. However this route was broken ( from an error in a different controller class) and the functionality was very unclear from reading the code.&lt;br /&gt;
&lt;br /&gt;
We have changed this so that when the user attempts to create a new topic with the same name as an existing topic, the topic attributes are updated as before, but the user is instead redirected back to the topics tab of the assignment edit page.&lt;br /&gt;
&lt;br /&gt;
With this change we were able to remove the below method: &lt;br /&gt;
&lt;br /&gt;
  def redirect_to_sign_up(assignment_id)&lt;br /&gt;
    assignment = Assignment.find(assignment_id)&lt;br /&gt;
    assignment.staggered_deadline == true ? (redirect_to action: 'add_signup_topics_staggered', id: assignment_id) : &lt;br /&gt;
    (redirect_to action: 'add_signup_topics', id: assignment_id)&lt;br /&gt;
  end&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147133</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147133"/>
		<updated>2022-12-05T23:54:49Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* '''Is_intelligent (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* '''Participants variable'''&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Staggered Deadlines of Topics in Assignment'''&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Add_signup_topics (Juan)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods removed (Swetha)'''&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* '''Methods moved (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147132</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147132"/>
		<updated>2022-12-05T23:53:25Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* Participants variable&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147130</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147130"/>
		<updated>2022-12-05T23:53:02Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
* Participants variable&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147129</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147129"/>
		<updated>2022-12-05T23:52:41Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Participants variable (Juan)&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commit : https://github.com/weichic-ncsu/expertiza/commit/7b8a230f8d0ddb3953ec3a9db8506caa2bb691e4&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147128</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147128"/>
		<updated>2022-12-05T23:51:45Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Participants variable (Juan)&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity, consistency as team_members was used in a similar fashion elsewhere in the controller and to avoid clashing with @participant (singular), which is used in many areas.&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147127</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147127"/>
		<updated>2022-12-05T23:50:47Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Participants variable (Juan)&lt;br /&gt;
References to participants (plural) have been replaced with @team_members for clarity&lt;br /&gt;
&lt;br /&gt;
Example Old:&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
Example New:&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147126</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147126"/>
		<updated>2022-12-05T23:49:30Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications ( Work Completed) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Participants variable (Juan)&lt;br /&gt;
 &amp;lt;% @participants = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
 &amp;lt;% @team_members = SignedUpTeam.find_team_participants(@assignment.id, session[:ip])  %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Staggered Deadlines of Topics in Assignment&lt;br /&gt;
&lt;br /&gt;
:* Added back views rendered for staggered deadlines in the signup sheet&lt;br /&gt;
&lt;br /&gt;
:* Fixed controller error of this feature&lt;br /&gt;
&lt;br /&gt;
:* Tested this feature with demo video&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147112</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=147112"/>
		<updated>2022-12-05T22:12:00Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Code Modifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This attribute is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the attribute.&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb &lt;br /&gt;
&lt;br /&gt;
* The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller. It is also indicative of poor class design and violation of the Single Responsibility Principle.&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to create/delete new topics for an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Remove violations of Single Responsibility principle by refactoring the design of the controller.&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''Controller Re-design'''&lt;br /&gt;
&lt;br /&gt;
The signup_sheet controller currently has 30 methods, which is a violation of the upper limit for methods in a controller.Upon analysis, we found that signup_sheet controller has methods related to creating/updating and deleting topics as well as methods to create and delete a sign-up for those topics in an assignment. This is certainly a violation of the Single Responsibility principle as this controller handles responsibilties of both topic CRUD and signup CRUD operations. To fix this, we have proposed to split this controller and create a new controller for Topics to manage its responsibilities. We plan to split up the methods as per below Class Diagram -&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
The new design follows '''Single Responsibility''', and the methods were split up on the basis of '''Information Expert''' pattern. Using the principle of Information Expert, a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by the current rspec. Further, new tests will have to added/ old tests will have to be repurposed to check the newly designed Topic controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper modules:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Verify setting up staggered deadlines of signup topics in assignments&lt;br /&gt;
# Login as instructor&lt;br /&gt;
# Hover on &amp;quot;Manage&amp;quot; Tab&lt;br /&gt;
# Click on &amp;quot;Assignments&amp;quot; Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;Wikipedia contribution&amp;quot; assignment&lt;br /&gt;
# Select &amp;quot;Staggered deadline assignnment?&amp;quot; checkbox&lt;br /&gt;
# Click &amp;quot;OK&amp;quot; at the popping up dialog&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# Click on &amp;quot;Topics&amp;quot; Tab&lt;br /&gt;
# Scroll down to the bottom and click &amp;quot;Show start/due date&amp;quot;&lt;br /&gt;
# Find out 2 topics, which are selected by at least 1 student, respectively&lt;br /&gt;
# Setup different deadlines for them and make sure one topic is in submission stage and the other one is in review stage&lt;br /&gt;
# Click &amp;quot;Save&amp;quot; button&lt;br /&gt;
# The updates should be saved without any error&lt;br /&gt;
# Sign in as one of the students for each topic, you should see different stages of the assignment &amp;quot;Wikipedia contribution&amp;quot; in the assignment list&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ( Work Completed) ==&lt;br /&gt;
&lt;br /&gt;
* Is_intelligent (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Participants variable (Juan)&lt;br /&gt;
&lt;br /&gt;
* Staggered ( Wei-Chi)&lt;br /&gt;
&lt;br /&gt;
* Add_signup_topics (Juan)&lt;br /&gt;
&lt;br /&gt;
* Methods removed (Swetha)&lt;br /&gt;
&lt;br /&gt;
* Methods moved (Swetha)&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146799</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146799"/>
		<updated>2022-11-20T23:05:29Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
We are proposing to add a new topics controller to handle some of the current methods, as in the following diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
This design adheres to single responsibility and information expert&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146798</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146798"/>
		<updated>2022-11-20T22:59:51Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
We are proposing to add a new topics controller to handle some of the current methods, as in the following diagram:&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146797</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146797"/>
		<updated>2022-11-20T22:58:57Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|500px|Image: 500 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146796</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146796"/>
		<updated>2022-11-20T22:58:43Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG|300px|Image: 300 pixels]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146795</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146795"/>
		<updated>2022-11-20T22:57:33Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG]|100px|Image: 100 pixels]&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASSNEW.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146794</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146794"/>
		<updated>2022-11-20T22:57:05Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan of Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG]]&lt;br /&gt;
[[File:SUPCLASSNEW.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
In order to clean up the controller, we plan to move many of the methods to a new topic controller ( see above diagram)&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146793</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146793"/>
		<updated>2022-11-20T22:56:10Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Controller Re-design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG]]&lt;br /&gt;
[[File:SUPCLASSNEW.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
- list methods that will go into this controller&lt;br /&gt;
- diagram&lt;br /&gt;
- mention design patterns&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146792</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146792"/>
		<updated>2022-11-20T22:54:59Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.PNG]]&lt;br /&gt;
[[File:SUPCLASSNEW.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
- list methods that will go into this controller&lt;br /&gt;
- diagram&lt;br /&gt;
- mention design patterns&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146791</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146791"/>
		<updated>2022-11-20T22:53:41Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Controller Re-design==&lt;br /&gt;
&lt;br /&gt;
[[File:SUPCLASS.png]]&lt;br /&gt;
[[File:SUPCLASSNEW.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
- list methods that will go into this controller&lt;br /&gt;
- diagram&lt;br /&gt;
- mention design patterns&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SUPCLASS.PNG&amp;diff=146790</id>
		<title>File:SUPCLASS.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SUPCLASS.PNG&amp;diff=146790"/>
		<updated>2022-11-20T22:51:56Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SUPCLASSNEW.PNG&amp;diff=146789</id>
		<title>File:SUPCLASSNEW.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SUPCLASSNEW.PNG&amp;diff=146789"/>
		<updated>2022-11-20T22:51:39Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146788</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146788"/>
		<updated>2022-11-20T22:09:33Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method. ( not a method?)&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
*New topics controller to handle methods related to Topics. *TODO expand on this*&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''New Topics Controller'''&lt;br /&gt;
- list methods that will go into this controller&lt;br /&gt;
- diagram&lt;br /&gt;
- mention design patterns&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
     context 'when topic can be found' do&lt;br /&gt;
       context 'when assignment.staggered_deadline is True' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
       context 'when assignment.staggered_deadline is False' do&lt;br /&gt;
         it 'updates the existing topic and redirects to signup_sheet#add_signup_topics page' do&lt;br /&gt;
           ...&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146676</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146676"/>
		<updated>2022-11-16T00:03:28Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
* Increase Cohesion and Minimize Coupling&lt;br /&gt;
&lt;br /&gt;
* DRY out the code wherever possible&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity by naming methods and variables appropriately&lt;br /&gt;
&lt;br /&gt;
* Improve code clarity of the controller by moving non-CRUD methods to helper functions wherever applicable&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered '''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Assignment is_intelligent attribute is a source of confusion'''&lt;br /&gt;
&lt;br /&gt;
There are several checks for @assignment.is_intelligent across the controllers and views. This attribute is atrociously named. It &lt;br /&gt;
simply checks for whether bidding is being used to assign topics. &lt;br /&gt;
&lt;br /&gt;
Proposed changes include renaming the attribute to bid_for_topics which more accurately captures its purpose.&lt;br /&gt;
If this attribute were to be renamed, it would involve a lot of changes across the project - &lt;br /&gt;
&lt;br /&gt;
:* The schema for Assignment would have to be updated&lt;br /&gt;
        t.boolean &amp;quot;is_intelligent&amp;quot;&lt;br /&gt;
:* All creation of Assignment objects across the code and specs would have to be changed&lt;br /&gt;
        &lt;br /&gt;
     context 'when current assignment is not intelligent assignment' do&lt;br /&gt;
      it 'renders signup_sheet#list page' do&lt;br /&gt;
        assignment.is_intelligent = false&lt;br /&gt;
        allow(Bid).to receive(:where).with(team_id: 1).and_return([double('Bid', topic_id: 1)])&lt;br /&gt;
        request_params = { id: 1 }&lt;br /&gt;
        get :list, params: request_params&lt;br /&gt;
        expect(response).to render_template(:list)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
:* Existing test or sample DB data for Assignments would also have to be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
:* Views including tree_display would also be affected as they contain checks like this -&lt;br /&gt;
&lt;br /&gt;
       (props) =&amp;gt;&lt;br /&gt;
        props.is_intelligent&lt;br /&gt;
          ? {&lt;br /&gt;
              title: 'Intelligent Assignment',&lt;br /&gt;
              href: '/lottery/run_intelligent_assignment/' + `${parseInt(props.id) / 2}`,&lt;br /&gt;
              src: '/assets/tree_view/run-lottery.png'&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
Further changes include reducing these number of checks to reduce coupling with other modules.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
https://codeclimate.com/github/expertiza/expertiza/app/controllers/sign_up_sheet_controller.rb#&lt;br /&gt;
&lt;br /&gt;
Some issues observed on Code Climate for this controller - &lt;br /&gt;
:* Class SignUpSheetController has 32 methods (exceeds 20 allowed).&lt;br /&gt;
:* Class has too many lines. [393/100]&lt;br /&gt;
&lt;br /&gt;
We plan to move some methods that are not directly involves in CRUD to the helper module:&lt;br /&gt;
update_waitlist&lt;br /&gt;
compute_signed_up_topics&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
== Code Modifications==&lt;br /&gt;
&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146578</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146578"/>
		<updated>2022-11-15T14:07:56Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan of Work==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
Some methods we plan to attempt moving to helper:&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146577</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146577"/>
		<updated>2022-11-15T14:07:26Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
* ''' Code Climate Issues '''&lt;br /&gt;
Some methods we plan to attempt moving to helper:&lt;br /&gt;
add_signup_topics,&lt;br /&gt;
set_values_for_new_topic,&lt;br /&gt;
set_priority,&lt;br /&gt;
switch_original_topic_to_approved_suggested_topic&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146576</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146576"/>
		<updated>2022-11-15T14:05:01Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* '''Increase Test Coverage'''&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by  the current rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146575</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146575"/>
		<updated>2022-11-15T14:04:32Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
* Increase Test Coverage&lt;br /&gt;
We noticed that in general the controller could use more/better rspec tests as some error pages we encountered while manually testing were not captured by rspec&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146573</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146573"/>
		<updated>2022-11-15T13:45:24Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in the signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so we should make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
There is also naming confusion because the controller has many references to the (singular) participant variable, and it is not clear how the two are supposed to be different. So better comments/naming is important.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146572</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146572"/>
		<updated>2022-11-15T13:44:06Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
It is also confusing because the controller has many references to the (singular) participant variable, and it is not clear how the two are different.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        ...&lt;br /&gt;
    ...&lt;br /&gt;
    def list&lt;br /&gt;
        @participant = AssignmentParticipant.find(params[:id].to_i)&lt;br /&gt;
        @assignment = @participant.assignment&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146571</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146571"/>
		<updated>2022-11-15T13:43:06Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
It is also confusing because the controller has many references to the (singular) participant variable, and it is not clear how the two are different.&lt;br /&gt;
&lt;br /&gt;
    def delete_signup&lt;br /&gt;
        participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
        assignment = participant.assignment&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146570</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146570"/>
		<updated>2022-11-15T13:42:44Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
It is also confusing because the controller has many references to the (singular) participant variable, and it is not clear how the two are different.&lt;br /&gt;
&lt;br /&gt;
def delete_signup&lt;br /&gt;
    participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    assignment = participant.assignment&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146569</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146569"/>
		<updated>2022-11-15T13:40:14Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVar.png]]&lt;br /&gt;
&lt;br /&gt;
It is also confusing because the controller has many references to the (singular) participant variable, and it is not clear how the two are different.&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146568</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146568"/>
		<updated>2022-11-15T13:40:04Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''@Participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:participantsVAr.png]]&lt;br /&gt;
&lt;br /&gt;
It is also confusing because the controller has many references to the (singular) participant variable, and it is not clear how the two are different.&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146567</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146567"/>
		<updated>2022-11-15T13:38:26Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* '''assignment is intelligent? (Swetha)'''&lt;br /&gt;
&lt;br /&gt;
* '''participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
*''' Address and test effects of add_signup_topics_staggered (Wei-Chi)'''&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146566</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146566"/>
		<updated>2022-11-15T13:37:57Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Plan and List of Work done (specific tasks planned) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Address and test effects of add_signup_topics_staggered&lt;br /&gt;
:* Add_signup_topics_staggered was supposed to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines]. However, it was removed in the last version since it did not do anything different from add_signup_topics.&lt;br /&gt;
:* Currently in RSpec, it is only implicitly tested in the method create.&lt;br /&gt;
&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
:* [In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
:* Rename the method.&lt;br /&gt;
:* Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
: We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
:* Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
:* Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
:* Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
:* Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
:* List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
: We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
:* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
:* General test case added for rendering list view&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
:* DRYed out code used to check for certain errors; however, that was done using an array of messages and then selecting one of them using a constant subscript, whereas it would have been better to pass the messages as parameters.&lt;br /&gt;
:* The compute_signup_topics method returns results by side-effects (in instance variables); probably this could have been done more cleanly.&lt;br /&gt;
:* Most of the changes involve regularizing use of &amp;quot;sign_up&amp;quot; vs. &amp;quot;signup&amp;quot;; this should ideally be done in a separate commit so it would be mergeable without merging the whole project.&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
* Magic Tricks of Testing&lt;br /&gt;
:* Test incoming command messages by making assertions about direct public side effects.&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
&lt;br /&gt;
* '''participants variable'''&lt;br /&gt;
&lt;br /&gt;
References to @participants is scattered throughout the project, including some references in signup sheet views. This variable was removed in signup sheet controller in the previous pull request for the Fall 2022 OSS project, but references in views have not been removed. In the OSS project we noticed that test coverage for some of the methods/views in this controller were incomplete, so must make sure the removal of this variable does not cause problems. The naming could also use improvement, as only teams are allowed to signup for projects.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
* Address and test effects of add_signup_topics_staggered (Wei-Chi)&lt;br /&gt;
:* Work done&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* When creating a topic which could be found, test the availability in different values of assignment.staggered_deadline.&lt;br /&gt;
&lt;br /&gt;
:* Plan&lt;br /&gt;
::* RSpec&lt;br /&gt;
:::* Test add_signup_topics explicitly with different assignments as the input argument.&lt;br /&gt;
::* Mandatory&lt;br /&gt;
:::* Test the route from app/views/assignments/edit/_topics.html.erb with different assignment_form.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
:* rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
: We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
:* rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
:* rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
* Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
* New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]]&lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ParticipantsVar.png&amp;diff=146565</id>
		<title>File:ParticipantsVar.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ParticipantsVar.png&amp;diff=146565"/>
		<updated>2022-11-15T13:32:39Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146453</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146453"/>
		<updated>2022-11-14T23:26:48Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Prior Work section with last years and last projects background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines] [Not clear that this has been addressed and tested.]&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
[In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
Rename the method.&lt;br /&gt;
Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 &lt;br /&gt;
We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
General test case added for rendering list view&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146452</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146452"/>
		<updated>2022-11-14T23:26:32Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines] [Not clear that this has been addressed and tested.]&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
[In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
Rename the method.&lt;br /&gt;
Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
 We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
General test case added for rendering list view&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146451</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146451"/>
		<updated>2022-11-14T23:26:16Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Prior Work section with last years and last projects background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines] [Not clear that this has been addressed and tested.]&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
[In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
Rename the method.&lt;br /&gt;
Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
= [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]=&lt;br /&gt;
 We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
General test case added for rendering list view&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146450</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146450"/>
		<updated>2022-11-14T23:25:48Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Prior Work section with last years and last projects background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines] [Not clear that this has been addressed and tested.]&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
[In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
Rename the method.&lt;br /&gt;
Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
** We ( @sswetha08 @weichic-ncsu @juanbenavid ) have performed the following refactoring to fix the issues specified for this refactoring project:&lt;br /&gt;
&lt;br /&gt;
Renamed &amp;quot;sign_up&amp;quot; to be &amp;quot;signup&amp;quot; when it is used as adjective or noun for variable/method/controller name.&lt;br /&gt;
&lt;br /&gt;
Update method refactored by removing explicit update of every attribute of topic and instead performing this task through update_attributes function provided by rails. Further, update_max_choosers method changed to update_waitlist to support this.&lt;br /&gt;
&lt;br /&gt;
Removed add_signup_topics_staggered() and replaced it with add_signup_topics() since it does nothing but call add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed load_add_signup_topics() since it does nothing for add_signup_topics().&lt;br /&gt;
&lt;br /&gt;
Removed the feature to sign up for a topic as an instructor as there seems to be no way to access this feature from the views.&lt;br /&gt;
&lt;br /&gt;
List method was too long and has been refactored.&lt;br /&gt;
&lt;br /&gt;
We have also added two new test cases for the controller:&lt;br /&gt;
&lt;br /&gt;
Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
General test case added for rendering list view&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146449</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146449"/>
		<updated>2022-11-14T23:23:44Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
*Provide extensive comments for all the code you view/refactor/modify. &lt;br /&gt;
*Ensure that any code changes do not break any functionality. Refactoring method names might cause cascaded updates in other files.&lt;br /&gt;
&lt;br /&gt;
*Add_signup_topics_staggered does not do anything different from add_signup_topics. Separate functions are needed, because add_signup_topics_staggered needs to make sure that the deadlines are set. [Assignment 1042 has staggered deadlines] [Not clear that this has been addressed and tested.]&lt;br /&gt;
*Refactor participants variable in  load_add_signup_topics&lt;br /&gt;
[In retrospect, the meaning of this is not clear.  The @participants variable is used in a way that is very obscure, with code spread across several views, and no comments saying what it is doing.  It used to be that participants (individual students) signed up for topics.  Now, only teams can sign up for topics.  So @participants does not make sense.]  [Has this been fixed?]&lt;br /&gt;
*There are nine checks for @assignment.is_intelligent.  This method is atrociously named.  It simply checks for whether bidding is being used to assign topics.&lt;br /&gt;
Rename the method.&lt;br /&gt;
Figure out some way to remove all or almost all of those checks, which are a gross violation of the Single-Responsibility Principle (as well as cohesion).&lt;br /&gt;
*Also see Code Climate issues. To reduce the size of the file, you could move some methods to sign_up_sheet_helper.rb [Has this been done?.]&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146448</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146448"/>
		<updated>2022-11-14T23:20:45Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
* describe the issues?&lt;br /&gt;
&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146447</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146447"/>
		<updated>2022-11-14T23:20:15Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Prior Work section with last years and last projects background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022 - E2259. Refactor signup_sheet_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2223. Refactor sign up sheet controller.rb]]&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146446</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146446"/>
		<updated>2022-11-14T23:18:31Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146445</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146445"/>
		<updated>2022-11-14T23:17:48Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team ==&lt;br /&gt;
=== Mentor ===&lt;br /&gt;
* Ed Gehringer (efg)&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Juan Benavides (jdbenavi)&lt;br /&gt;
* Wei-Chi Chen (wchen37)&lt;br /&gt;
* Swetha Sairamakrishnan (ssairam)&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
&lt;br /&gt;
== About Controller == &lt;br /&gt;
The sign up sheet controller performs the following functions:&lt;br /&gt;
* Allows an instructor to add/remove topics to an assignment.&lt;br /&gt;
* Allows an instructor to assign/remove students to topics (This has been removed as it is unused/impersonation of student is used instead)&lt;br /&gt;
* Allows a student to see the list of available topics which can be bid on for given OSS assignment.&lt;br /&gt;
&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Edge Cases and Pre-Conditions ===&lt;br /&gt;
# When dropping topic if submission already done.&lt;br /&gt;
# When deadline from dropping topic has passed.&lt;br /&gt;
# Deleting topic when topic cannot be found.&lt;br /&gt;
# Signup in case when user cannot be found.&lt;br /&gt;
# Create signup_sheet when sign_up_topic cannot be found.&lt;br /&gt;
# Destroy signup_sheet when other topics with the same assignment exists.&lt;br /&gt;
:&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
: As such no functionality changed in any function, only refactoring done. All the refactoring was carefully verified by running rspec tests. To run the spec file, run: &lt;br /&gt;
: rspec spec/controllers/signup_sheet_controller_spec.rb&lt;br /&gt;
We also ran the rspecs for signup_sheet model and helper just to make sure no functionality was broken.&lt;br /&gt;
: rspec spec/helpers/signup_sheet_helper_spec.rb&lt;br /&gt;
: rspec spec/models/signup_sheet_spec.rb&lt;br /&gt;
&lt;br /&gt;
; New test cases&lt;br /&gt;
: Destroy signup_sheet when there are other topics in the assignment&lt;br /&gt;
: New, more general test case added for rendering list view, as we noticed that some functionalities we broke while refactoring did not result in failed test cases.&lt;br /&gt;
&lt;br /&gt;
[[File:F22_Signup_rspec.png]] &lt;br /&gt;
&lt;br /&gt;
=== Mandatory ===&lt;br /&gt;
; Login as instructor&lt;br /&gt;
# Hover on Manage Tab&lt;br /&gt;
# Click on Assignments Tab&lt;br /&gt;
# Click on Edit Button for &amp;quot;OSS project &amp;amp; documentation&amp;quot; assignment&lt;br /&gt;
# Select the Topic Tab&lt;br /&gt;
# Add New Topic or Delete topic using links in the form below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Login as student&lt;br /&gt;
# Click on OSS project/Writing assignment 2&lt;br /&gt;
# Click on Signup sheet&lt;br /&gt;
# The list must be visible, which indicates functionality is as before after refactoring list function.&lt;br /&gt;
&lt;br /&gt;
*Testing Scenarios (Basic + Edge cases)&lt;br /&gt;
*RSpec Testing&lt;br /&gt;
*Manual Testing&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
* We have deployed the project at http://152.7.99.122:8080/&lt;br /&gt;
* Instructor login: username -&amp;gt; instructor6,  password -&amp;gt; password&lt;br /&gt;
* Student login: username -&amp;gt; student5899,  password -&amp;gt; password&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146444</id>
		<title>CSC/ECE 517 Fall 2022 - E2279. Further refactoring and improvement of signup sheet controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2022_-_E2279._Further_refactoring_and_improvement_of_signup_sheet_controller&amp;diff=146444"/>
		<updated>2022-11-14T23:15:11Z</updated>

		<summary type="html">&lt;p&gt;Jdbenavi: /* General Design Goals = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*Team&lt;br /&gt;
*Members&lt;br /&gt;
*Mentor&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
==Prior Work section with last years and last projects background==&lt;br /&gt;
== General Design Goals ==&lt;br /&gt;
&lt;br /&gt;
==Plan and List of Work done (specific tasks planned)==&lt;br /&gt;
* assignment is intelligent? (Swetha)&lt;br /&gt;
* participants variable (Juan)&lt;br /&gt;
* topics staggered ( Wei-Chi)&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
*Testing Scenarios (Basic + Edge cases)&lt;br /&gt;
*RSpec Testing&lt;br /&gt;
*Manual Testing&lt;br /&gt;
*New Tests&lt;br /&gt;
&lt;br /&gt;
==Modifications (probably after working on them)==&lt;br /&gt;
==Relevant Links==&lt;br /&gt;
*https://github.com/weichic-ncsu/expertiza&lt;br /&gt;
*Link to Pull Request&lt;br /&gt;
*http://152.7.99.122:8080/&lt;/div&gt;</summary>
		<author><name>Jdbenavi</name></author>
	</entry>
</feed>