<?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=Mramani</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=Mramani"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mramani"/>
	<updated>2026-08-11T08:57:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=134069</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=134069"/>
		<updated>2020-04-25T01:52:44Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Added UI testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Files Modified'''&lt;br /&gt;
&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive. &lt;br /&gt;
[[File:WEdit1.png]]&lt;br /&gt;
&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
# Make the code DRYer&lt;br /&gt;
[[File:Edit.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Correct Previous Design''' &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. Remove mentors from being included in a team's number of members count.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Change the View to make mentor separate from the team. &amp;lt;/br&amp;gt;&lt;br /&gt;
[[File:Wstart3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
[[File:WEdit4.png]]&lt;br /&gt;
&lt;br /&gt;
Fix the SUBMIT button issue during role selection&lt;br /&gt;
&lt;br /&gt;
[[File:Wstart.png]]&lt;br /&gt;
[[File:Wstart1.png]]&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
* The mentor should be able to check submissions of his team.&amp;lt;br/&amp;gt;&lt;br /&gt;
This will be an add on feature to this functionality which would make it more intuitive. The type of user will be used as a way to approach this. This was earlier implemented to an extent but there was difficulty accessing the content of another user. This needs to be investigated more.&lt;br /&gt;
* A new rubric must be created for the mentor who is also included in the review process.&amp;lt;/br&amp;gt;&lt;br /&gt;
A need is felt that mentor should be assessed a different rubric than the rest of the team, this can be achieved by modifying the rubric form based on the type of user and make only the corresponding details visible to them.&lt;br /&gt;
* Accommodate changes in team members/assigned topics after a mentor has been assigned.&amp;lt;/br&amp;gt;&lt;br /&gt;
This is planned to be addressed as per the new flow diagram, where a check will be performed to see what type of a team it is, new or modified one.&lt;br /&gt;
&lt;br /&gt;
== UI Testing ==&lt;br /&gt;
Part 1: &amp;lt;br&amp;gt;&lt;br /&gt;
* Login as the instructor6 &amp;lt;br&amp;gt;&lt;br /&gt;
* In the assignments view, select the add participants icon. &amp;lt;br&amp;gt;&lt;br /&gt;
* Now, all the existing participants and their roles and permissions are visible. Add a new participant or change permissions. This could be a member or mentor for our case. &amp;lt;br&amp;gt;&lt;br /&gt;
* Fix the max team size of the project. This size will decide when to add a mentor. (Here set as 4) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Part 2:  &amp;lt;br&amp;gt;&lt;br /&gt;
* Login as student575 (added to the program by the instructor) &amp;lt;br&amp;gt;&lt;br /&gt;
* In the assignments view, select program 1. Within that select your team link. &amp;lt;br&amp;gt;&lt;br /&gt;
* Currently there is no team. Create a new team. &amp;lt;br&amp;gt;&lt;br /&gt;
* Invite student573 (who's also a participant in this project) &amp;lt;br&amp;gt;&lt;br /&gt;
* Invite student574 (who's also a participant in this project) &amp;lt;br&amp;gt;&lt;br /&gt;
Part 3: &amp;lt;br&amp;gt;&lt;br /&gt;
* Login as student573. &amp;lt;br&amp;gt;&lt;br /&gt;
* In the assignments view, select program 1. Within that select your team link. &amp;lt;br&amp;gt;&lt;br /&gt;
* There will be an invite from user575, accept it. &amp;lt;br&amp;gt;&lt;br /&gt;
* Will be added to the team and a mentor is assigned. (here it is 563) &amp;lt;br&amp;gt;&lt;br /&gt;
*Check for a received email regarding team information. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Part4: &amp;lt;br&amp;gt;&lt;br /&gt;
* Login as student574. &amp;lt;br&amp;gt;&lt;br /&gt;
* Steps are the same as Part3. The difference will be in the email received. No new team formed or mentor assigned. Only 574 is added to the team and he alone gets the email. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Part5: &amp;lt;br&amp;gt;&lt;br /&gt;
*Login as student563. (Mentor) &amp;lt;br&amp;gt;&lt;br /&gt;
* In the assignments view, select program 1. Within that select your team link. All the mentor's teams for that project will be listed. &amp;lt;br&amp;gt;&lt;br /&gt;
* The mentor would have gotten an email when a new team is formed and they are added as the mentor.  &amp;lt;br&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==Team Roster ==&lt;br /&gt;
*Rajan Anbazhagan - ranbazh@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Sreenidhi Ganapathi Raman - sganapa4@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Mohnish Ramani - mramani@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Thomas Winter - thwinter@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mentor: Srujana Rachakonda - srachak@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133924</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133924"/>
		<updated>2020-04-24T21:41:17Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added team&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed.&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
* The mentor should be able to check submissions of his team.&amp;lt;br/&amp;gt;&lt;br /&gt;
This will be an add on feature to this functionality which would make it more intuitive. The type of user will be used as a way to approach this. This was earlier implemented to an extent but there was difficulty accessing the content of another user. This needs to be investigated more.&lt;br /&gt;
* A new rubric must be created for the mentor who is also included in the review process.&amp;lt;/br&amp;gt;&lt;br /&gt;
A need is felt that mentor should be assessed a different rubric than the rest of the team, this can be achieved by modifying the rubric form based on the type of user and make only the corresponding details visible to them.&lt;br /&gt;
* Accommodate changes in team members/assigned topics after a mentor has been assigned.&amp;lt;/br&amp;gt;&lt;br /&gt;
This is planned to be addressed as per the new flow diagram, where a check will be performed to see what type of a team it is, new or modified one.&lt;br /&gt;
==Team Roster ==&lt;br /&gt;
*Rajan Anbazhagan - ranbazh@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Sreenidhi Ganapathi Raman - sganapa4@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Mohnish Ramani - mramani@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
*Thomas Winter - thwinter@ncsu.edu &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mentor: Srujana Rachakonda - srachak@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133618</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133618"/>
		<updated>2020-04-14T03:33:04Z</updated>

		<summary type="html">&lt;p&gt;Mramani: /* Change in Work Flow Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
* The mentor should be able to check submissions of his team.&amp;lt;br/&amp;gt;&lt;br /&gt;
This will be an add on feature to this functionality which would make it more intuitive. The type of user will be used as a way to approach this. This was earlier implemented to an extent but there was difficulty accessing the content of another user. This needs to be investigated more.&lt;br /&gt;
* A new rubric must be created for the mentor who is also included in the review process.&amp;lt;/br&amp;gt;&lt;br /&gt;
A need is felt that mentor should be assessed a different rubric than the rest of the team, this can be achieved by modifying the rubric form based on the type of user and make only the corresponding details visible to them.&lt;br /&gt;
* Accommodate changes in team members/assigned topics after a mentor has been assigned.&amp;lt;/br&amp;gt;&lt;br /&gt;
This is planned to be addressed as per the new flow diagram, where a check will be performed to see what type of a team it is, new or modified one.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133617</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133617"/>
		<updated>2020-04-14T03:32:32Z</updated>

		<summary type="html">&lt;p&gt;Mramani: /* Functionalities to be added */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
* The mentor should be able to check submissions of his team.&amp;lt;br/&amp;gt;&lt;br /&gt;
This will be an add on feature to this functionality which would make it more intuitive. The type of user will be used as a way to approach this. This was earlier implemented to an extent but there was difficulty accessing the content of another user. This needs to be investigated more.&lt;br /&gt;
* A new rubric must be created for the mentor who is also included in the review process.&amp;lt;/br&amp;gt;&lt;br /&gt;
A need is felt that mentor should be assessed a different rubric than the rest of the team, this can be achieved by modifying the rubric form based on the type of user and make only the corresponding details visible to them.&lt;br /&gt;
* Accommodate changes in team members/assigned topics after a mentor has been assigned.&amp;lt;/br&amp;gt;&lt;br /&gt;
This is planned to be addressed as per the new flow diagram, where a check will be performed to see what type of a team it is, new or modified one.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133613</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133613"/>
		<updated>2020-04-14T03:30:30Z</updated>

		<summary type="html">&lt;p&gt;Mramani: /* Functionalities to be added */  Added explanation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
# The mentor should be able to check submissions of his team.&lt;br /&gt;
   *This will be an add on feature to this functionality which would make it more intuitive. The type of user will be used as a way to approach this. This was earlier implemented to an extent but there was difficulty accessing the content of another user. This needs to be investigated more.&lt;br /&gt;
# A new rubric must be created for the mentor who is also included in the review process.&lt;br /&gt;
   * A need is felt that mentor should be assessed a different rubric than the rest of the team, this can be achieved by modifying the rubric form based on the type of user and make only the corresponding details visible to them.&lt;br /&gt;
# Accommodate changes in team members/assigned topics after a mentor has been assigned.&lt;br /&gt;
   *This is planned to be addressed as per the new flow diagram, where a check will be performed to see what type of a team it is, new or modified one.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133607</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133607"/>
		<updated>2020-04-14T03:25:40Z</updated>

		<summary type="html">&lt;p&gt;Mramani: /* Design Pattern */  added more content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
The reason to take this approach is we have a certain question which needs to be answered, based on the answer the flow moves. It follows a sequence which follows this behaviour pattern well. &lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
# The mentor should be able to check submissions of his team.&lt;br /&gt;
# A new rubric must be created for the mentor who is also included in the review process.&lt;br /&gt;
# Accommodate changes in team members/assigned topics after a mentor has been assigned.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133601</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133601"/>
		<updated>2020-04-14T03:22:52Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Changed new workflow change pic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
# The mentor should be able to check submissions of his team.&lt;br /&gt;
# A new rubric must be created for the mentor who is also included in the review process.&lt;br /&gt;
# Accommodate changes in team members/assigned topics after a mentor has been assigned.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow.jpg&amp;diff=133599</id>
		<title>File:New flow.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow.jpg&amp;diff=133599"/>
		<updated>2020-04-14T03:21:49Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133589</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=133589"/>
		<updated>2020-04-14T03:08:39Z</updated>

		<summary type="html">&lt;p&gt;Mramani: reference added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &lt;br /&gt;
&lt;br /&gt;
Develop a trigger that: &amp;lt;br&amp;gt;&lt;br /&gt;
# 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;
# Assign a mentor to the team. 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;
# 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;
# Possibly notify the team members that they have been assigned the mentor with contact information.&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# Rename method names more meaningfully and intuitive like, from able_to_review to can_review.&lt;br /&gt;
# Reduce the number of conditional statements checking for mentor.&lt;br /&gt;
# Rename variable names to reduce confusion like changing lowest_team_no to lowest_number_of_teams.&lt;br /&gt;
&lt;br /&gt;
'''Files to be Modified'''&lt;br /&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;
&lt;br /&gt;
'''Correct Previous Design'''&lt;br /&gt;
# Remove mentors from being included in a team's number of members count.&lt;br /&gt;
# Change the conditional statement that checks if a mentor has to be added to the team. (The strength of the team has to be greater than 50% of the team size).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
# The email code has to be moved to the email module.&lt;br /&gt;
# Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
&lt;br /&gt;
[[File:Check.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
# Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
# RSpec tests for the email functionality will be added. &amp;lt;br&amp;gt;&lt;br /&gt;
# Run and pass the existing RSpec Tests. &amp;lt;br&amp;gt;&lt;br /&gt;
# Develop New RSpec Tests for the new code additions (additional features). &amp;lt;br&amp;gt;&lt;br /&gt;
# Test the UI for the deployed project.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
# The mentor should be able to check submissions of his team.&lt;br /&gt;
# A new rubric must be created for the mentor who is also included in the review process.&lt;br /&gt;
# Accommodate changes in team members/assigned topics after a mentor has been assigned.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1994._Mentor_management_for_assignments_without_topics Previous Work]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132922</id>
		<title>File:New flow mentor1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132922"/>
		<updated>2020-04-08T05:11:37Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:New flow mentor1.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132921</id>
		<title>File:New flow mentor1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132921"/>
		<updated>2020-04-08T05:09:37Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:New flow mentor1.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132920</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132920"/>
		<updated>2020-04-08T05:08:15Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added new modified flow chart&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
[[File:New flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Rename method names more meaningfully and intuitive like, from able_to_review to can_review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The email code has to be moved to the email module&amp;lt;br&amp;gt;&lt;br /&gt;
2. Code written in team file has to be moved to the assignment team file.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
1)Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
2)The email functionality does not have any tests, which has to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) The mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132919</id>
		<title>File:New flow mentor1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_flow_mentor1.jpg&amp;diff=132919"/>
		<updated>2020-04-08T05:07:04Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132918</id>
		<title>File:Orig flow mentor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132918"/>
		<updated>2020-04-08T04:39:25Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Orig flow mentor.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132917</id>
		<title>File:Orig flow mentor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132917"/>
		<updated>2020-04-08T04:32:01Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Orig flow mentor.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132916</id>
		<title>File:Orig flow mentor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132916"/>
		<updated>2020-04-08T04:27:05Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Orig flow mentor.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132915</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132915"/>
		<updated>2020-04-08T04:25:44Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently, Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of the responses in different actions, they decided to use Chain of Responsibility as the design pattern. Chain of Responsibility is a behavioural 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
=== Change in Work Flow Diagram ===&lt;br /&gt;
&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Rename method names more meaningfully and intuitive like, from able_to_review to can_review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The email code has to be moved to the email module&amp;lt;br&amp;gt;&lt;br /&gt;
2. Code written in team file has to be moved to the assignment team file.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
1)Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
2)The email functionality does not have any tests, which has to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) The mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132914</id>
		<title>File:Orig flow mentor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132914"/>
		<updated>2020-04-08T04:22:01Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Orig flow mentor.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132906</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132906"/>
		<updated>2020-04-08T02:15:44Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added example to refactoring principle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of them reponses in different actions, they decided 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
'''Refactor Code to follow good coding practices''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Rename method names more meaningfully and intuitive like, from able_to_review to can_review&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The email code has to be moved to the email module&amp;lt;br&amp;gt;&lt;br /&gt;
2. Code written in team file has to be moved to the assignment team file.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
1)Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
2)The email functionality does not have any tests, which has to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) Mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132901</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132901"/>
		<updated>2020-04-08T01:51:50Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of them reponses in different actions, they decided 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
'''Refactor Code to follow good coding practices'''&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The email code has to be moved to the email module&amp;lt;br&amp;gt;&lt;br /&gt;
2. Code written in team file has to be moved to the assignment team file.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
1)Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
2)The email functionality does not have any tests, which has to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) Mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132900</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132900"/>
		<updated>2020-04-08T01:51:00Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added one more example to wrong location code.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of them reponses in different actions, they decided 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
'''Refactor Code to follow good coding practices'''&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
1. The email code has to be moved to the email module&lt;br /&gt;
2. Code written in team file has to be moved to the assignment team file.&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
1)Some existing test cases have been modified, which has to be reverted. &amp;lt;br&amp;gt;&lt;br /&gt;
2)The email functionality does not have any tests, which has to be added. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) Mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132894</id>
		<title>CSC/ECE 517 E2024 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_E2024_Mentor_management_for_assignments_without_topics&amp;diff=132894"/>
		<updated>2020-04-08T01:21:22Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CSC/ECE 517 E2024 Mentor management for assignments without topics&lt;br /&gt;
&lt;br /&gt;
== Problem Statement == &lt;br /&gt;
&lt;br /&gt;
Currently Expertiza has no way to associate mentors with teams.  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;
== Project Goal == &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 &amp;lt;br&amp;gt;&lt;br /&gt;
2) Assign a mentor to the team. 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. &amp;lt;br&amp;gt;&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. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Previous Work == &lt;br /&gt;
=== Design Pattern ===&lt;br /&gt;
&lt;br /&gt;
Since the trigger they implemented would need multiple handlers and each of them reponses in different actions, they decided 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.&lt;br /&gt;
[[File:Cor.PNG]]&lt;br /&gt;
&lt;br /&gt;
=== Work Flow Diagram ===&lt;br /&gt;
[[File:Orig flow mentor.jpg]]&lt;br /&gt;
[[File:Orig flow mentor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Improvement on the Previous Work ==&lt;br /&gt;
'''Refactor Code to follow good coding practices'''&lt;br /&gt;
&lt;br /&gt;
'''Code placed in the wrong locations to be moved to the desired locations.''' &amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
The email code has to be moved to the email module&lt;br /&gt;
&lt;br /&gt;
'''Remove Duplicate Functions'''&lt;br /&gt;
&lt;br /&gt;
Though there is a method &amp;quot;team&amp;quot; to list the members of a team, a new method has been created, which is to be removed. &lt;br /&gt;
 &lt;br /&gt;
[[File:Issus1.png]]&lt;br /&gt;
&lt;br /&gt;
''' Testing ''' &amp;lt;br&amp;gt;&lt;br /&gt;
Some existing test cases have been modified, which has to be reverted. The email functionality does not have any tests, which has to be added.&lt;br /&gt;
&lt;br /&gt;
== Functionalities to be added ==&lt;br /&gt;
 &lt;br /&gt;
1) Mentor should be able to check submissions of his team.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor1.jpg&amp;diff=132891</id>
		<title>File:Orig flow mentor1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor1.jpg&amp;diff=132891"/>
		<updated>2020-04-08T01:16:14Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132889</id>
		<title>File:Orig flow mentor.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Orig_flow_mentor.jpg&amp;diff=132889"/>
		<updated>2020-04-08T01:15:20Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132625</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132625"/>
		<updated>2020-04-01T03:22:20Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Added test snips to testing plan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
This project focuses on a specific feature of expertiza which allows administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. &lt;br /&gt;
The demonstration for the feature is as shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate guide.jpg|figure 1|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
[[File:Non impersonate.jpg|figure 2|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
[[File:Impersonated view.jpg|figure 3|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had the following major issues.&lt;br /&gt;
*All functions related to impersonate controller were present in a single method ( from figure 4a and 4b)&lt;br /&gt;
*Presence of repetitive code ( from figure 4a and 4b)&lt;br /&gt;
*3 levels of block nesting (from figure 5)&lt;br /&gt;
* Too many return statements (from figure 6) &lt;br /&gt;
[[File:initial code1.jpg| figure 4a| frame|center]]&lt;br /&gt;
[[File:initial code2.jpg| figure 4b| frame|center]]&lt;br /&gt;
[[File:code climate3.jpg| figure 5| frame|center]]&lt;br /&gt;
[[File:code climate2.jpg| figure 6| frame|center]]&lt;br /&gt;
&lt;br /&gt;
This project is focused on resolving the issues mentioned above. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. &lt;br /&gt;
&lt;br /&gt;
One thing to be noted is that most of these users can only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;br /&gt;
&lt;br /&gt;
===Impersonate functionality navigation===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon as in Figure 1, select impersonate user. &lt;br /&gt;
Upon redirected to impersonate page, enter the account which needs to be impersonated. It impersonates that user provided that user can be impersonated. Now a new button called revert appears on the ribbon as in figure 3, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
===Problem Solution===&lt;br /&gt;
The above-mentioned issues have been tackled by refactoring the impersonate controller by splitting into many smaller methods which are later called by the main impersonate controller.&lt;br /&gt;
&lt;br /&gt;
The following are the refactored new methods that help in tackling the issue1 apart from each being specifically for some issue rectification:&lt;br /&gt;
*check_if_user_impersonateable&lt;br /&gt;
*display_error_msg&lt;br /&gt;
*overwrite_session&lt;br /&gt;
*check_if_special_char&lt;br /&gt;
*do_main_operartion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====check_if_user_impersonateable=====&lt;br /&gt;
This method plays the main role in tackling issue3 - 3 levels of block nesting apart from issue1.&lt;br /&gt;
&lt;br /&gt;
'''Intial Code'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if user&lt;br /&gt;
          unless original_user.can_impersonate? user&lt;br /&gt;
            flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' After recfactoring - Moved to separate method'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def check_if_user_impersonateable &lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          if !@original_user.can_impersonate? user&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;	    &lt;br /&gt;
            temp&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)          &lt;br /&gt;
          else &lt;br /&gt;
            overwrite_session&lt;br /&gt;
	  end&lt;br /&gt;
    else &lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
            user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    overwrite_session&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=====display_error_msg=====&lt;br /&gt;
This method is used to tackle issues1, 2 and 4. All the error message related code is moved to this method.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def display_error_msg&lt;br /&gt;
    if params[:user]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
    elsif params[:impersonate]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:impersonate][:name]}'.&amp;quot;    &lt;br /&gt;
    else	 &lt;br /&gt;
          if params[:impersonate].nil?&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
          else&lt;br /&gt;
            if !params[:impersonate][:name].empty?&lt;br /&gt;
              @message = &amp;quot;You cannot impersonate '#{params[:impersonate][:name]}'.&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              @message = &amp;quot;No original account was found. Please close your browser and start a new session.&amp;quot;&lt;br /&gt;
           end &lt;br /&gt;
       end&lt;br /&gt;
    end&lt;br /&gt;
    rescue Exception =&amp;gt; e&lt;br /&gt;
      flash[:error] = @message&lt;br /&gt;
      redirect_to :back&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====overwrite_session=====&lt;br /&gt;
This method reduces the number of return statements used in impersonate controller, apart from reducing the size of the controller.&lt;br /&gt;
&lt;br /&gt;
====== Initial Code======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if params[:impersonate].nil?&lt;br /&gt;
        # check if special chars /\?&amp;lt;&amp;gt;|&amp;amp;$# are used to avoid html tags or system command&lt;br /&gt;
        if warn_for_special_chars(params[:user][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        user = User.find_by(name: params[:user][:name])&lt;br /&gt;
        if user&lt;br /&gt;
          unless original_user.can_impersonate? user&lt;br /&gt;
            flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          session[:super_user] = session[:user] if session[:super_user].nil?&lt;br /&gt;
          AuthController.clear_user_info(session, nil)&lt;br /&gt;
          session[:original_user] = original_user&lt;br /&gt;
          session[:impersonate] = true&lt;br /&gt;
          session[:user] = user&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = message&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        # Impersonate a new account&lt;br /&gt;
        if !params[:impersonate][:name].empty?&lt;br /&gt;
          # check if special chars /\?&amp;lt;&amp;gt;|&amp;amp;$# are used to avoid html tags or system command&lt;br /&gt;
          if warn_for_special_chars(params[:impersonate][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
          if user&lt;br /&gt;
            unless original_user.can_impersonate? user&lt;br /&gt;
              flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
              redirect_back&lt;br /&gt;
              return&lt;br /&gt;
            end&lt;br /&gt;
            AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = user&lt;br /&gt;
            session[:impersonate] =  true&lt;br /&gt;
            session[:original_user] = original_user&lt;br /&gt;
          else&lt;br /&gt;
            flash[:error] = message&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====== After Refactoring - Moved to a separate method and accessed through the adapter method do_main_operation======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     def overwrite_session&lt;br /&gt;
    #if not impersonatable, then original user's session remains&lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          session[:super_user] = session[:user] if session[:super_user].nil?&lt;br /&gt;
      	  AuthController.clear_user_info(session, nil)&lt;br /&gt;
          session[:original_user] = @original_user&lt;br /&gt;
          session[:impersonate] = true&lt;br /&gt;
          session[:user] = user&lt;br /&gt;
    else&lt;br /&gt;
    #if some user is to be impersonated, their session details are overwritten onto the current to impersonate	&lt;br /&gt;
&lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
	    user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = user&lt;br /&gt;
            session[:impersonate] =  true&lt;br /&gt;
            session[:original_user] = @original_user&lt;br /&gt;
          else&lt;br /&gt;
            user = User.find_by(name: params[:user][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = session[:super_user]&lt;br /&gt;
            user = session[:user]&lt;br /&gt;
            session[:super_user] = nil&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====check_if_special_char=====&lt;br /&gt;
This code is used to reduce one functionality performed under the impersonate controller. This method checks to see if the given username is acceptable.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def check_if_special_char&lt;br /&gt;
    if warn_for_special_chars(params[:user][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====do_main_operation=====&lt;br /&gt;
This like an adapter method that is used to interface the impersonate method with display_error_msg and check_if_user_impersonatable. One main purpose to do this is to make the methods flexible for change apart from reducing the number of lines from the impersonate controller.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def do_main_operation(user)&lt;br /&gt;
     if user&lt;br /&gt;
      check_if_user_impersonateable&lt;br /&gt;
     else&lt;br /&gt;
      display_error_msg&lt;br /&gt;
     end&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
The project can be tested from the UI as follows. &lt;br /&gt;
&lt;br /&gt;
Checking if impersonating a user is working &lt;br /&gt;
   1. Input: User that can be impersonated &lt;br /&gt;
     - Login as the instructor (username -&amp;gt; instructor6 , password -&amp;gt; password &lt;br /&gt;
     - Under &amp;quot;Manage&amp;quot; tab, select &amp;quot;impersonate user&amp;quot; option &lt;br /&gt;
     - In the form, give the user ID as &amp;quot;student5890&amp;quot; &lt;br /&gt;
   Now you will be able to see that user &amp;quot;student5890&amp;quot; has been impersonated.&lt;br /&gt;
&lt;br /&gt;
[[File:imp test 1.jpg| figure 7| frame|center]]&lt;br /&gt;
[[File:imp test 2.jpg| figure 8| frame|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:imp test 4.jpg| figure 9| frame|center]]&lt;br /&gt;
&lt;br /&gt;
   2. Input: Reverting from impersonated account &lt;br /&gt;
 &lt;br /&gt;
       We will have the user &amp;quot;student5890&amp;quot;  impersonated.&lt;br /&gt;
      - Press the blue revert button at the top of the window&lt;br /&gt;
      Now you will have returned to the instructor profile&lt;br /&gt;
&lt;br /&gt;
[[File:imp test 4.jpg| figure 10| frame|center]]&lt;br /&gt;
[[File:imp test 8.jpg| figure 11| frame|center]]&lt;br /&gt;
&lt;br /&gt;
   3. Input: User that cannot be impersonated&lt;br /&gt;
     - Login as the instructor (username -&amp;gt; instructor6 , password -&amp;gt; password &lt;br /&gt;
     - Under &amp;quot;Manage&amp;quot; tab, select &amp;quot;impersonate user&amp;quot; option &lt;br /&gt;
     - In the form, give the user ID as &amp;quot;super_administrator2&amp;quot;&lt;br /&gt;
   Now you will be able to see a message being displayed on the screen, that tells that the given user cannot be impersonated. &lt;br /&gt;
[[File:imp test 6.jpg| figure 12| frame|center]]&lt;br /&gt;
[[File:imp test 5.jpg| figure 13| frame|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   4. Input: User that does not exist&lt;br /&gt;
     - Login as the instructor (username -&amp;gt; instructor6 , password -&amp;gt; password &lt;br /&gt;
     - Under &amp;quot;Manage&amp;quot; tab, select &amp;quot;impersonate user&amp;quot; option &lt;br /&gt;
     - In the form, give the user ID as &amp;quot;studentstudent&amp;quot;&lt;br /&gt;
   Now you will be able to see a message being displayed on the screen, that tells that the given user does not exist.&lt;br /&gt;
[[File:imp test 7.jpg| figure 14| frame|center]]&lt;br /&gt;
[[File:imp test 3.jpg| figure 15| frame|center]]&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_8.jpg&amp;diff=132623</id>
		<title>File:Imp test 8.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_8.jpg&amp;diff=132623"/>
		<updated>2020-04-01T03:17:23Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_7.jpg&amp;diff=132619</id>
		<title>File:Imp test 7.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_7.jpg&amp;diff=132619"/>
		<updated>2020-04-01T03:09:14Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_6.jpg&amp;diff=132618</id>
		<title>File:Imp test 6.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_6.jpg&amp;diff=132618"/>
		<updated>2020-04-01T03:09:02Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_5.jpg&amp;diff=132617</id>
		<title>File:Imp test 5.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_5.jpg&amp;diff=132617"/>
		<updated>2020-04-01T03:08:50Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_4.jpg&amp;diff=132616</id>
		<title>File:Imp test 4.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_4.jpg&amp;diff=132616"/>
		<updated>2020-04-01T03:08:35Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_3.jpg&amp;diff=132615</id>
		<title>File:Imp test 3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_3.jpg&amp;diff=132615"/>
		<updated>2020-04-01T03:08:22Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_2.jpg&amp;diff=132614</id>
		<title>File:Imp test 2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_2.jpg&amp;diff=132614"/>
		<updated>2020-04-01T03:08:09Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_1.jpg&amp;diff=132613</id>
		<title>File:Imp test 1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Imp_test_1.jpg&amp;diff=132613"/>
		<updated>2020-04-01T03:07:50Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132441</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132441"/>
		<updated>2020-03-31T20:39:29Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added code snips and explained the methods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate guide.jpg|figure 1|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
[[File:Non impersonate.jpg|figure 2|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
[[File:Impersonated view.jpg|figure 3|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had two major issues.&lt;br /&gt;
*All functions related to impersonate controller were present in a single method ( from figure 4a and 4b)&lt;br /&gt;
*Presence of repetitive code ( from figure 4a and 4b)&lt;br /&gt;
*3 levels of block nesting (from figure 5)&lt;br /&gt;
* Too many return statements (from figure 6) &lt;br /&gt;
[[File:initial code1.jpg| figure 4a| frame|center]]&lt;br /&gt;
[[File:initial code2.jpg| figure 4b| frame|center]]&lt;br /&gt;
[[File:code climate3.jpg| figure 5| frame|center]]&lt;br /&gt;
[[File:code climate2.jpg| figure 6| frame|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. One thing to be noted is that most of these users con only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;br /&gt;
&lt;br /&gt;
===Impersonate functionality navigation===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon as in Figure 1, select impersonate user. Upon redirected to impersonate page, enter the account which needs to be impersonated. If possible it impersonates that user. Now a new button called revert appears on the ribbon as in figure 3, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
===Problem Solution===&lt;br /&gt;
The above-mentioned issues have been tackled by refactoring the impersonate controller by splitting into many smaller methods which are later called by the main impersonate controller.&lt;br /&gt;
&lt;br /&gt;
The following are the refactored new methods that help in tackling the issue1 apart from each being specifically for some issue rectification:&lt;br /&gt;
*check_if_user_impersonateable&lt;br /&gt;
*display_error_msg&lt;br /&gt;
*overwrite_session&lt;br /&gt;
*check_if_special_char&lt;br /&gt;
*do_main_operartion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====check_if_user_impersonateable=====&lt;br /&gt;
This method plays the main role in tackling issue3 - 3 levels of block nesting apart from issue1.&lt;br /&gt;
&lt;br /&gt;
'''Intial Code'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if user&lt;br /&gt;
          unless original_user.can_impersonate? user&lt;br /&gt;
            flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
''' After recfactoring - Moved to separate method'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def check_if_user_impersonateable &lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          if !@original_user.can_impersonate? user&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;	    &lt;br /&gt;
            temp&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)          &lt;br /&gt;
          else &lt;br /&gt;
            overwrite_session&lt;br /&gt;
	  end&lt;br /&gt;
    else &lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
            user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    overwrite_session&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=====display_error_msg=====&lt;br /&gt;
This method is used to tackle issues1, 2 and 4. All the error message related code is moved to this method.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def display_error_msg&lt;br /&gt;
    if params[:user]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
    elsif params[:impersonate]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:impersonate][:name]}'.&amp;quot;    &lt;br /&gt;
    else	 &lt;br /&gt;
          if params[:impersonate].nil?&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
          else&lt;br /&gt;
            if !params[:impersonate][:name].empty?&lt;br /&gt;
              @message = &amp;quot;You cannot impersonate '#{params[:impersonate][:name]}'.&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              @message = &amp;quot;No original account was found. Please close your browser and start a new session.&amp;quot;&lt;br /&gt;
           end &lt;br /&gt;
       end&lt;br /&gt;
    end&lt;br /&gt;
    rescue Exception =&amp;gt; e&lt;br /&gt;
      flash[:error] = @message&lt;br /&gt;
      redirect_to :back&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====overwrite_session=====&lt;br /&gt;
This method reduces the number of return statements used in impersonate controller, apart from reducing the size of the controller.&lt;br /&gt;
&lt;br /&gt;
====== Initial Code======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if params[:impersonate].nil?&lt;br /&gt;
        # check if special chars /\?&amp;lt;&amp;gt;|&amp;amp;$# are used to avoid html tags or system command&lt;br /&gt;
        if warn_for_special_chars(params[:user][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        user = User.find_by(name: params[:user][:name])&lt;br /&gt;
        if user&lt;br /&gt;
          unless original_user.can_impersonate? user&lt;br /&gt;
            flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          session[:super_user] = session[:user] if session[:super_user].nil?&lt;br /&gt;
          AuthController.clear_user_info(session, nil)&lt;br /&gt;
          session[:original_user] = original_user&lt;br /&gt;
          session[:impersonate] = true&lt;br /&gt;
          session[:user] = user&lt;br /&gt;
        else&lt;br /&gt;
          flash[:error] = message&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
      else&lt;br /&gt;
        # Impersonate a new account&lt;br /&gt;
        if !params[:impersonate][:name].empty?&lt;br /&gt;
          # check if special chars /\?&amp;lt;&amp;gt;|&amp;amp;$# are used to avoid html tags or system command&lt;br /&gt;
          if warn_for_special_chars(params[:impersonate][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
          if user&lt;br /&gt;
            unless original_user.can_impersonate? user&lt;br /&gt;
              flash[:error] = &amp;quot;You cannot impersonate #{params[:user][:name]}.&amp;quot;&lt;br /&gt;
              redirect_back&lt;br /&gt;
              return&lt;br /&gt;
            end&lt;br /&gt;
            AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = user&lt;br /&gt;
            session[:impersonate] =  true&lt;br /&gt;
            session[:original_user] = original_user&lt;br /&gt;
          else&lt;br /&gt;
            flash[:error] = message&lt;br /&gt;
            redirect_back&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
====== After Refactoring - Moved to a separate method and accessed through the adapter method do_main_operation======&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     def overwrite_session&lt;br /&gt;
    #if not impersonatable, then original user's session remains&lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          session[:super_user] = session[:user] if session[:super_user].nil?&lt;br /&gt;
      	  AuthController.clear_user_info(session, nil)&lt;br /&gt;
          session[:original_user] = @original_user&lt;br /&gt;
          session[:impersonate] = true&lt;br /&gt;
          session[:user] = user&lt;br /&gt;
    else&lt;br /&gt;
    #if some user is to be impersonated, their session details are overwritten onto the current to impersonate	&lt;br /&gt;
&lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
	    user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = user&lt;br /&gt;
            session[:impersonate] =  true&lt;br /&gt;
            session[:original_user] = @original_user&lt;br /&gt;
          else&lt;br /&gt;
            user = User.find_by(name: params[:user][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = session[:super_user]&lt;br /&gt;
            user = session[:user]&lt;br /&gt;
            session[:super_user] = nil&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====check_if_special_char=====&lt;br /&gt;
This code is used to reduce one functionality performed under the impersonate controller. This method checks to see if the given username is acceptable.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def check_if_special_char&lt;br /&gt;
    if warn_for_special_chars(params[:user][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====do_main_operation=====&lt;br /&gt;
This like an adapter method that is used to interface the impersonate method with display_error_msg and check_if_user_impersonatable. One main purpose to do this is to make the methods flexible for change apart from reducing the number of lines from the impersonate controller.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def do_main_operation(user)&lt;br /&gt;
     if user&lt;br /&gt;
      check_if_user_impersonateable&lt;br /&gt;
     else&lt;br /&gt;
      display_error_msg&lt;br /&gt;
     end&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Test Plan ===&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132399</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132399"/>
		<updated>2020-03-31T19:39:39Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate guide.jpg|figure 1|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
[[File:Non impersonate.jpg|figure 2|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
[[File:Impersonated view.jpg|figure 3|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had two major issues.&lt;br /&gt;
*All functions related to impersonate controller were present in a single method ( from figure 4a and 4b)&lt;br /&gt;
*Presence of repetitive code ( from figure 4a and 4b)&lt;br /&gt;
*3 levels of block nesting (from figure 5)&lt;br /&gt;
* Too many return statements (from figure 6) &lt;br /&gt;
[[File:initial code1.jpg| figure 4a| frame|center]]&lt;br /&gt;
[[File:initial code2.jpg| figure 4b| frame|center]]&lt;br /&gt;
[[File:code climate3.jpg| figure 5| frame|center]]&lt;br /&gt;
[[File:code climate2.jpg| figure 6| frame|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. One thing to be noted is that most of these users con only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;br /&gt;
&lt;br /&gt;
===Impersonate functionality navigation===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon as in Figure 1, select impersonate user. Upon redirected to impersonate page, enter the account which needs to be impersonated. If possible it impersonates that user. Now a new button called revert appears on the ribbon as in figure 3, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
===Problem Solution===&lt;br /&gt;
The above-mentioned issues have been tackled by refactoring the impersonate controller by splitting into many smaller methods which are later called by the main impersonate controller.&lt;br /&gt;
&lt;br /&gt;
The following are the refactored new methods that hep in tackling the issue:&lt;br /&gt;
*check_if_user_impersonateable&lt;br /&gt;
*display_error_msg&lt;br /&gt;
*overwrite_session&lt;br /&gt;
*check_if_special_char&lt;br /&gt;
*do_main_operartion&lt;br /&gt;
&lt;br /&gt;
=====check_if_user_impersonateable=====&lt;br /&gt;
This method plays a main role in tackling issue3 - 3 levels of block nesting apart from issue1 which is the recurrent idea behind all of these methods. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def check_if_user_impersonateable &lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          if !@original_user.can_impersonate? user&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;	    &lt;br /&gt;
            temp&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)          &lt;br /&gt;
          else &lt;br /&gt;
            overwrite_session&lt;br /&gt;
	  end&lt;br /&gt;
    else &lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
            user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    overwrite_session&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
=====display_error_msg=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def display_error_msg&lt;br /&gt;
    if params[:user]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
    elsif params[:impersonate]&lt;br /&gt;
          @message = &amp;quot;No user exists with the name '#{params[:impersonate][:name]}'.&amp;quot;    &lt;br /&gt;
    else	 &lt;br /&gt;
          if params[:impersonate].nil?&lt;br /&gt;
            @message = &amp;quot;You cannot impersonate '#{params[:user][:name]}'.&amp;quot;&lt;br /&gt;
          else&lt;br /&gt;
            if !params[:impersonate][:name].empty?&lt;br /&gt;
              @message = &amp;quot;You cannot impersonate '#{params[:impersonate][:name]}'.&amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
              @message = &amp;quot;No original account was found. Please close your browser and start a new session.&amp;quot;&lt;br /&gt;
           end &lt;br /&gt;
       end&lt;br /&gt;
    end&lt;br /&gt;
    rescue Exception =&amp;gt; e&lt;br /&gt;
      flash[:error] = @message&lt;br /&gt;
      redirect_to :back&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====overwrite_session=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     def overwrite_session&lt;br /&gt;
    #if not impersonatable, then original user's session remains&lt;br /&gt;
    if params[:impersonate].nil?&lt;br /&gt;
          user = User.find_by(name: params[:user][:name])&lt;br /&gt;
          session[:super_user] = session[:user] if session[:super_user].nil?&lt;br /&gt;
      	  AuthController.clear_user_info(session, nil)&lt;br /&gt;
          session[:original_user] = @original_user&lt;br /&gt;
          session[:impersonate] = true&lt;br /&gt;
          session[:user] = user&lt;br /&gt;
    else&lt;br /&gt;
    #if some user is to be impersonated, their session details are overwritten onto the current to impersonate	&lt;br /&gt;
&lt;br /&gt;
          if !params[:impersonate][:name].empty?&lt;br /&gt;
	    user = User.find_by(name: params[:impersonate][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = user&lt;br /&gt;
            session[:impersonate] =  true&lt;br /&gt;
            session[:original_user] = @original_user&lt;br /&gt;
          else&lt;br /&gt;
            user = User.find_by(name: params[:user][:name])&lt;br /&gt;
	    AuthController.clear_user_info(session, nil)&lt;br /&gt;
            session[:user] = session[:super_user]&lt;br /&gt;
            user = session[:user]&lt;br /&gt;
            session[:super_user] = nil&lt;br /&gt;
          end&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====check_if_special_char=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def check_if_special_char&lt;br /&gt;
    if warn_for_special_chars(params[:user][:name], &amp;quot;Username&amp;quot;)&lt;br /&gt;
          redirect_back&lt;br /&gt;
          return&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=====do_main_operation=====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def do_main_operation(user)&lt;br /&gt;
     if user&lt;br /&gt;
      check_if_user_impersonateable&lt;br /&gt;
     else&lt;br /&gt;
      display_error_msg&lt;br /&gt;
     end&lt;br /&gt;
  end  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Test Plan ===&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate1.jpg&amp;diff=132366</id>
		<title>File:Code climate1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate1.jpg&amp;diff=132366"/>
		<updated>2020-03-31T18:58:13Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate2.jpg&amp;diff=132365</id>
		<title>File:Code climate2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate2.jpg&amp;diff=132365"/>
		<updated>2020-03-31T18:58:03Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate3.jpg&amp;diff=132364</id>
		<title>File:Code climate3.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Code_climate3.jpg&amp;diff=132364"/>
		<updated>2020-03-31T18:57:45Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132340</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=132340"/>
		<updated>2020-03-31T18:24:47Z</updated>

		<summary type="html">&lt;p&gt;Mramani: added intial code pics and usage guide images&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
===Peer Review Information===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon as in Figure 1, select impersonate user. Upon redirected to impersonate page, enter the account which needs to be impersonated. If possible it impersonates that user. Now a new button called revert appears on the ribbon as in figure 3, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate guide.jpg|figure 1|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
[[File:Non impersonate.jpg|figure 2|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
[[File:Impersonated view.jpg|figure 3|frame|center]]&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had two major issues.&lt;br /&gt;
*All functions related to impersonate controller were present in a single method&lt;br /&gt;
*Presence of repetitive code&lt;br /&gt;
These two issues can be clearly in the code below in figures 4a and 4b, taken from the initial file.&lt;br /&gt;
[[File:initial code1.jpg| figure 4a| frame|center]]&lt;br /&gt;
[[File:initial code2.jpg| figure 4b| frame|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. One thing to be noted is that most of these users con only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Problem Solution===&lt;br /&gt;
These two issues have been tackled by&lt;br /&gt;
Creating new methods which were called inside the impersonate controller. The new methods were:&lt;br /&gt;
&lt;br /&gt;
*checkif_user_impersonateable&lt;br /&gt;
*display_error_msg&lt;br /&gt;
*clear_session&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Initial_code2.jpg&amp;diff=132339</id>
		<title>File:Initial code2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Initial_code2.jpg&amp;diff=132339"/>
		<updated>2020-03-31T18:14:20Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Initial_code1.jpg&amp;diff=132338</id>
		<title>File:Initial code1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Initial_code1.jpg&amp;diff=132338"/>
		<updated>2020-03-31T18:14:04Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Non_impersonate.jpg&amp;diff=132337</id>
		<title>File:Non impersonate.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Non_impersonate.jpg&amp;diff=132337"/>
		<updated>2020-03-31T17:54:52Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Non impersonate.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonated_view.jpg&amp;diff=132336</id>
		<title>File:Impersonated view.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonated_view.jpg&amp;diff=132336"/>
		<updated>2020-03-31T17:53:29Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Mramani uploaded a new version of File:Impersonated view.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Non_impersonate.jpg&amp;diff=132335</id>
		<title>File:Non impersonate.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Non_impersonate.jpg&amp;diff=132335"/>
		<updated>2020-03-31T17:31:27Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonated_view.jpg&amp;diff=132334</id>
		<title>File:Impersonated view.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonated_view.jpg&amp;diff=132334"/>
		<updated>2020-03-31T17:31:03Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonate_guide.jpg&amp;diff=132333</id>
		<title>File:Impersonate guide.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Impersonate_guide.jpg&amp;diff=132333"/>
		<updated>2020-03-31T17:28:15Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=131896</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=131896"/>
		<updated>2020-03-23T22:58:35Z</updated>

		<summary type="html">&lt;p&gt;Mramani: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
===Peer Review Information===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon, select impersonate user. Upon redirected to impersonate page, enter the account which needs to be impersonated. If possible it impersonates that user. Now a new button called revert appears on the ribbon, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had two major issues.&lt;br /&gt;
*All functions related to impersonate controller were present in a single method&lt;br /&gt;
*Presence of repetitive code&lt;br /&gt;
&lt;br /&gt;
These two issues have been tackled by&lt;br /&gt;
Creating new methods which were called inside the impersonate controller. The new methods were:&lt;br /&gt;
&lt;br /&gt;
*checkif_user_impersonateable&lt;br /&gt;
*display_error_msg&lt;br /&gt;
*clear_session&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. One thing to be noted is that most of these users con only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=131894</id>
		<title>Main Page/CSC/CSC 517 Spring 2020 Refactor impersonate controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Main_Page/CSC/CSC_517_Spring_2020_Refactor_impersonate_controller&amp;diff=131894"/>
		<updated>2020-03-23T22:55:41Z</updated>

		<summary type="html">&lt;p&gt;Mramani: Creation of the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page describes the work done under E2002 OSS Program for Spring 2020, in the CSC/ECE 517 course.&lt;br /&gt;
&lt;br /&gt;
===Peer Review Information===&lt;br /&gt;
1. Instructor login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
when logged in as an instructor, under the manage option in the ribbon, select impersonate user. Upon redirected to impersonate page, enter the account which needs to be impersonated. If possible it impersonates that user. Now a new button called revert appears on the ribbon, this can be used to revert the impersonation and return to the instructor profile.&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&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 is a complete instructor-student usage website where the instructor can assign assignments, deadlines, grades, etc that is required for the course. Similarly, the students can use this website to perform the tasks required as part of the course like project or assignments submission, forming groups and collaborating with them, as well as reviewing projects and teammates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The aim of the project is to refactor the impersonate controller. The pre-existing code had two major issues.&lt;br /&gt;
1. All functions related to impersonate controller were present in a single method&lt;br /&gt;
2.Presence of repetitive code&lt;br /&gt;
&lt;br /&gt;
These two issues have been tackled by&lt;br /&gt;
1. Creating new methods which were called inside the impersonate controller. The new methods were:&lt;br /&gt;
a.checkif_user_impersonateable&lt;br /&gt;
b.display_error_msg&lt;br /&gt;
c.clear_session&lt;br /&gt;
&lt;br /&gt;
===About Impersonate Controller===&lt;br /&gt;
Expertiza allows the administrators, instructors or teaching assistants to impersonate another user (like a student) and access their account. For example, an instructor impersonating a student’s account can view their assignments, stage deadlines, peer reviews and anything else that the student can view. One thing to be noted is that most of these users con only impersonate users for whom they are a parent. For example, instructor6 is a parent of student3841 and not student3836; as a result, instructor6 can impersonate only 3841.&lt;/div&gt;</summary>
		<author><name>Mramani</name></author>
	</entry>
</feed>