<?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=Rwu5</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=Rwu5"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rwu5"/>
	<updated>2026-08-15T08:56: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_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=131367</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=131367"/>
		<updated>2019-12-18T03:33:11Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/fyAiyzUsHH4&lt;br /&gt;
https://youtu.be/KBdiqPe-wLE&lt;br /&gt;
https://youtu.be/avjdLbw28K8&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Deployment: http://152.46.18.18:8080&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails (Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Future Work''' ==&lt;br /&gt;
1. Mentor could not see teams' submissions since authorization control is working on the view assignment page and mentor does not have rights to submit&amp;lt;br&amp;gt;&lt;br /&gt;
2. Rspec Test for email functions&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=131365</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=131365"/>
		<updated>2019-12-18T03:13:04Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/kWQcB21n538&lt;br /&gt;
https://youtu.be/qE1dqVp-zDA&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Deployment: http://152.46.18.18:8080&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails (Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Future Work''' ==&lt;br /&gt;
1. Mentor could not see teams' submissions since authorization control is working on the view assignment page and mentor does not have rights to submit&amp;lt;br&amp;gt;&lt;br /&gt;
2. Rspec Test for email functions&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130479</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130479"/>
		<updated>2019-12-06T23:49:40Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/kWQcB21n538&lt;br /&gt;
https://youtu.be/qE1dqVp-zDA&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails(Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Future Work''' ==&lt;br /&gt;
1. Mentor could not see teams' submissions since authorization control is working on the view assignment page and mentor does not have rights to submit&amp;lt;br&amp;gt;&lt;br /&gt;
2. Rspec Test for email functions&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130470</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130470"/>
		<updated>2019-12-06T23:43:47Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/kWQcB21n538&lt;br /&gt;
https://youtu.be/S7-psdWwRLc&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails(Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130469</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130469"/>
		<updated>2019-12-06T23:43:25Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/S7-psdWwRLc&lt;br /&gt;
https://youtu.be/kWQcB21n538&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails(Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130468</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=130468"/>
		<updated>2019-12-06T23:43:14Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Links to the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''Links to the project''' ==&lt;br /&gt;
Github Pull Request: https://github.com/expertiza/expertiza/pull/1651&lt;br /&gt;
Video Presentations: &lt;br /&gt;
https://youtu.be/S7-psdWwRLc&lt;br /&gt;
https://youtu.be/kWQcB21n538&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them responses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Implementation for our project&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:CoR.png]]&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, there is no mentor role for the current Expertiza system, only to assign mentor manually&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Also, mentor and team members will be notified by Emails(Results showing in UI Test).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Workflow Diagram ===&lt;br /&gt;
General workflow and specific add member workflow&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:usecases.png]][[File:specific_workflow.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
*Team member added after the mentor assignment will also get a email notification about mentor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Implementation &amp;amp; Explanation''' ==&lt;br /&gt;
Since we implemented a whole new feature and kept the original work flow unchanged at the meantime, most modifications are in models:&amp;lt;br&amp;gt;&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment_team.rb&lt;br /&gt;
*app/models/assignment_participants.rb&lt;br /&gt;
*app/models/team.rb&lt;br /&gt;
*app/models/team_users.rb&lt;br /&gt;
*...&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Views:&lt;br /&gt;
*app/views/student_task/view&lt;br /&gt;
*app/views/student_teams/view&lt;br /&gt;
*app/views/shared_scripts/_add_individual&lt;br /&gt;
*app/views/participants/_participant&lt;br /&gt;
*...&amp;lt;br&amp;gt;&lt;br /&gt;
Here we present some essential codes with explanation&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_role.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;First, add mentor role for assignment. Set authorization for mentor which could not do review, take quiz or submit.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Add_mentor_view.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Add a mentor role for instructor/admin when add participant for assignment&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Mentor_requirement.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;To assign a mentor, there are several requirements:&lt;br /&gt;
*There should be at least one mentor in this assignment&lt;br /&gt;
*The current team size is greater than half of max size&lt;br /&gt;
*The team do not have a mentor yet&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Always assign mentor with lowest number of mentoring teams, in order to do so:&lt;br /&gt;
*First, get all mentors for this assignment&lt;br /&gt;
*Traverse all mentors and calculate how many teams he/she mentored, store the one with lowest number&lt;br /&gt;
*Return mentor with lowest number of team she/he mentored&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Assign_algorithm.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;Use Mailer class to send email notification about mentor and team members information(method used to send email notification for student is similar to this).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after Modification&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
1. Add new participant type mentor in factories.rb&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Mentor_factory.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.Test new added method in team_respec, like half, add_member, size...&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Add_member.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Half.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UI Test==&lt;br /&gt;
1. Instructor/Admin add mentor for specific assignment&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:AddMentor.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
2. Student create team and invite others&amp;lt;br&amp;gt;&lt;br /&gt;
3. When team size greater than half of max size, assign mentor and send emails&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Members_email.png]]&lt;br /&gt;
[[File:Mentor_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
4. When student accept from a team which has already been assigned with mentor, he/she would receive a email&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:New_member_email.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5. Also we extend our work to make all teams visible to mentors&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Extend_work.png]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128306</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128306"/>
		<updated>2019-11-11T00:08:51Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Code Modified &amp;amp; Added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
*app/models/signed_up_team.rb&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128289</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128289"/>
		<updated>2019-11-10T23:54:58Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* The goal behind this project: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&amp;lt;br&amp;gt;&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128288</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128288"/>
		<updated>2019-11-10T23:54:50Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* The goal behind this project: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128284</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128284"/>
		<updated>2019-11-10T23:54:18Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* The goal behind this project: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
*1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
**ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
*2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
**Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
*3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&lt;br /&gt;
*4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128283</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128283"/>
		<updated>2019-11-10T23:53:59Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* The goal behind this project: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
 1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
 2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
 3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&lt;br /&gt;
 4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128273</id>
		<title>CSC/ECE 517 Fall 2019 - E1994. Mentor management for assignments without topics</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics&amp;diff=128273"/>
		<updated>2019-11-10T23:49:12Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* User Story */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Problem Statement''' ==&lt;br /&gt;
For assignments with topics, like the OSS project, mentors are associated with topics, and then whichever team is assigned to the topic inherits the mentor for that topic  However, for assignments without topics (like Program 2), there is no good way to “automatically” assign mentors to projects.  The instructor needs to watch teams being formed, and every time a new team is formed, a new mentor needs to be assigned, outside of Expertiza. This leads to a lot of work for the instructor, as well as sometimes long delays before a team is assigned a mentor.&lt;br /&gt;
&lt;br /&gt;
== '''The goal behind this project:''' ==&lt;br /&gt;
&lt;br /&gt;
Develop a trigger that:&amp;lt;br&amp;gt;&lt;br /&gt;
1) Is activated when any team has been formed that has k members, where k is greater than 50% of the maximum team capacity&amp;lt;br&amp;gt;&lt;br /&gt;
*ex) max members = 4, trigger activated when the team size reaches 3&lt;br /&gt;
2) Assign a mentor to the team&amp;lt;br&amp;gt;&lt;br /&gt;
*Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&lt;br /&gt;
3) Notify the mentor via email that they are now assigned to a specific team, and provide the email addresses of the team members.&lt;br /&gt;
4) Possibly notify the team members that they have been assigned the mentor with contact information (further discussion here)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Design Pattern''' ==&lt;br /&gt;
Since the trigger we implemented would need multiple handlers and each of them reponses in different actions, we decide to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chain of Responsibility.png]]&lt;br /&gt;
&lt;br /&gt;
== '''Project Description''' ==&lt;br /&gt;
&lt;br /&gt;
=== Old version: ===&lt;br /&gt;
For assignments without a topic, there is no way to assign a mentor to the team on Expertiza system but to manually assigned one via Email out of the system. &lt;br /&gt;
[[File:Assign Mentor.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;In the above case, only OSS project and final project which have topic could be assigned mentors automatically by Expertiza system.&lt;br /&gt;
=== New version: ===&lt;br /&gt;
Assignments with or without a topic could be assigned with mentors automatically&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Design Diagrams''' ==&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:usecases.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solution''' ==&lt;br /&gt;
&lt;br /&gt;
'''The solution we proposed generally follow the chain of responsibility and the work flow'''&amp;lt;br&amp;gt;&lt;br /&gt;
'''The solution will follow steps list here:'''&lt;br /&gt;
*Allow instructor to assign mentors for assignments without a topic&lt;br /&gt;
*Check the topic of assignment and number of team members whether reach the requirement or not&lt;br /&gt;
*Assign mentor for the team automatically&lt;br /&gt;
*Notificate both mentor and student&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Code Modified &amp;amp; Added''' ==&lt;br /&gt;
Estimate files need to be modified:&amp;lt;br&amp;gt;&lt;br /&gt;
Controllers:&lt;br /&gt;
*app/controllers/notification_controller.rb&lt;br /&gt;
*app/controllers/participants_controller.rb&lt;br /&gt;
*app/controllers/assignment_controller.rb&lt;br /&gt;
*app/controllers/join_team_requests_controller.rb&lt;br /&gt;
*app/controllers/users_controller.rb&lt;br /&gt;
Models:&lt;br /&gt;
*app/models/assignment.rb&lt;br /&gt;
*app/models/assignment_*.rb&lt;br /&gt;
*app/models/user.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
To make sure the refactor code can work correctly, we need to run the original rspec test code and add some new test. Besides, we are plaining to test from UI to make sure all the features work. The test results are shown below.&lt;br /&gt;
&lt;br /&gt;
*Run and pass existing RSpec Tests after refactoring&lt;br /&gt;
*Develop New RSpec Tests for the new features&lt;br /&gt;
*UI testing on the deployed project&lt;br /&gt;
==RSpec Test==&lt;br /&gt;
==UI Test==&lt;br /&gt;
&lt;br /&gt;
== '''Team Member''' ==&lt;br /&gt;
Our team members: (Sorted in Alphabetical order)&amp;lt;br/&amp;gt;&lt;br /&gt;
*Hongli Wang, hwang85@ncsu.edu&lt;br /&gt;
*Minghao Liu, mliu25@ncsu.edu&lt;br /&gt;
*Ruiwen Wu, rwu5@ncsu.edu&lt;br /&gt;
*Siwei Wen, swen4@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
Mentor: Mrs. Carmen Aiken Bentley&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126724</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126724"/>
		<updated>2019-10-30T20:45:00Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Project Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
 We tested if the Institution column was on the page&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.17.133:8080/ Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126722</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126722"/>
		<updated>2019-10-30T20:44:51Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Project Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
 We tested if the Institution column was on the page&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.17.133:8080/:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126678</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126678"/>
		<updated>2019-10-30T00:00:07Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
 We tested if the Institution column was on the page&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126677</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126677"/>
		<updated>2019-10-29T23:59:31Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126676</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126676"/>
		<updated>2019-10-29T23:58:56Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126675</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126675"/>
		<updated>2019-10-29T23:54:46Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126526</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126526"/>
		<updated>2019-10-29T03:43:51Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    render action: 'new'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126503</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126503"/>
		<updated>2019-10-29T03:36:04Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126499</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126499"/>
		<updated>2019-10-29T03:34:38Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''  session = {user: admin}&lt;br /&gt;
  '''''235'''''  params = {&lt;br /&gt;
  '''''236'''''    user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''           crypted_password: 'password',&lt;br /&gt;
  '''''238'''''           role_id: 2,&lt;br /&gt;
  '''''239'''''           password_salt: 1,&lt;br /&gt;
  '''''240'''''           fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''           email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''           parent_id: 1,&lt;br /&gt;
  '''''243'''''           private_by_default: false,&lt;br /&gt;
  '''''244'''''           mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''           email_on_review: true,&lt;br /&gt;
  '''''246'''''           email_on_submission: true,&lt;br /&gt;
  '''''247'''''           email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''           is_new_user: false,&lt;br /&gt;
  '''''249'''''           master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''           handle: 'handle',&lt;br /&gt;
  '''''251'''''           digital_certificate: nil,&lt;br /&gt;
  '''''252'''''           timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''           public_key: nil,&lt;br /&gt;
  '''''254'''''           copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''           institution_id: 666,&lt;br /&gt;
  '''''256'''''           institution: {&lt;br /&gt;
  '''''257'''''               name: 'yzhu48'&lt;br /&gt;
  '''''258'''''           }&lt;br /&gt;
  '''''259'''''     }&lt;br /&gt;
  '''''260'''''  }  &lt;br /&gt;
  '''''261'''''  post :create, params, session&lt;br /&gt;
  '''''262'''''  allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''  expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''  expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126488</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126488"/>
		<updated>2019-10-29T03:30:01Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''234'''''  session = {user: admin}&lt;br /&gt;
  '''''235'''''  params = {&lt;br /&gt;
  '''''236'''''    user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''           crypted_password: 'password',&lt;br /&gt;
  '''''238'''''           role_id: 2,&lt;br /&gt;
  '''''239'''''           password_salt: 1,&lt;br /&gt;
  '''''240'''''           fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''           email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''           parent_id: 1,&lt;br /&gt;
  '''''243'''''           private_by_default: false,&lt;br /&gt;
  '''''244'''''           mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''           email_on_review: true,&lt;br /&gt;
  '''''246'''''           email_on_submission: true,&lt;br /&gt;
  '''''247'''''           email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''           is_new_user: false,&lt;br /&gt;
  '''''249'''''           master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''           handle: 'handle',&lt;br /&gt;
  '''''251'''''           digital_certificate: nil,&lt;br /&gt;
  '''''252'''''           timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''           public_key: nil,&lt;br /&gt;
  '''''254'''''           copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''           institution_id: 666,&lt;br /&gt;
  '''''256'''''           institution: {&lt;br /&gt;
  '''''257'''''               name: 'yzhu48'&lt;br /&gt;
  '''''258'''''           }&lt;br /&gt;
  '''''259'''''     }&lt;br /&gt;
  '''''260'''''  }  &lt;br /&gt;
  '''''261'''''  post :create, params, session&lt;br /&gt;
  '''''262'''''  allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''  expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''  expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126487</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126487"/>
		<updated>2019-10-29T03:29:45Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''234'''''  session = {user: admin}&lt;br /&gt;
  '''''235'''''  params = {&lt;br /&gt;
  '''''236'''''    user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''           crypted_password: 'password',&lt;br /&gt;
  '''''238'''''           role_id: 2,&lt;br /&gt;
  '''''239'''''           password_salt: 1,&lt;br /&gt;
  '''''240'''''           fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''           email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''           parent_id: 1,&lt;br /&gt;
  '''''243'''''           private_by_default: false,&lt;br /&gt;
  '''''244'''''           mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''           email_on_review: true,&lt;br /&gt;
  '''''246'''''           email_on_submission: true,&lt;br /&gt;
  '''''247'''''           email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''           is_new_user: false,&lt;br /&gt;
  '''''249'''''           master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''           handle: 'handle',&lt;br /&gt;
  '''''251'''''           digital_certificate: nil,&lt;br /&gt;
  '''''252'''''           timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''           public_key: nil,&lt;br /&gt;
  '''''254'''''           copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''           institution_id: 666,&lt;br /&gt;
  '''''256'''''           institution: {&lt;br /&gt;
  '''''257'''''               name: 'yzhu48'&lt;br /&gt;
  '''''258'''''           }&lt;br /&gt;
  '''''259'''''     }&lt;br /&gt;
  '''''260'''''  }  &lt;br /&gt;
  '''''261'''''  post :create, params, session&lt;br /&gt;
  '''''262'''''  allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''  expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''  expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126481</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126481"/>
		<updated>2019-10-29T03:26:20Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''234'''''  session = {user: admin}&lt;br /&gt;
  '''''235'''''  params = {&lt;br /&gt;
  '''''236'''''    user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''           crypted_password: 'password',&lt;br /&gt;
  '''''238'''''           role_id: 2,&lt;br /&gt;
  '''''239'''''           password_salt: 1,&lt;br /&gt;
  '''''240'''''           fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''           email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''           parent_id: 1,&lt;br /&gt;
  '''''243'''''           private_by_default: false,&lt;br /&gt;
  '''''244'''''           mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''           email_on_review: true,&lt;br /&gt;
  '''''246'''''           email_on_submission: true,&lt;br /&gt;
  '''''247'''''           email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''           is_new_user: false,&lt;br /&gt;
  '''''249'''''           master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''           handle: 'handle',&lt;br /&gt;
  '''''251'''''           digital_certificate: nil,&lt;br /&gt;
  '''''252'''''           timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''           public_key: nil,&lt;br /&gt;
  '''''254'''''           copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''           institution_id: 666,&lt;br /&gt;
  '''''256'''''           institution: {&lt;br /&gt;
  '''''257'''''               name: 'yzhu48'&lt;br /&gt;
  '''''258'''''           }&lt;br /&gt;
  '''''259'''''     }&lt;br /&gt;
  '''''260'''''  }  &lt;br /&gt;
  '''''261'''''  post :create, params, session&lt;br /&gt;
  '''''262'''''  allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''  expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''  expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126451</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126451"/>
		<updated>2019-10-29T03:09:34Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126450</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126450"/>
		<updated>2019-10-29T03:09:27Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126449</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126449"/>
		<updated>2019-10-29T03:09:18Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test for Task1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126445</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126445"/>
		<updated>2019-10-29T03:06:12Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126020</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126020"/>
		<updated>2019-10-28T22:03:50Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Project Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126017</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126017"/>
		<updated>2019-10-28T22:03:09Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Project Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126016</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126016"/>
		<updated>2019-10-28T22:03:00Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Project Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
 [152.46.18.195:8080 Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126014</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=126014"/>
		<updated>2019-10-28T22:02:34Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* E1971. OSS project Finklestein: Instructors &amp;amp; Institutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
 152.46.18.195:8080&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-2-new.png&amp;diff=125827</id>
		<title>File:Task2-2-new.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-2-new.png&amp;diff=125827"/>
		<updated>2019-10-28T03:41:54Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: uploaded a new version of &amp;amp;quot;File:Task2-2-new.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125826</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125826"/>
		<updated>2019-10-28T03:41:19Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-2-new.png&amp;diff=125825</id>
		<title>File:Task2-2-new.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-2-new.png&amp;diff=125825"/>
		<updated>2019-10-28T03:41:03Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125824</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125824"/>
		<updated>2019-10-28T03:35:45Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125823</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125823"/>
		<updated>2019-10-28T03:35:18Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task Demonstration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
 Task1:&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
 Task2:&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 Task3:&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125822</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125822"/>
		<updated>2019-10-28T03:33:37Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* E1971. OSS project Finklestein: Instructors &amp;amp; Institutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-new.png&amp;diff=125821</id>
		<title>File:Task2-new.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Task2-new.png&amp;diff=125821"/>
		<updated>2019-10-28T03:33:28Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125820</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125820"/>
		<updated>2019-10-28T03:30:57Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125819</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125819"/>
		<updated>2019-10-28T03:30:43Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125818</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125818"/>
		<updated>2019-10-28T03:30:26Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* E1971. OSS project Finklestein: Instructors &amp;amp; Institutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task2===&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Task1-new.png&amp;diff=125817</id>
		<title>File:Task1-new.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Task1-new.png&amp;diff=125817"/>
		<updated>2019-10-28T03:27:06Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125816</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125816"/>
		<updated>2019-10-28T03:24:03Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* E1971. OSS project Finklestein: Instructors &amp;amp; Institutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task2===&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125815</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125815"/>
		<updated>2019-10-28T03:22:48Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task1===&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task2===&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task3=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125814</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125814"/>
		<updated>2019-10-28T03:22:33Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* E1971. OSS project Finklestein: Instructors &amp;amp; Institutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task1===&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task2===&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task3=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125813</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125813"/>
		<updated>2019-10-28T03:21:49Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Process Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task3=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125812</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125812"/>
		<updated>2019-10-28T03:21:36Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Process Video */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task3=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125811</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125811"/>
		<updated>2019-10-28T03:20:24Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''254'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task3=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''17'''''  describe &amp;quot;View users&amp;quot; do&lt;br /&gt;
  '''''18'''''    it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''      require 'pp'&lt;br /&gt;
  '''''20'''''      driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''21'''''      driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''22'''''      driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
  '''''23'''''      driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''24'''''      driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''25'''''      driver.get(&amp;quot;http://localhost:3000/users/list&amp;quot;)&lt;br /&gt;
  '''''26'''''&lt;br /&gt;
  '''''27'''''      has_institution = false&lt;br /&gt;
  '''''28'''''      if driver.find_element(xpath: &amp;quot;/html/body/div[1]/div[1]/div/div/div/div/table/tbody/tr[2]/th[3]&amp;quot;).text == &amp;quot;Institution&amp;quot;&lt;br /&gt;
  '''''29'''''        has_institution = true&lt;br /&gt;
  '''''30'''''        expect(has_institution).to be(true)&lt;br /&gt;
  '''''31'''''      end&lt;br /&gt;
  '''''32'''''      expect(has_institution).to be(true)&lt;br /&gt;
  '''''33'''''    end&lt;br /&gt;
  '''''34'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125810</id>
		<title>CSC/ECE 517 Fall 2019 - E1971. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1971._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=125810"/>
		<updated>2019-10-28T03:14:20Z</updated>

		<summary type="html">&lt;p&gt;Rwu5: /* Test */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=E1971. OSS project Finklestein: Instructors &amp;amp; Institutions=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
 &lt;br /&gt;
* E1971 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/YongjianZhu/expertiza Expertiza-E1971]&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in E1971 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The issue occurs when the admin trying to create a new instructor with a new institution name. To fix this problem, we added a function to create a new institution and a confirmation prompt to alert the admin.&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''116'''''&amp;lt;/font&amp;gt;  # if the user name already exists, register the user by email address&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''117'''''&amp;lt;/font&amp;gt;  check = User.find_by(name: params[:user][:name])&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''118'''''&amp;lt;/font&amp;gt;  params[:user][:name] = params[:user][:email] unless check.nil?&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''119'''''  if params[:user][:institution_id].empty?&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''120'''''    institution = Institution.find_or_create_by(name: params[:institution][:name])&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''121'''''    params[:user][:institution_id] = institution.id&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''122'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;  @user = User.new(user_params)&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;  @user.institution_id = params[:user][:institution_id]&lt;br /&gt;
 -------------------------------------------------------------------------------------------------&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''142'''''&amp;lt;/font&amp;gt;  else&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''143'''''&amp;lt;/font&amp;gt;    foreign&lt;br /&gt;
 &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&amp;lt;del&amp;gt;'''''144'''''    render action: 'new'&amp;lt;/del&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''144'''''    flash[:error] = &amp;quot;Create Instructor Error!&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''145'''''    redirect_to '/admin/list_instructors'&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''146'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/new.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''8'''''  &amp;lt;ρ style=&amp;quot;color: red; font-weight: bold&amp;quot;&amp;gt;* Please Make Sure All Information is Correct&amp;lt;/ρ&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''9'''''&amp;lt;/font&amp;gt;  &amp;lt;%= submit_tag &amp;quot;Create&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
=====Test for Task1=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;''''' 8'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  ''''' 9'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''10'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''11'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''12'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''13'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''14'''''    driver.get(&amp;quot;http://localhost:3000/course/new?private=1&amp;quot;)&lt;br /&gt;
  '''''15'''''    institutions_eles = driver.find_element(:id, &amp;quot;course_institutions_id&amp;quot;)&lt;br /&gt;
  '''''16'''''    options = institutions_eles.find_elements(:tag_name, 'option')&lt;br /&gt;
  '''''17'''''    result = true&lt;br /&gt;
  '''''18'''''    for x in 0..options.size-2&lt;br /&gt;
  '''''19'''''      if (options[x].text.downcase &amp;lt;=&amp;gt; options[x+1].text.downcase) &amp;gt; 0&lt;br /&gt;
  '''''20'''''        result = false&lt;br /&gt;
  '''''21'''''        break&lt;br /&gt;
  '''''22'''''      end&lt;br /&gt;
  '''''23'''''    end&lt;br /&gt;
  '''''24'''''    expect(result).to be(true)&lt;br /&gt;
  '''''25'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
=====Test for Task2=====&lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    driver = Selenium::WebDriver.for :firefox&lt;br /&gt;
  '''''235'''''    driver.get(&amp;quot;http://localhost:3000/&amp;quot;)&lt;br /&gt;
  '''''236'''''    driver.find_element(:id, &amp;quot;login_name&amp;quot;).send_keys(&amp;quot;super_administrator2&amp;quot;)&lt;br /&gt;
  '''''237'''''    driver.find_element(:id, &amp;quot;login_password&amp;quot;).send_keys(&amp;quot;password&amp;quot;)&lt;br /&gt;
  '''''238'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''239'''''    driver.get(&amp;quot;http://localhost:3000/users/new?utf8=%E2%9C%93&amp;amp;role=Instructor&amp;amp;commit=New+Instructor&amp;quot;)&lt;br /&gt;
  '''''240'''''    driver.find_element(:id, &amp;quot;user_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''241'''''    driver.find_element(:id, &amp;quot;user_fullname&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''242'''''    driver.find_element(:id, &amp;quot;user_email&amp;quot;).send_keys(&amp;quot;yzhu48@ncsu.com&amp;quot;)&lt;br /&gt;
  '''''243'''''    driver.find_element(:id, &amp;quot;user_password&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''244'''''    driver.find_element(:id, &amp;quot;user_password_confirmation&amp;quot;).send_keys(&amp;quot;111111&amp;quot;)&lt;br /&gt;
  '''''245'''''        &lt;br /&gt;
  '''''246'''''    institutionMenu = driver.find_element(:id, 'user_institution_id')&lt;br /&gt;
  '''''247'''''    option = Selenium::WebDriver::Support::Select.new(institutionMenu)&lt;br /&gt;
  '''''248'''''    option.select_by(:text, 'Other')&lt;br /&gt;
  '''''249'''''    &lt;br /&gt;
  '''''250'''''    driver.find_element(:id, &amp;quot;institution_name&amp;quot;).send_keys(&amp;quot;yzhu48&amp;quot;)&lt;br /&gt;
  '''''251'''''&lt;br /&gt;
  '''''252'''''    driver.find_element(:name, &amp;quot;commit&amp;quot;).click()&lt;br /&gt;
  '''''253'''''    expect(response.status).to eq(200)&lt;br /&gt;
  '''''255'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Process Video===&lt;br /&gt;
Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
&lt;br /&gt;
===Team Information===&lt;br /&gt;
  '''Team_4430:'''&lt;br /&gt;
  Ruiwen Wu (rwu5@ncsu.edu)&lt;br /&gt;
  Yongjian Zhu (yzhu48@ncsu.edu)&lt;br /&gt;
  Ling Li (lli46@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Carmen Bentley (cnaiken@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Rwu5</name></author>
	</entry>
</feed>