<?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=Srashid3</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=Srashid3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Srashid3"/>
	<updated>2026-09-11T17:15:17Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1742&amp;diff=108065</id>
		<title>CSC/ECE 517 Spring 2017 E1742</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1742&amp;diff=108065"/>
		<updated>2017-04-07T19:56:13Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page relates to instructor visualization for assignments in Expertiza. Refer to the live documentation at: https://docs.google.com/document/d/1ybg9CK03_j3QtLI9R6vJqYunz8_I_pO9BX7iPGNe95o/edit#&lt;br /&gt;
&lt;br /&gt;
Note that Google Docs was used with the permission of the professor to minimize formatting issues with our charts.&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1742&amp;diff=108064</id>
		<title>CSC/ECE 517 Spring 2017 E1742</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1742&amp;diff=108064"/>
		<updated>2017-04-07T19:48:25Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Created page with &amp;quot;This page relates to instructor visualization for assignments in Expertiza. Refer to the live documentation at: https://docs.google.com/document/d/1ybg9CK03_j3QtLI9R6vJqYunz8_I_p...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page relates to instructor visualization for assignments in Expertiza. Refer to the live documentation at: https://docs.google.com/document/d/1ybg9CK03_j3QtLI9R6vJqYunz8_I_pO9BX7iPGNe95o/edit#&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107786</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107786"/>
		<updated>2017-04-01T01:52:30Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* signup_sheet_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
An additional button was also implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following links were added to the partial where appropriate:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that the instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this scenario, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
This additional view renders a form where the instructor can specify a student for the signup action. The instructor is redirected to this page after clicking the signup link in the topic names partial.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced. These functions are based on the existing signup and delete actions, but are modified to match the context an instructor is given. For example, the signup action validates the user the instructor supplies and no longer uses the session user. Similarly for the delete action, the user must be extracted from the team ID. The flash messages were also modified to notify an instructor rather than a student.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107783</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107783"/>
		<updated>2017-04-01T01:45:31Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* signup_as_instructor.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
An additional button was also implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following links were added to the partial where appropriate:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that the instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this scenario, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
This additional view renders a form where the instructor can specify a student for the signup action. The instructor is redirected to this page after clicking the signup link in the topic names partial.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107782</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107782"/>
		<updated>2017-04-01T01:42:02Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* _topic_name.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
An additional button was also implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following links were added to the partial where appropriate:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Note that the instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this scenario, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107780</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107780"/>
		<updated>2017-04-01T01:39:44Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
An additional button was also implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107778</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107778"/>
		<updated>2017-04-01T01:38:58Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Undo revision 107777 by Srashid3 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107777</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107777"/>
		<updated>2017-04-01T01:38:18Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
An additional button also was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107769</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107769"/>
		<updated>2017-04-01T01:32:12Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Navigating to the assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107767</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107767"/>
		<updated>2017-04-01T01:28:47Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing.  We describe the preconditions below.&lt;br /&gt;
RSpec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test adding multiple students since it is already tested with existing functions.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  The addition of too much extra functionality will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Pre-Conditions=====&lt;br /&gt;
We create two students and an instructor.  We also create an assignment which adds the two students as participants.  Two teams are created with a student assigned to one of the teams.  The other team is used for tests where no work is submitted.  Two topics are created and use the assignment deadline.  One student is signed up to a topic and is used to test the delete functionality. The other student is signed up by the instructor and tests the signup functionality.  The objects are refreshed before each test.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107735</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107735"/>
		<updated>2017-04-01T00:58:22Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name.&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the X enclosed by a red circle next to the desired team.&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below on how to manually test the implemented changes.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a green plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== _topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107732</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107732"/>
		<updated>2017-04-01T00:54:02Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Instructor signs up a student for a topic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor Signs Up a Student For a Topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107731</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107731"/>
		<updated>2017-04-01T00:52:48Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, a team is created for the student as part of the signup process.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected back to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107730</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107730"/>
		<updated>2017-04-01T00:49:24Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Solutions */ Improved word flow&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solution ===&lt;br /&gt;
&lt;br /&gt;
An instructor can view a list of all the topics for any given assignment.  Each topic shows any signed up teams and whether students are signed up or waitlisted. The proposed change introduces a new button next to each team that allows an instructor to remove a team from a topic.  In this manner, an instructor can drop a team from a topic with relative ease.  &lt;br /&gt;
Next, an additional button was implemented to give an instructor the option to signup a specific team for a topic.  An instructor can select a team by specifying one of the team members.  If the student specified by the instructor is not part of a team, the student is signed up as a one person team.  The signup button is located in the topic name box and redirects to a new page.  The new page contains a form where the instructor can enter a student's name.  Once a team is added, the instructor is redirected to the edit assignment page where the topic is updated with the specified student's team.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107726</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107726"/>
		<updated>2017-04-01T00:28:12Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
In order to sign up or drop teams from a topic, an instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  To add or drop multiple teams, the instructor must impersonate each student and navigate back and forth between the same set of pages.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
An instructor is able to view a list of all topics for a given an assignment and details about the topics.  Each topic shows if a team is signed up for the topic, and if so which students are signed up or wait listed. The proposed change introduces a button next to each team of students that indicates removing that team from being signed up for the specific topic.  In this manner, an instructor is more easily able to drop teams from topics.  &lt;br /&gt;
Along with the removal from signup, an instructor also has the option to sign a specific team up for a topic.  The instructor is able to select the team by specifying one of the team members names.  If the student specified by the instructor is not part of a team, current functionality creates a team for that student as part of the sign up process.  To allow signing a team up, a new button was introduced in the topic name box which redirects to a new page.  The new page allows the instructor to enter a student's name which should be signed up for the topic.  Once added, the instructor is brought back to the previous edit assignment page where the student's team can be seen as signed up for the topic.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107719</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107719"/>
		<updated>2017-03-31T23:54:10Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Preconditions */ Updated test plan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For an instructor to sign up or drop teams from a topic, the instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  For adding or dropping multiple teams from topics, the workflow is quite cumbersome and involves changing between many pages.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
An instructor is able to view a list of all topics for a given an assignment and details about the topics.  Each topic shows if a team is signed up for the topic, and if so which students are signed up or wait listed. The proposed change introduces a button next to each team of students that indicates removing that team from being signed up for the specific topic.  In this manner, an instructor is more easily able to drop teams from topics.  &lt;br /&gt;
Along with the removal from signup, an instructor also has the option to sign a specific team up for a topic.  The instructor is able to select the team by specifying one of the team members names.  If the student specified by the instructor is not part of a team, current functionality creates a team for that student as part of the sign up process.  To allow signing a team up, a new button was introduced in the topic name box which redirects to a new page.  The new page allows the instructor to enter a student's name which should be signed up for the topic.  Once added, the instructor is brought back to the previous edit assignment page where the student's team can be seen as signed up for the topic.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User already has a topic&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| User is registered for the assignment&lt;br /&gt;
| flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107716</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107716"/>
		<updated>2017-03-31T23:46:51Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* sign_up_sheet/_topic_name.html.erb */ Update code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For an instructor to sign up or drop teams from a topic, the instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  For adding or dropping multiple teams from topics, the workflow is quite cumbersome and involves changing between many pages.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
An instructor is able to view a list of all topics for a given an assignment and details about the topics.  Each topic shows if a team is signed up for the topic, and if so which students are signed up or wait listed. The proposed change introduces a button next to each team of students that indicates removing that team from being signed up for the specific topic.  In this manner, an instructor is more easily able to drop teams from topics.  &lt;br /&gt;
Along with the removal from signup, an instructor also has the option to sign a specific team up for a topic.  The instructor is able to select the team by specifying one of the team members names.  If the student specified by the instructor is not part of a team, current functionality creates a team for that student as part of the sign up process.  To allow signing a team up, a new button was introduced in the topic name box which redirects to a new page.  The new page allows the instructor to enter a student's name which should be signed up for the topic.  Once added, the instructor is brought back to the previous edit assignment page where the student's team can be seen as signed up for the topic.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/signup_as_instructor.html.erb ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    &amp;lt;%= form_tag(:controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;signup_as_instructor_action&amp;quot;,:topic_id =&amp;gt; params[:topic_id], :assignment_id =&amp;gt; params[:assignment_id]) do %&amp;gt;&lt;br /&gt;
        &amp;lt;%= label_tag(:username, &amp;quot;Sign Up User:&amp;quot;) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= text_field_tag(:username) %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;topic_id&amp;quot;, params[:topic_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= hidden_field_tag &amp;quot;assignment_id&amp;quot;, params[:assignment_id] %&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag(&amp;quot;Submit&amp;quot;) %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107709</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107709"/>
		<updated>2017-03-31T23:39:38Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* signup_sheet_controller.rb */ Update code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For an instructor to sign up or drop teams from a topic, the instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  For adding or dropping multiple teams from topics, the workflow is quite cumbersome and involves changing between many pages.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
An instructor is able to view a list of all topics for a given an assignment and details about the topics.  Each topic shows if a team is signed up for the topic, and if so which students are signed up or wait listed. The proposed change introduces a button next to each team of students that indicates removing that team from being signed up for the specific topic.  In this manner, an instructor is more easily able to drop teams from topics.  &lt;br /&gt;
Along with the removal from signup, an instructor also has the option to sign a specific team up for a topic.  The instructor is able to select the team by specifying one of the team members names.  If the student specified by the instructor is not part of a team, current functionality creates a team for that student as part of the sign up process.  To allow signing a team up, a new button was introduced in the topic name box which redirects to a new page.  The new page allows the instructor to enter a student's name which should be signed up for the topic.  Once added, the instructor is brought back to the previous edit assignment page where the student's team can be seen as signed up for the topic.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;% for participant in @participants %&amp;gt;&lt;br /&gt;
  &amp;lt;% if topic.id == participant.topic_id %&amp;gt;&lt;br /&gt;
    &amp;lt;% chooser_present = true %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(@assignment.max_team_size &amp;gt; 1)%&amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;b&amp;amp;gt;&amp;lt;%= participant.team_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Waitlist Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&amp;amp;lt;/b&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% if participant.is_waitlisted == true %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color='red'&amp;amp;gt;(waitlisted)&amp;amp;lt;/font&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% if chooser_present == false %&amp;gt;&lt;br /&gt;
    No choosers.&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    if user.nil? # validate invalid user&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      if AssignmentParticipant.exists? user_id: user.id, parent_id: params[:assignment_id]&lt;br /&gt;
        if SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
          flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        flash[:error] = &amp;quot;The student is not registered for the assignment!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    team_user = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(team_user.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107652</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107652"/>
		<updated>2017-03-31T19:12:39Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: /* Problem */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
=== Problem ===&lt;br /&gt;
For an instructor to sign up or drop teams from a topic, the instructor must first impersonate a student and then perform the necessary action.  The current workflow introduces unnecessary complexity to the process.  For adding or dropping multiple teams from topics, the workflow is quite cumbersome and involves changing between many pages.&lt;br /&gt;
&lt;br /&gt;
=== Solutions ===&lt;br /&gt;
&lt;br /&gt;
An instructor is able to view a list of all topics for a given an assignment and details about the topics.  Each topic shows if a team is signed up for the topic, and if so which students are signed up or wait listed. The proposed change introduces a button next to each team of students that indicates removing that team from being signed up for the specific topic.  In this manner, an instructor is more easily able to drop teams from topics.  &lt;br /&gt;
Along with the removal from signup, an instructor also has the option to sign a specific team up for a topic.  The instructor is able to select the team by specifying one of the team members names.  If the student specified by the instructor is not part of a team, current functionality creates a team for that student as part of the sign up process.  To allow signing a team up, a new button was introduced in the topic name box which redirects to a new page.  The new page allows the instructor to enter a student's name which should be signed up for the topic.  Once added, the instructor is brought back to the previous edit assignment page where the student's team can be seen as signed up for the topic.&lt;br /&gt;
&lt;br /&gt;
== Expected Functionality ==&lt;br /&gt;
=== Instructor signs up a student for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Sign a student up if &amp;quot;No choosers&amp;quot; is displayed.&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
* Sign a student up for the waitlist if a team is already signed up&lt;br /&gt;
** If the student is part of a team, the whole team should be signed up&lt;br /&gt;
** If the student is not part of a team, a team should be created with only the given student as a member&lt;br /&gt;
** The team should be added to the end of the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is performed by choosing the green checkmark next to the desired topic name&lt;br /&gt;
&lt;br /&gt;
=== Instructor removes a student's signup for a topic ===&lt;br /&gt;
From the instructor's edit assignments page with the tab topics selected, the instructor should see a list of topics for the given assignment.&lt;br /&gt;
For each topic, the instructor should be able to:&lt;br /&gt;
* Remove a team's signup for a specific topic&lt;br /&gt;
** The team should no longer be signed up for the topic&lt;br /&gt;
** Any waitlisted teams should now be signed up for the topic&lt;br /&gt;
* Remove a team from the waitlist for a specific topic&lt;br /&gt;
** The team should be removed from the waitlist&lt;br /&gt;
&lt;br /&gt;
Each action is done by choosing the x enclosed by a red circle next to the desired team&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
Please review the information below for further information on how to review the modifications made.&lt;br /&gt;
&lt;br /&gt;
Login Information:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Username&lt;br /&gt;
! Password&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| instructor6&lt;br /&gt;
| password&lt;br /&gt;
| instructor&lt;br /&gt;
|-&lt;br /&gt;
| student4340&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student4405&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|-&lt;br /&gt;
| student6376&lt;br /&gt;
| password&lt;br /&gt;
| student&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Review Steps:&lt;br /&gt;
* Check with assignments a student is signed up for&lt;br /&gt;
** Log in as a student&lt;br /&gt;
** On the main page, there should be a list of assignments which the user can be removed from signup&lt;br /&gt;
*** Note removing the signup only works if the student hasn't turned in work or the drop deadline has not passed&lt;br /&gt;
* Add a student to a course or assignment&lt;br /&gt;
** Log in as an instructor&lt;br /&gt;
** Go to &amp;quot;Courses&amp;quot; tab to add a student to a course, go to &amp;quot;Assignments&amp;quot; tab to add a student to an assignment&lt;br /&gt;
** Choose &amp;quot;Add Participants&amp;quot; button under &amp;quot;Actions&amp;quot; column.  It appears as a person wearing a blue shirt with a gree plus above them&lt;br /&gt;
** The list shows all users currently signed up and what role they have&lt;br /&gt;
** Scroll to the bottom of the bottom of the page&lt;br /&gt;
*** Type in the student's name in the text box next  to &amp;quot;Enter a user login&amp;quot; &lt;br /&gt;
*** Ensure the &amp;quot;Participant&amp;quot; radio button is selected&lt;br /&gt;
*** Select add&lt;br /&gt;
* Reaching assignment topics page&lt;br /&gt;
** Login as an instructor&lt;br /&gt;
** In the top red navigation bar, choose &amp;quot;Manage..&amp;quot;&lt;br /&gt;
** Select &amp;quot;Assignments&amp;quot; above the search bar&lt;br /&gt;
** Click the pencil button under actions column for any assignment&lt;br /&gt;
** Select the &amp;quot;Topics&amp;quot; tab&lt;br /&gt;
* Signing a student up&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the checkmark for a given topic&lt;br /&gt;
** At the redirected page, type in an existing student user&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Remove a team's signup from a topic&lt;br /&gt;
** Navigate to the assignment topics page&lt;br /&gt;
** Under the &amp;quot;Topic name(s)&amp;quot; column, click the x surrounded by a red circle for a given topic&lt;br /&gt;
** You should be redirected back to the &amp;quot;Edit Assignment&amp;quot; page, select the &amp;quot;Topics&amp;quot; tab to view your change&lt;br /&gt;
* Check to ensure a student can see his addition or removal from a topic&lt;br /&gt;
** Sign in as a student&lt;br /&gt;
** Select the assignment of interest on the home page&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be grayed out with a message &amp;quot;(You have to choose a topic first) &amp;quot; if you've just removed the user's signup&lt;br /&gt;
** The &amp;quot;your work&amp;quot; link should be active if you've signed the user up&lt;br /&gt;
*** Select the link &amp;quot;signup sheet&amp;quot;&lt;br /&gt;
*** The topic you've signed the user up for should be highlighted in yellow&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;% for participant in @participants %&amp;gt;&lt;br /&gt;
  &amp;lt;% if topic.id == participant.topic_id %&amp;gt;&lt;br /&gt;
    &amp;lt;% chooser_present = true %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(@assignment.max_team_size &amp;gt; 1)%&amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;b&amp;amp;gt;&amp;lt;%= participant.team_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Waitlist Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&amp;amp;lt;/b&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% if participant.is_waitlisted == true %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color='red'&amp;amp;gt;(waitlisted)&amp;amp;lt;/font&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% if chooser_present == false %&amp;gt;&lt;br /&gt;
    No choosers.&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    unless user.nil? # validate invalid user&lt;br /&gt;
      unless SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
        flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    teamUsr = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(teamUsr.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Since we added new functionality, we needed to create new preconditions for testing the functionality.  We describe the preconditions below.&lt;br /&gt;
Rspec is utilized to perform the unit tests under the spec/controllers/sign_up_sheet_spec.rb file.  We do not test the functionality of adding multiple students as this is tested in existing functionality that we utilized.  We can assume that signing up a student will sign up the whole team as indicated by the contract with the existing function.  The same contract exists for removing a student's sign up.  We also wish to make a distinction in the goal of our functionality.  It is not to remove one student from the team.  It is to remove the whole team from a topic.  Addition of too much extra functionality because it may be nice will clutter the system, thus we don't implement or test the addition or removal of an individual from a team since it is implemented elsewhere.&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a three students and an instructor.  We also create an assignment to which we add the three students as participants.  Three teams are created with one user assigned to each team.  The third team is created such that it has already submitted it's work.  Three topics are created for the assignment with deadlines.  The second and third teams are signed up for topics two and three. The instructor is to add the first student to topic one created for the assignment.  The instructor is also to attempt to remove team two and three from being signed up.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107197</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107197"/>
		<updated>2017-03-23T02:29:06Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Updated signup action&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but this introduced unnecessary complexity to the process. By adding access to the signup functionality on the assignments page, instructors can now easily fix mistakes or free up topics as needed.&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;% for participant in @participants %&amp;gt;&lt;br /&gt;
  &amp;lt;% if topic.id == participant.topic_id %&amp;gt;&lt;br /&gt;
    &amp;lt;% chooser_present = true %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(@assignment.max_team_size &amp;gt; 1)%&amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;b&amp;amp;gt;&amp;lt;%= participant.team_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Waitlist Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&amp;amp;lt;/b&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% if participant.is_waitlisted == true %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color='red'&amp;amp;gt;(waitlisted)&amp;amp;lt;/font&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% if chooser_present == false %&amp;gt;&lt;br /&gt;
    No choosers.&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    unless user.nil? # validate invalid user&lt;br /&gt;
      unless SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
        flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    teamUsr = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(teamUsr.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=====Preconditions=====&lt;br /&gt;
We create a user and instructor. The instructor is to add the user to one of two topics created for an assignment.&lt;br /&gt;
The objects are refreshed each time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107096</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107096"/>
		<updated>2017-03-22T21:22:24Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but this introduced unnecessary complexity to the process. By adding access to the signup functionality on the assignments page, instructors can now easily fix mistakes or free up topics as needed.&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
&amp;lt;% for participant in @participants %&amp;gt;&lt;br /&gt;
  &amp;lt;% if topic.id == participant.topic_id %&amp;gt;&lt;br /&gt;
    &amp;lt;% chooser_present = true %&amp;gt;&lt;br /&gt;
      &amp;lt;% if(@assignment.max_team_size &amp;gt; 1)%&amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;b&amp;amp;gt;&amp;lt;%= participant.team_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Waitlist Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&amp;amp;lt;/b&amp;amp;gt;&lt;br /&gt;
        &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('leave_topic.png', :border =&amp;gt; 0, :title =&amp;gt; 'Drop Student', :align =&amp;gt; 'middle'), :controller =&amp;gt; &amp;quot;sign_up_sheet&amp;quot;, :action =&amp;gt; &amp;quot;delete_signup_as_instructor&amp;quot;, :id =&amp;gt; participant.team_id, :topic_id =&amp;gt; topic.id %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
      &amp;lt;% else %&amp;gt;&lt;br /&gt;
        &amp;lt;%= participant.user_name_placeholder%&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;% if participant.is_waitlisted == true %&amp;gt;&lt;br /&gt;
        &amp;amp;lt;font color='red'&amp;amp;gt;(waitlisted)&amp;amp;lt;/font&amp;amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
  &amp;lt;% if chooser_present == false %&amp;gt;&lt;br /&gt;
    No choosers.&amp;lt;b&amp;gt;&amp;lt;%= link_to image_tag('signup.png', :border =&amp;gt; 0, :title =&amp;gt; 'Sign Up Student', :align =&amp;gt; 'middle'), signup_as_instructor_sign_up_sheet_index_path( assignment_id: params[:id], topic_id: topic.id) %&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
  &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    unless user.nil? # validate invalid user&lt;br /&gt;
      unless SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
        flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    teamUsr = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(teamUsr.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
===Preconditions===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with no signed up team&lt;br /&gt;
| Correct user is added to topic&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with signed up team&lt;br /&gt;
| Correct user is added to waitlist&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Add user to topic with waitlist&lt;br /&gt;
| Correct user is added to end of waitlist&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Deny adding user already signed up&lt;br /&gt;
| flash[:error] = &amp;quot;The student already signed up for a topic!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Username does not exist in database&lt;br /&gt;
| flash[:error] = &amp;quot;The student does not exist!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Delete signup updates waitlist&lt;br /&gt;
| Top of waitlist is now signed up&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow to delete signup if submitted&lt;br /&gt;
| flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Don’t allow delete signup with passed deadline&lt;br /&gt;
| flash[:error] = &amp;quot;You cannot drop the student after the drop topic deadline!&amp;quot;&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Delete Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| signup_as_instructor_action&lt;br /&gt;
|-&lt;br /&gt;
| Redirect Signup&lt;br /&gt;
| Redirects back to topic list page&lt;br /&gt;
| Sign_up_sheet_controller.rb&lt;br /&gt;
| delete_signup_as_instructor&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107090</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107090"/>
		<updated>2017-03-22T20:58:38Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Added code blocks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but this introduced unnecessary complexity to the process. By adding access to the signup functionality on the assignments page, instructors can now easily fix mistakes or free up topics as needed.&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def signup_as_instructor_action&lt;br /&gt;
    user = User.find_by(name: params[:username])&lt;br /&gt;
    unless user.nil? # validate invalid user&lt;br /&gt;
      unless SignUpSheet.signup_team(params[:assignment_id], user.id, params[:topic_id])&lt;br /&gt;
        flash[:error] = &amp;quot;The student has already signed up for a topic!&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully signed up the student for the topic!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      flash[:error] = &amp;quot;That student does not exist!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: params[:assignment_id]&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  def delete_signup_as_instructor&lt;br /&gt;
    # find participant using assignment using team and topic ids&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    assignment = Assignment.find(team.parent_id)&lt;br /&gt;
    teamUsr = TeamsUser.find_by(team_id: team.id)&lt;br /&gt;
    user = User.find(teamUsr.user_id)&lt;br /&gt;
    participant = AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id)&lt;br /&gt;
    drop_topic_deadline = assignment.due_dates.find_by_deadline_type_id(6)&lt;br /&gt;
    if !participant.team.submitted_files.empty? or !participant.team.hyperlinks.empty?&lt;br /&gt;
      flash[:error] = &amp;quot;The student has already submitted their work, so you are not allowed to remove them.&amp;quot;&lt;br /&gt;
    elsif !drop_topic_deadline.nil? and Time.now &amp;gt; drop_topic_deadline.due_at&lt;br /&gt;
      flash[:error] = &amp;quot;You cannot drop a student after the drop topic deadline!&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      delete_signup_for_topic(assignment.id, params[:topic_id], participant.user_id)&lt;br /&gt;
      flash[:success] = &amp;quot;You have successfully dropped the student from the topic!&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    redirect_to controller: 'assignments', action: 'edit', id: assignment.id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test Description&lt;br /&gt;
! Expected Result&lt;br /&gt;
! Tested File&lt;br /&gt;
! Method Tested&lt;br /&gt;
|-&lt;br /&gt;
| row 1, cell 1&lt;br /&gt;
| row 1, cell 2&lt;br /&gt;
| row 1, cell 3&lt;br /&gt;
| row 1, cell 4&lt;br /&gt;
|-&lt;br /&gt;
| row 2, cell 1&lt;br /&gt;
| row 2, cell 2&lt;br /&gt;
| row 2, cell 3&lt;br /&gt;
| row 2, cell 4&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107088</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107088"/>
		<updated>2017-03-22T20:53:02Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Fixed formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Motivation ==&lt;br /&gt;
&lt;br /&gt;
Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but this introduced unnecessary complexity to the process. By adding access to the signup functionality on the assignments page, instructors can now easily fix mistakes or free up topics as needed.&lt;br /&gt;
&lt;br /&gt;
== Modifications ==&lt;br /&gt;
&lt;br /&gt;
=== sign_up_sheet/_topic_name.html.erb ===&lt;br /&gt;
&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
&lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
=== signup_sheet_controller.rb ===&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107087</id>
		<title>CSC/ECE 517 Spring 2017 E1714</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2017_E1714&amp;diff=107087"/>
		<updated>2017-03-22T20:49:44Z</updated>

		<summary type="html">&lt;p&gt;Srashid3: Created page with &amp;quot;Motivation Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Motivation&lt;br /&gt;
Prior to our modifications, the Expertiza system offered no way for instructors to sign up or drop students from a topic. Instructors could impersonate a student, but this introduced unnecessary complexity to the process. By adding access to the signup functionality on the assignments page, instructors can now easily fix mistakes or free up topics as needed.&lt;br /&gt;
&lt;br /&gt;
Modifications&lt;br /&gt;
sign_up_sheet/_topic_name.html.erb&lt;br /&gt;
The topic_name partial is the primary view for this feature. It renders the table cell where the topic, team, and students are listed. The following code was modified:&lt;br /&gt;
[ ADD SOURCE CODE ] &lt;br /&gt;
The instructor will see a different set of links depending on whether or not a team has already been assigned to a topic. If no team is present, only a single link that adds a student and their team will be visible. If a team is already present, then an additional link that drops that existing team will be visible. In this case, the signup link will add students to the waitlist instead.&lt;br /&gt;
&lt;br /&gt;
signup_sheet_controller.rb&lt;br /&gt;
The signup_sheet_controller is where most of the new functionality is introduced.&lt;br /&gt;
[ ADD SOURCE CODE ]&lt;br /&gt;
&lt;br /&gt;
Testing&lt;/div&gt;</summary>
		<author><name>Srashid3</name></author>
	</entry>
</feed>