<?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=Gfan</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=Gfan"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Gfan"/>
	<updated>2026-08-22T05:29:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=113630</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=113630"/>
		<updated>2017-11-16T02:50:59Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=='''Introduction to Expertise'''==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database(only instructor and TA roles which is acceptable currently but not when more other institutions try to user Expertiza).&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Problem Statement'''==&lt;br /&gt;
'''Overall Introduction'''&lt;br /&gt;
&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Detailed Requirements and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. The record retain after admin's approval/rejection and an email will be sent to remind'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they couldn't find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
[[File:Rel.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Fix 3. The record retains after admin's approval and email reminder ===&lt;br /&gt;
- redesign the view and model to retain the request record after super-admin or admin approves the request.&lt;br /&gt;
&lt;br /&gt;
- add an email tag in the corresponding view, so there will be an email send to email address offered by requester after approval/rejection.&lt;br /&gt;
&lt;br /&gt;
=='''Mockup Screens'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. First of all, a new user need to click 'REQUEST ACCOUNT' to create a new account.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. In the 'request new' page, in the original version, the user can only choose an institution from the drop-down menu. After our modification, the user can choose the 'Not List' choice in the drop-down menu and type in an institution when (s)he is not able to find his(her) institution in the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
加一张改了之后的图&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. After log in as an admin/super admin, the user can see a drop-down item under 'Administration-&amp;gt;Show requests' to see all the new account requests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Administrator.png]] ‎&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. After clicking the 'Show requests', the admin can see a list of new account requests and the emails are clickable to send email to the requesting user. Also, after the admin approves the request, the record should retain in the view and an email informing the requestor will be sent to the requestors' given email address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Requests.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. After clicking the email address, the email editor will pop up and admin can converse requestors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Emails.png]]&lt;br /&gt;
&lt;br /&gt;
=='''Design Pattern'''==&lt;br /&gt;
&lt;br /&gt;
==='''1. MVC'''===&lt;br /&gt;
The project is implemented in Ruby on Rails that uses MVC architecture. It separates an application’s data model, user interface, and control logic into three distinct components (model, view and controller, respectively).&lt;br /&gt;
&lt;br /&gt;
==='''2. Dry Principle'''===&lt;br /&gt;
We are trying to reuse the existing functionalities in Expertiza, thus avoiding code duplication. Whenever possible, code modification based on the existing classes, controllers, or tables will be done instead of creating the new one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rel.jpg&amp;diff=113629</id>
		<title>File:Rel.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rel.jpg&amp;diff=113629"/>
		<updated>2017-11-16T02:50:36Z</updated>

		<summary type="html">&lt;p&gt;Gfan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112798</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112798"/>
		<updated>2017-11-10T02:52:11Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database(only instructor and TA roles which is acceptable currently but not when more other institutions try to user Expertiza).&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they couldn't find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112796</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112796"/>
		<updated>2017-11-10T02:49:21Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Fix 1. Add institution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they couldn't find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112795</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112795"/>
		<updated>2017-11-10T02:48:55Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Fix 2. Add new Page and Action */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112794</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112794"/>
		<updated>2017-11-10T02:48:49Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Fix 1. Add institution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112793</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112793"/>
		<updated>2017-11-10T02:48:39Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Fix 1.Add institution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1. Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112792</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112792"/>
		<updated>2017-11-10T02:48:29Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Add new Page and Action= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1.Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Fix 2. Add new Page and Action===&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112791</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112791"/>
		<updated>2017-11-10T02:48:13Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Add institution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Fix 1.Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Add new Page and Action====&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112790</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112790"/>
		<updated>2017-11-10T02:47:44Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add institution ===&lt;br /&gt;
- redesign the view shown in the previous section to include a field named institution in the current form to allow user to submit their institution if they could find one in the list, and save it into the table corresponding to the form it submits to.&lt;br /&gt;
- design a requested_user table to save all account requests&lt;br /&gt;
&lt;br /&gt;
===Add new Page and Action====&lt;br /&gt;
- to create an new view that can show all pending account requests and include actions like approve and reject to allow instructors to process requests on the same page&lt;br /&gt;
- create corresponding new controller with methods corresponding to actions like reject, approve and index.&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112789</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112789"/>
		<updated>2017-11-10T02:38:34Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience, and all users are added into the database through command line operations in the database.&lt;br /&gt;
&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112788</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112788"/>
		<updated>2017-11-10T02:35:59Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Expertiza is a educational website that allows school users to submit peer reviews on assignments. To register to use this website, one needs to be either a course TA or Instructor and send a request to expertiza administrator to get approved. The request function only serves TAs and Instructors, so students won't be able to register. A student account is created by instructors or TAs. The whole purpose of this approval process is because students have no point of using this website without enrolling to an instructors course first, so they shouldn't request accounts from expertiza but from their instructors and TAs.&lt;br /&gt;
&lt;br /&gt;
A pending request page that displays all the requests should also be able to perform actions like approve or reject with an note.&lt;br /&gt;
&lt;br /&gt;
However, currently, all of these are done manually, which means no pending request page currently exists, no simple approve or reject action, and no user experience.&lt;br /&gt;
In addition, we also want users be able to add their institution if it does not show under the list provided by us.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112787</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112787"/>
		<updated>2017-11-10T02:21:47Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112786</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112786"/>
		<updated>2017-11-10T02:21:00Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Task Specifications and Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112785</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112785"/>
		<updated>2017-11-10T02:20:34Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112784</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112784"/>
		<updated>2017-11-10T02:19:29Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications and Plan===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Test Plan=&lt;br /&gt;
Both manual and RSpec test will be performed on the following items.&lt;br /&gt;
1. a proper error message for improper information filled in, such as wrong email address format or existing account.&lt;br /&gt;
2. When a pending account gets approved or rejected, an email will be sent to the submitted email address.&lt;br /&gt;
3. A new item &amp;quot;show&amp;quot; should be added under administration and direct instructor to pending requests page when clicked&lt;br /&gt;
4. pending requests will have an email column that is clickable which allows instructor to send emails to applicants before a decision is made.&lt;br /&gt;
5. when a request is processed, its record is still kept with the status of processed.&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112782</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112782"/>
		<updated>2017-11-10T01:59:05Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button, and secondly, optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112781</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112781"/>
		<updated>2017-11-10T01:54:54Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever requests for a new accounts can be approved by instructor clicking a button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:cs.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Haoxu Ren(hren3@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Dongyu Wang(dwang32@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
Yichi Zhang&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112175</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112175"/>
		<updated>2017-11-07T03:29:52Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Task Specifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever request for a new accounts can be approved by instructor clicking an button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't find one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112171</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112171"/>
		<updated>2017-11-07T03:22:40Z</updated>

		<summary type="html">&lt;p&gt;Gfan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever request for a new accounts can be approved by instructor clicking an button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
===Task Specifications===&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't found one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team Informantion ==&lt;br /&gt;
Guiyang Fan(gfan@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112170</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112170"/>
		<updated>2017-11-07T03:18:55Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever request for a new accounts can be approved by instructor clicking an button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2017-11-06_at_10.17.01_PM.png]]&lt;br /&gt;
&lt;br /&gt;
==Task Specifications==&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't found one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Screen_Shot_2017-11-06_at_10.17.01_PM.png&amp;diff=112169</id>
		<title>File:Screen Shot 2017-11-06 at 10.17.01 PM.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Screen_Shot_2017-11-06_at_10.17.01_PM.png&amp;diff=112169"/>
		<updated>2017-11-07T03:18:27Z</updated>

		<summary type="html">&lt;p&gt;Gfan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112168</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112168"/>
		<updated>2017-11-07T03:16:29Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Task Specifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever request for a new accounts can be approved by instructor clicking an button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Task Specifications==&lt;br /&gt;
'''1. Add institution''' &amp;lt;br\&amp;gt;&lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't found one. &amp;lt;br\&amp;gt;&lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&amp;lt;br\&amp;gt;&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&amp;lt;br\&amp;gt;&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&amp;lt;br\&amp;gt;&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&amp;lt;br\&amp;gt;&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&amp;lt;br\&amp;gt;&lt;br /&gt;
-make clickable user email address so a conversation is possible&amp;lt;br\&amp;gt;&lt;br /&gt;
-an email should be sent when a request is approved or declined&amp;lt;br\&amp;gt;&lt;br /&gt;
-all record should be kept on the page even it has been handled&amp;lt;br\&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112167</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112167"/>
		<updated>2017-11-07T03:15:38Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
Request account function is currently not working properly. A new user who tries to request an expertiza account can do so, but the instructor can see yet has no power to approve any request. The approval process is currently done manually, which is cumbersome. &lt;br /&gt;
Our mission is to fix the request account functionality so that whoever request for a new accounts can be approved by instructor clicking an button and optimize the functionality to improve user experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Task Specifications==&lt;br /&gt;
'''1. Add institution''' &lt;br /&gt;
-A registering user should be able to choose their institution from a drop-down menu, but they should also be able to add an institution if they couldn't found one. &lt;br /&gt;
-The new institution should be saved as a new record into the ''institution table''&lt;br /&gt;
-New account request should be saved to ''requested_users table'' with correct institution id.&lt;br /&gt;
'''2.superadmin, admin should be able to approve/decline requests'''&lt;br /&gt;
-add a new drop-down item under “Administration &amp;gt; Show…” so requests can be visually displayed and handled&lt;br /&gt;
-enable the &amp;quot;approve&amp;quot; function for admin and superadmin&lt;br /&gt;
-make clickable user email address so a conversation is possible&lt;br /&gt;
-an email should be sent when a request is approved or declined&lt;br /&gt;
-all record should be kept on the page even it has been handled&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017&amp;diff=112153</id>
		<title>CSC/ECE 517 Fall 2017</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017&amp;diff=112153"/>
		<updated>2017-11-07T02:59:01Z</updated>

		<summary type="html">&lt;p&gt;Gfan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Design Project Documentation'''&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A2 Lightweight Badging System]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A8. Use a profiler to identify the problems / pages that take some time to load &amp;amp; fix them]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1793. Help students find teams to join]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A0 Team-based reviewing]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1793. Help students find teams to join_Team1964]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1791. Track the time that students look at the other submissions - logging improvement]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1799 Improve self-review Link peer review &amp;amp; self-review to derive grades]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1797_Timestamps_for_students_submissions]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E17A1|CSC/ECE_517_Fall_2017/E17A1 - Let experts as well as students do reviews]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/M1754_Mutation_Testing]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1794. Student-generated questions added to rubric]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably]]&lt;br /&gt;
&lt;br /&gt;
'''Writing Assignment 2'''&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1779. Fix teammate advertisements and requests to join a team]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1774 Metareview fixes and improvements.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1788 OSS project Maroon Heatmap fixes]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1781 Topic Management]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1745_Refactor_response_controller.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1752 Refactor assignments controller]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1776_Enhance_Imports]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1756 TLD Refactor response.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1772_Refactor reputation_web_service_controller.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/M1754_Mutation Testing on Servo]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1753 OSS project bidding tests]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1766_Test team functionality]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1767 Improve imports]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1786_OSS project Juniper Bookmark Enhancements]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1787_OSS project Bronze Score calculations]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1763 Fix Staggered-Deadline Assignments]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1757 Introduce a Student View for instructors]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1769_Refactor assignment_form.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1754_Feature_test_of_rubric_advice]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1782 OSS Project Red Assignment Directories]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1761 Test First Development Refactor assignment.rb]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1780_OSS_Project_Teal_Email_Notification_Enhancements]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1762 Test various kinds of response-map hierarchies]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1759 ]]&lt;br /&gt;
*[[CSC/ECE_517_Fall_2017/E1749_Test First Development Refactor questionnaire_controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1777 Coherent specification of review requirements.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Fall 2017/E1771_Refactor_team.rb]]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112151</id>
		<title>CSC/ECE 517 Fall 2017/E17A6. Fix account creation over web to work reasonably</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A6._Fix_account_creation_over_web_to_work_reasonably&amp;diff=112151"/>
		<updated>2017-11-07T02:58:01Z</updated>

		<summary type="html">&lt;p&gt;Gfan: Created page with &amp;quot;===introduction===&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===introduction===&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111143</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111143"/>
		<updated>2017-11-01T21:02:28Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Running the project Locally */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
==== Problem Description ====&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
====Problem====&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise an error. This error&lt;br /&gt;
is not necessarily a bug in the code, but rather a protection masochism. As said &lt;br /&gt;
before, it is a matter of choice to get rid of this error or not. Raising an exception&lt;br /&gt;
is the simplest way to stop the app when some behavior is not wanted.&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
====Problem====&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary. Also, the solution is a matter of choice. The &lt;br /&gt;
simplest way to stop users to submit or post any new data into the data base is &lt;br /&gt;
to raise an exception which will stop the app. So we are merely making a suggestion&lt;br /&gt;
here.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
===Running the project Locally ===&lt;br /&gt;
First, follow the instructions given on [https://github.com/expertiza/expertiza Expertiza]. It's your choice to use virtual machine or set up your own environment.&lt;br /&gt;
Clone the repository which is also the submitted [https://github.com/expertiza/expertiza/pull/1031 Pull request].&lt;br /&gt;
In this project, we will mainly use airbrake to do testing.&lt;br /&gt;
&lt;br /&gt;
===Setting up Airbrake===&lt;br /&gt;
Expertiza has already implemented the airbrake gem. You need an airbrake account to begin test.&lt;br /&gt;
In''' /config/initializers/airbrake.rb''' , change the following line&lt;br /&gt;
&lt;br /&gt;
     c.ignore_environments = %w(development test) =&amp;gt;  c.ignore_environments = %w(test)&lt;br /&gt;
     c.project_id = 'your airbrake account id'&lt;br /&gt;
     c.project_key = 'your airbrake project_key'&lt;br /&gt;
&lt;br /&gt;
You will get your project id after you registered an airbrake account and created a new project on it. It is in your account profile.&lt;br /&gt;
where project key will be at the same location with your project id. &lt;br /&gt;
&lt;br /&gt;
Once you have the right key and id pair, you can start testing the run-time exceptions.&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111142</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111142"/>
		<updated>2017-11-01T21:02:08Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
==== Problem Description ====&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
====Problem====&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise an error. This error&lt;br /&gt;
is not necessarily a bug in the code, but rather a protection masochism. As said &lt;br /&gt;
before, it is a matter of choice to get rid of this error or not. Raising an exception&lt;br /&gt;
is the simplest way to stop the app when some behavior is not wanted.&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
====Problem====&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary. Also, the solution is a matter of choice. The &lt;br /&gt;
simplest way to stop users to submit or post any new data into the data base is &lt;br /&gt;
to raise an exception which will stop the app. So we are merely making a suggestion&lt;br /&gt;
here.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
===Running the project Locally ===&lt;br /&gt;
First, follow the instructions given on [https://github.com/expertiza/expertiza Expertiza]. It's your choice to use virtual machine or set up your own environment.&lt;br /&gt;
Clone the repository which is also the submitted[https://github.com/expertiza/expertiza/pull/1031 Pull request].&lt;br /&gt;
In this project, we will mainly use airbrake to do testing.&lt;br /&gt;
&lt;br /&gt;
===Setting up Airbrake===&lt;br /&gt;
Expertiza has already implemented the airbrake gem. You need an airbrake account to begin test.&lt;br /&gt;
In''' /config/initializers/airbrake.rb''' , change the following line&lt;br /&gt;
&lt;br /&gt;
     c.ignore_environments = %w(development test) =&amp;gt;  c.ignore_environments = %w(test)&lt;br /&gt;
     c.project_id = 'your airbrake account id'&lt;br /&gt;
     c.project_key = 'your airbrake project_key'&lt;br /&gt;
&lt;br /&gt;
You will get your project id after you registered an airbrake account and created a new project on it. It is in your account profile.&lt;br /&gt;
where project key will be at the same location with your project id. &lt;br /&gt;
&lt;br /&gt;
Once you have the right key and id pair, you can start testing the run-time exceptions.&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111140</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111140"/>
		<updated>2017-11-01T20:49:59Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 4. RuntimeError: This topic has too many reviews; please select another one */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
==== Problem Description ====&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
====Problem====&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise an error. This error&lt;br /&gt;
is not necessarily a bug in the code, but rather a protection masochism. As said &lt;br /&gt;
before, it is a matter of choice to get rid of this error or not. Raising an exception&lt;br /&gt;
is the simplest way to stop the app when some behavior is not wanted.&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
====Problem====&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary. Also, the solution is a matter of choice. The &lt;br /&gt;
simplest way to stop users to submit or post any new data into the data base is &lt;br /&gt;
to raise an exception which will stop the app. So we are merely making a suggestion&lt;br /&gt;
here.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111139</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111139"/>
		<updated>2017-11-01T20:46:00Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 3. ActionController::InvalidAuthenticityToken */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
==== Problem Description ====&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
====Problem====&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise an error. This error&lt;br /&gt;
is not necessarily a bug in the code, but rather a protection masochism. As said &lt;br /&gt;
before, it is a matter of choice to get rid of this error or not. Raising an exception&lt;br /&gt;
is the simplest way to stop the app when some behavior is not wanted.&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111138</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111138"/>
		<updated>2017-11-01T20:43:13Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 2. AbstractController::ActionNotFound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
==== Problem Description ====&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111137</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=111137"/>
		<updated>2017-11-01T20:02:20Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
====Problem Description:====&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Solution====&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110869</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110869"/>
		<updated>2017-10-28T20:31:39Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1031 Pull request]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110868</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110868"/>
		<updated>2017-10-28T20:28:51Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
#[https://airbrake.io Airbrake ]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110867</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110867"/>
		<updated>2017-10-28T20:28:10Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110866</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110866"/>
		<updated>2017-10-28T20:28:01Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 4. RuntimeError: This topic has too many reviews; please select another one */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;br /&gt;
&lt;br /&gt;
==Reference ==&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Tylerfan/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/phusion/passenger/issues/1730 Undefined method ' call' fix]&lt;br /&gt;
&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110026</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=110026"/>
		<updated>2017-10-27T18:31:51Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Airbrake Run-time Exceptions and Fixes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same or similar fix can be used to fix all exceptions in the same different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
There are 10 similar errors in Top 40 errors involved 5 controllers, which are ResponseController, AuthController, AdminController, ImpersonateController and PublishingController. If a controller mentioned above never uses a method declared by resources, we delete the relevant resources and add the routes of method separately, otherwise we use except expression to exclude methods we don't use.&lt;br /&gt;
&lt;br /&gt;
===Exception 3. ActionController::InvalidAuthenticityToken===&lt;br /&gt;
&lt;br /&gt;
 Error Message: You submitted a form with an outdated or missing authenticity token. Try reloading the page you just submitted and submit the form again.&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''config/initializers/request_forgery_protection_mod.rb'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''response#create'''&lt;br /&gt;
&lt;br /&gt;
The background of this problem is that The authenticity token is a random value&lt;br /&gt;
generated in your view to prove a request is submitted from a form on your site,&lt;br /&gt;
not somewhere else. This protects against CSRF attacks.&lt;br /&gt;
&lt;br /&gt;
The expertiza problem could be the user session expired and the solution can be&lt;br /&gt;
delete the code in the '''config/initializers/request_forgery_protection_mod.rb''', &lt;br /&gt;
and redirect or just refresh the page, which would not raise error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 4. RuntimeError: This topic has too many reviews; please select another one===&lt;br /&gt;
&lt;br /&gt;
The error was raised in '''app/models/review_assignment.rb:171'''&lt;br /&gt;
&lt;br /&gt;
And the error actually happened in '''review_mapping#assign_reviewer_dynamically'''&lt;br /&gt;
&lt;br /&gt;
The intuition is that the review to a topic should be assigned dynamically and&lt;br /&gt;
&amp;quot;too many reviews&amp;quot; problem should be handled by action '''revew_mapping#assign_reviewer_dynamically'''.&lt;br /&gt;
So we could add the below condition in the above controller action to handle this problem.&lt;br /&gt;
&lt;br /&gt;
Instead of raising an error, we could simply handle this problem, which can make&lt;br /&gt;
&amp;quot;flash danger message&amp;quot; unnecessary.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109328</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109328"/>
		<updated>2017-10-26T02:33:06Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 2. AbstractController::ActionNotFound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is made available to the user to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;br /&gt;
&lt;br /&gt;
Following the same principle, we have modified '''/config/routes.rb''' for routes that have caused the most exceptions due to exposure of invalid url redirection to the user. &lt;br /&gt;
     resources :response''', :except =&amp;gt;[:index]'''do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_feedback&lt;br /&gt;
      get :view&lt;br /&gt;
      post :delete&lt;br /&gt;
      get :remove_hyperlink&lt;br /&gt;
      get :saving&lt;br /&gt;
      get :redirection&lt;br /&gt;
      get :show_calibration_results_for_student&lt;br /&gt;
      post :custom_create&lt;br /&gt;
      get :pending_surveys&lt;br /&gt;
      '''get '/*path', to: redirect('/response/pending_surveys')'''&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109325</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109325"/>
		<updated>2017-10-26T02:25:54Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 2. AbstractController::ActionNotFound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb''', we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is performed to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109324</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109324"/>
		<updated>2017-10-26T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 2. AbstractController::ActionNotFound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller.&lt;br /&gt;
&lt;br /&gt;
By thoroughly investigating the controller in trouble and its routes, we came up with a solution that to either reroute the url to an effective url or abort the RESTful route.&lt;br /&gt;
&lt;br /&gt;
For one example, in '''app/controllers/auth_controller''', we found no show/index action defined or needed, but in '''/config/routes.rb, we have the following:&lt;br /&gt;
&lt;br /&gt;
  '''=begin'''&lt;br /&gt;
  resources :auth , :except=&amp;gt;[:show,:index,:create,:destroy,:update,:edit,:new] do&lt;br /&gt;
    collection do&lt;br /&gt;
      post :login&lt;br /&gt;
      post :logout&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  '''=end'''&lt;br /&gt;
By using resources:auth, rails actually creates index and show actions by default. Somewhere in the app, a redirect is performed to an index or show view page which does not exist. Thus, in order to save the trouble finding the redirect, we simply redirect anything points to those invalid pages to a valid page, which is the root.The modified code is below:&lt;br /&gt;
&lt;br /&gt;
  '''post   '/auth/login'  ,to:&amp;quot;auth#login&amp;quot;'''&lt;br /&gt;
  '''post    '/auth/logout' ,to:&amp;quot;auth#logout&amp;quot;'''&lt;br /&gt;
  '''get '/auth/*path', to: redirect('/')'''&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109321</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109321"/>
		<updated>2017-10-26T02:15:08Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Airbrake Run-time Exceptions and Fixes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
found during our review of other errors that some developers had used passenger.&amp;lt;br/&amp;gt;&lt;br /&gt;
The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
So the solution might be just to remove the gem passenger from production environment.&amp;lt;br/&amp;gt; &lt;br /&gt;
For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Exception 2. AbstractController::ActionNotFound===&lt;br /&gt;
In most of the cases, the error is caused by an abusive use of RESTful routing provided in rails. &lt;br /&gt;
In the middle of somewhere of the app, an index or show action is considered &amp;quot;called&amp;quot; when the redirect url matches such an action which is undefined in the controller,&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109317</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109317"/>
		<updated>2017-10-26T02:05:27Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
  http://localhost:3000/response/view?id=91251, the error is verified does not appear again. The last time this error occurred was 5&lt;br /&gt;
  months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
  is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109315</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109315"/>
		<updated>2017-10-26T02:03:35Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
    is called and traced, which we couldn't find such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109314</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109314"/>
		<updated>2017-10-26T02:02:51Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
    is called and traced, which we could file such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109313</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109313"/>
		<updated>2017-10-26T02:01:55Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account. As you may have noticed, the picture on the right shows the passenger gem&lt;br /&gt;
    is called and traced, which we could file such a gem installed in the current gemfile.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109312</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109312"/>
		<updated>2017-10-26T02:00:12Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;br /&gt;
    Note, the link is only accessible to super admin account.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109311</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109311"/>
		<updated>2017-10-26T01:59:25Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Exception 1. NoMethodError: undefined method 'call' for nil:NilClass */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'uniq' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    Similarly, by going to the error cause url(https://expertiza.ncsu.edu/sign_up_sheet/set_priority) again under development environment, there is no such page exist.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109310</id>
		<title>CSC/ECE 517 Fall 2017/E1773 Investigate and Fix Expertiza Production Version Runtime Exceptions.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E1773_Investigate_and_Fix_Expertiza_Production_Version_Runtime_Exceptions.rb&amp;diff=109310"/>
		<updated>2017-10-26T01:54:17Z</updated>

		<summary type="html">&lt;p&gt;Gfan: /* Airbrake Run-time Exceptions and Fixes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
===Background===&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza]is a open-source ruby-on-rails project on [https://github.com/expertiza/expertiza github]. It constructs a peer-review system by enabling interactions among users and instructors. Students can sign up for a class, view assignments, submit assignments and give peer reviews using expertiza. Instructors can publish assignments, surveys, and reviews, view statistical results and make announcements. The website is created and currently maintained mainly by the students and faculties from NCSU.&lt;br /&gt;
&lt;br /&gt;
===Motivation===&lt;br /&gt;
[https://airbrake.io/ Airbrake] is a online debugging tool for rails projects that is currently incorporated in Expertiza. Thus, Expertiza production errors at run time are tracked and reported statistically to Airbrake for reviewing and debugging. &lt;br /&gt;
Our goal for this OSS project is to fix [https://upload.wikimedia.org/wikipedia/commons/9/9c/10errors.png the top 10 run time exceptions] ranked by occurrences reported to Airbrake. You can check the 10 most ranked exceptions by click on the previous hyperlink.&lt;br /&gt;
&lt;br /&gt;
==Airbrake Run-time Exceptions and Fixes==&lt;br /&gt;
By investigating into the top 10 errors from airbrake, we can divide them into different categories by the root of their causes.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''1. NoMethodError: undefined method for nil:NilClass (4 out of 10) &amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''2. AbstractController::ActionNotFound (4 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''3. ActionController::InvalidAuthenticityToken (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
'''4. ActiveRecord::RecordNotFound: Couldn't find Participant without an ID (1 out of 10)&amp;lt;br/&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
As we have discovered, the same fix can be used to fix each and every different category, which is how we categorized these exceptions initially. &lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
&lt;br /&gt;
/config/routes.rb&lt;br /&gt;
&lt;br /&gt;
===Exception 1. NoMethodError: undefined method 'call' for nil:NilClass ===&lt;br /&gt;
&lt;br /&gt;
    '''Fix'''&lt;br /&gt;
    From the Airbrake issue page, we could find out that the problem is actually caused by a gem called passenger.&lt;br /&gt;
    Although we couldn't find any sign of passenger gem in the recent master branch, but there is a clear sign we &lt;br /&gt;
  found during our review of other errors that some developers had used passenger.&lt;br /&gt;
    The gem might be under the production path `/home/rails/.rvm/gems/ruby-2.1.5/gems/passenger-5.0.16/' &lt;br /&gt;
  So the solution might be just to remove the gem passenger from production environment. &lt;br /&gt;
    For more information, please check [https://github.com/phusion/passenger/issues/1730 here]&lt;br /&gt;
&lt;br /&gt;
''' NoMethodError: undefined method 'role' for nil:NilClass is one similar error that occurs during run-time '''&lt;br /&gt;
&lt;br /&gt;
    [[File:Error1.png|thumb|left|600px|pic1]][[File:Error11.png|600px|pic2]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    After investigating this error by going to the error causing url,as shown in pic1, given by airbrake under development environment, &lt;br /&gt;
    http://localhost:3000/response/view?id=91251, the error does not appear again. The last time this error occurred was 5 months ago.&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Error11.png&amp;diff=109309</id>
		<title>File:Error11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Error11.png&amp;diff=109309"/>
		<updated>2017-10-26T01:44:50Z</updated>

		<summary type="html">&lt;p&gt;Gfan: uploaded a new version of &amp;amp;quot;File:Error11.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Error11.png&amp;diff=109308</id>
		<title>File:Error11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Error11.png&amp;diff=109308"/>
		<updated>2017-10-26T01:43:07Z</updated>

		<summary type="html">&lt;p&gt;Gfan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gfan</name></author>
	</entry>
</feed>