<?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=Psengo</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=Psengo"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Psengo"/>
	<updated>2026-05-19T01:30:57Z</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_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141833</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141833"/>
		<updated>2021-11-29T04:05:56Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Important Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
#  The previous implementation takes the text area field in the view to fetch the review comment, but it’s not updated dynamically when the user types a comment. The user needs to save the form then go back to edit view and then request feedback.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
&lt;br /&gt;
=== UI Changes ===&lt;br /&gt;
We refactored the UI of the generated table showing the problem, suggestion, and sentiment of the review comment, by adding a tooltip for prompting the Question and its corresponding review comment in the table itself. &lt;br /&gt;
==== UI screenshots ====&lt;br /&gt;
[[File:Review_table.PNG|500px|thumb|center]]&lt;br /&gt;
[[File:Retry.PNG|400px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added a tooltip in front of every comment number, which on hovering shows the question for which the feedback is given as well as the review comment given for that question.&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Bug Fixes (Dynamic Feedback) ===&lt;br /&gt;
Previously, the implementation took into account the text area field because of which we need to save the form before getting the feedback. We changed the implementation so that users can type in a review comment and dynamically get feedback on it before saving.&lt;br /&gt;
[[File:Bug-fix-1.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - The global variable response_general was used to store the response, which was not needed as the Promise will return the response and we threw an error in case of rejection, which is handled makeRequest method&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Api refact.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing code duplication) ===&lt;br /&gt;
In the previous implementation, code was duplicated for handling different scenarios of fetching the review comment. The code was mostly the same with some conditions. We abstracted the functionality into a method that can be used at multiple places instead of duplicating the code. &lt;br /&gt;
&lt;br /&gt;
Also, the previous implementation was counting the number of rubric questions by parsing the DOM Structure, we refactored that logic as well.&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description  - The internal function create_comment_object is used for generating comment object according to question and class_name of DOM. This comment JSON is then used to pass to the API for fetching the predictions. &lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Create_comment_object.PNG|1200px|thumb|center]]&lt;br /&gt;
[[File:While_loo.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Error handling improvements ===&lt;br /&gt;
We introduced error handling by changing the “Loading…” text to “Request failed. Please try again.” if the API for generating feedback fails. Previously, this  case was not handled&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added try-catch blocks while making API call, and if the promise is rejected we catch the error and change the “Loading…” text at the bottom to “Request failed. Please try again.”&lt;br /&gt;
#Files changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Request_error.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:Request error 2.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (Removing Hardcoded Values) ===&lt;br /&gt;
In the previous implementation the api urls for each analysis and the tool tip description for the analysis were hardcoded into the files. We moved theses values out into the config file below and the values for each of the hardcoded analysis values can be accessed anywhere in the _response_analysis.html.erb file which handles the processing for the analysis. This allows any hardcoded analysis value to be found in one location along with making it easier to append other hardcoded values to each analysis. &lt;br /&gt;
&lt;br /&gt;
[[File:Config File.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing duplicate api values) ===&lt;br /&gt;
In the previous implementation each analysis in the _response_analysis.html.erb file had its own block of code for getting the response message, processing values and displaying it to the table. The issue was that many analysis had duplicate blocks of code for getting response message, processing data, and displaying data with only a few analysis requiring different getting, processing, and displaying methods. In the new implementation a for loop would loop through each analysis and would run a default block of code for getting, processing, and displaying data unless the analysis had its own unique getting, processing, and displaying methods where an if statement in the for loop would run the blocks of code for the given method.&lt;br /&gt;
&lt;br /&gt;
[[File:ResponseOld.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:ResponseNew.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://youtu.be/oN7qCNTFBE8&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseNew.PNG&amp;diff=141817</id>
		<title>File:ResponseNew.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseNew.PNG&amp;diff=141817"/>
		<updated>2021-11-28T23:42:54Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseOld.PNG&amp;diff=141816</id>
		<title>File:ResponseOld.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseOld.PNG&amp;diff=141816"/>
		<updated>2021-11-28T23:42:43Z</updated>

		<summary type="html">&lt;p&gt;Psengo: Psengo uploaded a new version of File:ResponseOld.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseOld.PNG&amp;diff=141815</id>
		<title>File:ResponseOld.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ResponseOld.PNG&amp;diff=141815"/>
		<updated>2021-11-28T23:40:22Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141814</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141814"/>
		<updated>2021-11-28T23:39:57Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Refactoring (removing duplicate api values) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
#  The previous implementation takes the text area field in the view to fetch the review comment, but it’s not updated dynamically when the user types a comment. The user needs to save the form then go back to edit view and then request feedback.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
&lt;br /&gt;
=== UI Changes ===&lt;br /&gt;
We refactored the UI of the generated table showing the problem, suggestion, and sentiment of the review comment, by adding a tooltip for prompting the Question and its corresponding review comment in the table itself. &lt;br /&gt;
==== UI screenshots ====&lt;br /&gt;
[[File:Review_table.PNG|500px|thumb|center]]&lt;br /&gt;
[[File:Retry.PNG|400px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added a tooltip in front of every comment number, which on hovering shows the question for which the feedback is given as well as the review comment given for that question.&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Bug Fixes (Dynamic Feedback) ===&lt;br /&gt;
Previously, the implementation took into account the text area field because of which we need to save the form before getting the feedback. We changed the implementation so that users can type in a review comment and dynamically get feedback on it before saving.&lt;br /&gt;
[[File:Bug-fix-1.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - The global variable response_general was used to store the response, which was not needed as the Promise will return the response and we threw an error in case of rejection, which is handled makeRequest method&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Api refact.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing code duplication) ===&lt;br /&gt;
In the previous implementation, code was duplicated for handling different scenarios of fetching the review comment. The code was mostly the same with some conditions. We abstracted the functionality into a method that can be used at multiple places instead of duplicating the code. &lt;br /&gt;
&lt;br /&gt;
Also, the previous implementation was counting the number of rubric questions by parsing the DOM Structure, we refactored that logic as well.&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description  - The internal function create_comment_object is used for generating comment object according to question and class_name of DOM. This comment JSON is then used to pass to the API for fetching the predictions. &lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Create_comment_object.PNG|1200px|thumb|center]]&lt;br /&gt;
[[File:While_loo.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Error handling improvements ===&lt;br /&gt;
We introduced error handling by changing the “Loading…” text to “Request failed. Please try again.” if the API for generating feedback fails. Previously, this  case was not handled&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added try-catch blocks while making API call, and if the promise is rejected we catch the error and change the “Loading…” text at the bottom to “Request failed. Please try again.”&lt;br /&gt;
#Files changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Request_error.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:Request error 2.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (Removing Hardcoded Values) ===&lt;br /&gt;
In the previous implementation the api urls for each analysis and the tool tip description for the analysis were hardcoded into the files. We moved theses values out into the config file below and the values for each of the hardcoded analysis values can be accessed anywhere in the _response_analysis.html.erb file which handles the processing for the analysis. This allows any hardcoded analysis value to be found in one location along with making it easier to append other hardcoded values to each analysis. &lt;br /&gt;
&lt;br /&gt;
[[File:Config File.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing duplicate api values) ===&lt;br /&gt;
In the previous implementation each analysis in the _response_analysis.html.erb file had its own block of code for getting the response message, processing values and displaying it to the table. The issue was that many analysis had duplicate blocks of code for getting response message, processing data, and displaying data with only a few analysis requiring different getting, processing, and displaying methods. In the new implementation a for loop would loop through each analysis and would run a default block of code for getting, processing, and displaying data unless the analysis had its own unique getting, processing, and displaying methods where an if statement in the for loop would run the blocks of code for the given method.&lt;br /&gt;
&lt;br /&gt;
[[File:ResponseOld.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:ResponseNew.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://www.youtube.com/watch?v=OYZvNVa3GZ8&amp;amp;feature=youtu.be (Youtube video for previous implementation)&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141811</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141811"/>
		<updated>2021-11-28T23:38:53Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Refactoring (Removing Hardcoded Values) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
#  The previous implementation takes the text area field in the view to fetch the review comment, but it’s not updated dynamically when the user types a comment. The user needs to save the form then go back to edit view and then request feedback.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
&lt;br /&gt;
=== UI Changes ===&lt;br /&gt;
We refactored the UI of the generated table showing the problem, suggestion, and sentiment of the review comment, by adding a tooltip for prompting the Question and its corresponding review comment in the table itself. &lt;br /&gt;
==== UI screenshots ====&lt;br /&gt;
[[File:Review_table.PNG|500px|thumb|center]]&lt;br /&gt;
[[File:Retry.PNG|400px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added a tooltip in front of every comment number, which on hovering shows the question for which the feedback is given as well as the review comment given for that question.&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Bug Fixes (Dynamic Feedback) ===&lt;br /&gt;
Previously, the implementation took into account the text area field because of which we need to save the form before getting the feedback. We changed the implementation so that users can type in a review comment and dynamically get feedback on it before saving.&lt;br /&gt;
[[File:Bug-fix-1.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - The global variable response_general was used to store the response, which was not needed as the Promise will return the response and we threw an error in case of rejection, which is handled makeRequest method&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Api refact.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing code duplication) ===&lt;br /&gt;
In the previous implementation, code was duplicated for handling different scenarios of fetching the review comment. The code was mostly the same with some conditions. We abstracted the functionality into a method that can be used at multiple places instead of duplicating the code. &lt;br /&gt;
&lt;br /&gt;
Also, the previous implementation was counting the number of rubric questions by parsing the DOM Structure, we refactored that logic as well.&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description  - The internal function create_comment_object is used for generating comment object according to question and class_name of DOM. This comment JSON is then used to pass to the API for fetching the predictions. &lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Create_comment_object.PNG|1200px|thumb|center]]&lt;br /&gt;
[[File:While_loo.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Error handling improvements ===&lt;br /&gt;
We introduced error handling by changing the “Loading…” text to “Request failed. Please try again.” if the API for generating feedback fails. Previously, this  case was not handled&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added try-catch blocks while making API call, and if the promise is rejected we catch the error and change the “Loading…” text at the bottom to “Request failed. Please try again.”&lt;br /&gt;
#Files changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Request_error.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:Request error 2.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (Removing Hardcoded Values) ===&lt;br /&gt;
In the previous implementation the api urls for each analysis and the tool tip description for the analysis were hardcoded into the files. We moved theses values out into the config file below and the values for each of the hardcoded analysis values can be accessed anywhere in the _response_analysis.html.erb file which handles the processing for the analysis. This allows any hardcoded analysis value to be found in one location along with making it easier to append other hardcoded values to each analysis. &lt;br /&gt;
&lt;br /&gt;
[[File:Config File.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing duplicate api values) ===&lt;br /&gt;
In the previous implementation each analysis in the _response_analysis.html.erb file had its own block of code for getting the response message, processing values and displaying it to the table. The issue was that many analysis had duplicate blocks of code for getting response message, processing data, and displaying data with only a few analysis requiring different getting, processing, and displaying methods. In the new implementation a for loop would loop through each analysis and would run a default block of code for getting, processing, and displaying data unless the analysis had its own unique getting, processing, and displaying methods where an if statement in the for loop would run the blocks of code for the given method.    &lt;br /&gt;
   &lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://www.youtube.com/watch?v=OYZvNVa3GZ8&amp;amp;feature=youtu.be (Youtube video for previous implementation)&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141810</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141810"/>
		<updated>2021-11-28T23:38:12Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Refactoring (Removing Hardcoded Values) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
#  The previous implementation takes the text area field in the view to fetch the review comment, but it’s not updated dynamically when the user types a comment. The user needs to save the form then go back to edit view and then request feedback.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
&lt;br /&gt;
=== UI Changes ===&lt;br /&gt;
We refactored the UI of the generated table showing the problem, suggestion, and sentiment of the review comment, by adding a tooltip for prompting the Question and its corresponding review comment in the table itself. &lt;br /&gt;
==== UI screenshots ====&lt;br /&gt;
[[File:Review_table.PNG|500px|thumb|center]]&lt;br /&gt;
[[File:Retry.PNG|400px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added a tooltip in front of every comment number, which on hovering shows the question for which the feedback is given as well as the review comment given for that question.&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Bug Fixes (Dynamic Feedback) ===&lt;br /&gt;
Previously, the implementation took into account the text area field because of which we need to save the form before getting the feedback. We changed the implementation so that users can type in a review comment and dynamically get feedback on it before saving.&lt;br /&gt;
[[File:Bug-fix-1.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - The global variable response_general was used to store the response, which was not needed as the Promise will return the response and we threw an error in case of rejection, which is handled makeRequest method&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Api refact.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing code duplication) ===&lt;br /&gt;
In the previous implementation, code was duplicated for handling different scenarios of fetching the review comment. The code was mostly the same with some conditions. We abstracted the functionality into a method that can be used at multiple places instead of duplicating the code. &lt;br /&gt;
&lt;br /&gt;
Also, the previous implementation was counting the number of rubric questions by parsing the DOM Structure, we refactored that logic as well.&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description  - The internal function create_comment_object is used for generating comment object according to question and class_name of DOM. This comment JSON is then used to pass to the API for fetching the predictions. &lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Create_comment_object.PNG|1200px|thumb|center]]&lt;br /&gt;
[[File:While_loo.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Error handling improvements ===&lt;br /&gt;
We introduced error handling by changing the “Loading…” text to “Request failed. Please try again.” if the API for generating feedback fails. Previously, this  case was not handled&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added try-catch blocks while making API call, and if the promise is rejected we catch the error and change the “Loading…” text at the bottom to “Request failed. Please try again.”&lt;br /&gt;
#Files changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Request_error.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:Request error 2.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (Removing Hardcoded Values) ===&lt;br /&gt;
In the previous implementation the api urls for each analysis and the tool tip description for the analysis were hardcoded into the files. We moved theses values out into the config file below and the values for each of the hardcoded analysis values can be accessed anywhere in the _response_analysis.html.erb file which handles the processing for the analysis. This allows any hardcoded analysis value to be found in one location along with making it easier to append other hardcoded values to each analysis. &lt;br /&gt;
&lt;br /&gt;
[[File:Config3 File.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing duplicate api values) ===&lt;br /&gt;
In the previous implementation each analysis in the _response_analysis.html.erb file had its own block of code for getting the response message, processing values and displaying it to the table. The issue was that many analysis had duplicate blocks of code for getting response message, processing data, and displaying data with only a few analysis requiring different getting, processing, and displaying methods. In the new implementation a for loop would loop through each analysis and would run a default block of code for getting, processing, and displaying data unless the analysis had its own unique getting, processing, and displaying methods where an if statement in the for loop would run the blocks of code for the given method.    &lt;br /&gt;
   &lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://www.youtube.com/watch?v=OYZvNVa3GZ8&amp;amp;feature=youtu.be (Youtube video for previous implementation)&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Config_File.PNG&amp;diff=141808</id>
		<title>File:Config File.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Config_File.PNG&amp;diff=141808"/>
		<updated>2021-11-28T23:37:13Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141807</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141807"/>
		<updated>2021-11-28T23:36:50Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
#  The previous implementation takes the text area field in the view to fetch the review comment, but it’s not updated dynamically when the user types a comment. The user needs to save the form then go back to edit view and then request feedback.&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation == &lt;br /&gt;
&lt;br /&gt;
=== UI Changes ===&lt;br /&gt;
We refactored the UI of the generated table showing the problem, suggestion, and sentiment of the review comment, by adding a tooltip for prompting the Question and its corresponding review comment in the table itself. &lt;br /&gt;
==== UI screenshots ====&lt;br /&gt;
[[File:Review_table.PNG|500px|thumb|center]]&lt;br /&gt;
[[File:Retry.PNG|400px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added a tooltip in front of every comment number, which on hovering shows the question for which the feedback is given as well as the review comment given for that question.&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
&lt;br /&gt;
=== Bug Fixes (Dynamic Feedback) ===&lt;br /&gt;
Previously, the implementation took into account the text area field because of which we need to save the form before getting the feedback. We changed the implementation so that users can type in a review comment and dynamically get feedback on it before saving.&lt;br /&gt;
[[File:Bug-fix-1.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - The global variable response_general was used to store the response, which was not needed as the Promise will return the response and we threw an error in case of rejection, which is handled makeRequest method&lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Api refact.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing code duplication) ===&lt;br /&gt;
In the previous implementation, code was duplicated for handling different scenarios of fetching the review comment. The code was mostly the same with some conditions. We abstracted the functionality into a method that can be used at multiple places instead of duplicating the code. &lt;br /&gt;
&lt;br /&gt;
Also, the previous implementation was counting the number of rubric questions by parsing the DOM Structure, we refactored that logic as well.&lt;br /&gt;
&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description  - The internal function create_comment_object is used for generating comment object according to question and class_name of DOM. This comment JSON is then used to pass to the API for fetching the predictions. &lt;br /&gt;
#File changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Create_comment_object.PNG|1200px|thumb|center]]&lt;br /&gt;
[[File:While_loo.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Error handling improvements ===&lt;br /&gt;
We introduced error handling by changing the “Loading…” text to “Request failed. Please try again.” if the API for generating feedback fails. Previously, this  case was not handled&lt;br /&gt;
==== Javascript implementation ====&lt;br /&gt;
#Description - We have added try-catch blocks while making API call, and if the promise is rejected we catch the error and change the “Loading…” text at the bottom to “Request failed. Please try again.”&lt;br /&gt;
#Files changed - app/views/response/_response_analysis.html.erb&lt;br /&gt;
[[File:Request_error.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:Request error 2.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (Removing Hardcoded Values) ===&lt;br /&gt;
In the previous implementation the api urls for each analysis and the tool tip description for the analysis were hardcoded into the files. We moved theses values out into the config file below and the values for each of the hardcoded analysis values can be accessed anywhere in the _response_analysis.html.erb file which handles the processing for the analysis. This allows any hardcoded analysis value to be found in one location along with making it easier to append other hardcoded values to each analysis. &lt;br /&gt;
&lt;br /&gt;
[[File:Config File.PNG|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Refactoring (removing duplicate api values) ===&lt;br /&gt;
In the previous implementation each analysis in the _response_analysis.html.erb file had its own block of code for getting the response message, processing values and displaying it to the table. The issue was that many analysis had duplicate blocks of code for getting response message, processing data, and displaying data with only a few analysis requiring different getting, processing, and displaying methods. In the new implementation a for loop would loop through each analysis and would run a default block of code for getting, processing, and displaying data unless the analysis had its own unique getting, processing, and displaying methods where an if statement in the for loop would run the blocks of code for the given method.    &lt;br /&gt;
   &lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://www.youtube.com/watch?v=OYZvNVa3GZ8&amp;amp;feature=youtu.be (Youtube video for previous implementation)&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141743</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=141743"/>
		<updated>2021-11-28T18:21:46Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Definition ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, students learn from the reviews they receive to improve their own performance. In order to make this happen, it would be good to have everyone give quality reviews instead of generic ones. Currently, Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services. We need to make the UI more intuitive by allowing users to view the feedback of specific review comments and the code needs to be refactored to remove redundancy to follow the DRY principle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Previous Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
The previous implementation added the following features:&lt;br /&gt;
# Setup a config file 'review_metric.yml' where the instructor can select what review metric to display for the current assignments&lt;br /&gt;
# API calls (sentiment, problem, suggestion) are made and a table is rendered below, displaying the feedback of the review comments.&lt;br /&gt;
# The total time taken by the API calls was also displayed.&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
The following image shows how a reviewer interacts with the system to get feedback on the review comments.&lt;br /&gt;
[[File:Steps_metric.png|1200px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Control Flow ===&lt;br /&gt;
&lt;br /&gt;
[[File:Review_metric.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Issues with Previous Work ==&lt;br /&gt;
&lt;br /&gt;
With the previous implementation of this project, students can write comments and request feedback for the comments. There are certain issues with the previous implementation that needs to be addressed.&lt;br /&gt;
&lt;br /&gt;
# The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment.&lt;br /&gt;
# Too much specific information on metrics is encoded into the text.  While some of the info is in configuration files, the help text for the info buttons is in the code.&lt;br /&gt;
# Currently there are many repetitive blocks of code. For Ex.; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution == &lt;br /&gt;
===  Refactoring ===&lt;br /&gt;
[[File:PreviousImplementation.jpeg|1000px|thumb| center | previous Implementation]]&lt;br /&gt;
# We need to improve the UI so that if there are many rubric items, users can easily check the feedback for each comment given to each rubric item. We propose the following  solution&lt;br /&gt;
## Each comment on hover shows the user's respective comment on the specific rubric review question so that the feedback is easily accessible.&lt;br /&gt;
### On click of the get review feedback button, we loop through the dynamically created review question form and store the mapping of questions and the reviewer's corresponding comments which on hovered are displayed as a popup.  &lt;br /&gt;
[[File:Proposedsolution.jpeg|1000px|thumb| center | LOFI Design of Proposed Solution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Another issue with the current implementation is that code is quite repetitive for making different API calls  (Sentiment, Suggestion, etc). We propose to store the API link in the config file and refer to the variable in the getReviewFeedback()&lt;br /&gt;
# We also plan to remove a global variable response_general, which is being used to store the response of API calls. We will refactor the makeRequest function to directly return the response which can be used in various places. This will resolve implicit coupling issues in the code and make it more easily extendable. &lt;br /&gt;
# The previous implementation has hardcoded configuration information like the help text button. We propose to save this information in config files which can be easily modified and will remove unnecessary information from the code.&lt;br /&gt;
&lt;br /&gt;
=== Possible files to be edited === &lt;br /&gt;
# review_metrics.yml&lt;br /&gt;
# response.html.erb&lt;br /&gt;
# _response_analysis.html.erb&lt;br /&gt;
# response_controller.rb&lt;br /&gt;
# response_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Sample API Input/Output ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
This project mainly addresses the UI issues and some code refactoring in views. Therefore, we will be focussing on view tests as all the automated tests have been previously implemented and new code won't affect those.&lt;br /&gt;
&lt;br /&gt;
===View Tests(Manual)===&lt;br /&gt;
&lt;br /&gt;
#The functionality was written on the client side in javascript solely in _response_analysis.html.erb&lt;br /&gt;
#To test this view, any type of review must be accessible as a student.&lt;br /&gt;
#There is a button at the bottom of the review called 'Get Review Feedback'.&lt;br /&gt;
#When pressing button, API calls are issued and the metrics will show up within the table (a sample of which is shown in above screenshot).&lt;br /&gt;
#As API calls will take time, 'Loading..' text will appear until the API calls are complete&lt;br /&gt;
#All the review feedback for the comments will be displayed in a colorful table.&lt;br /&gt;
#In the feedback table, upon hovering on the comment number, we will be able to see the rubric item and review comments associated with that particular rubric item&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
# https://docs.google.com/document/d/1slx4HPIbgTH-psIKMSCF-HDF9brxf-FuYhzVT9ZiIrM/edit#heading=h.fxfungdw1d5r&lt;br /&gt;
# https://github.com/expertiza/expertiza/pull/1952 (Previous implementation pull request)&lt;br /&gt;
# https://www.youtube.com/watch?v=OYZvNVa3GZ8&amp;amp;feature=youtu.be (Youtube video for previous implementation)&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire (glbrook2)&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi (ddoshi2)&lt;br /&gt;
&lt;br /&gt;
* Srujan Ponnur (sponnur)&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140460</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140460"/>
		<updated>2021-11-02T21:09:14Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time students learn from the reviews they receive to improve their own performance. In order to make this happen,it would be good to have everyone give quality reviews instead of generic ones. Currently Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
There are Several tasks that we are looking to address by the end of the project which are seen below: &lt;br /&gt;
&lt;br /&gt;
# When a student submits a review (in the response_controller), we would like to call this web service with the student’s review as the input. We would then want to tell the student whether their reviews contain suggestions or not, so they can make improvements based on the results of the webservice. &lt;br /&gt;
#* The response_controller should pass a text string (the comments field of each Answer object) to the web service.&lt;br /&gt;
#* In fact, the response_controller could pass this string to a whole set of metrics (volume, sentiment, problem detection, suggestion counter).&lt;br /&gt;
# We would also like to evaluate how much time this API is taking and if possible work a way out to improve it. We don’t want the system to be terribly slow.&lt;br /&gt;
# We also have a web service for problem detection.  That should be integrated too.&lt;br /&gt;
&lt;br /&gt;
== Issues to be Addressed ==&lt;br /&gt;
# Update how current implementation gets data from the web service.&lt;br /&gt;
#* Yulin's code calls another module that grabs the data from web services in bulk, and divvies it out one item at a time.&lt;br /&gt;
#* How would you call it to get suggestion confidence and problem-detection confidence level, etc.?&lt;br /&gt;
# Reading a data structure that tells which metrics we are interested in now, and therefore which need to be shown in the view.&lt;br /&gt;
#* For example, the data structure may say, For this assignment, we are interested in &lt;br /&gt;
#** problem detection&lt;br /&gt;
#** suggestions, and&lt;br /&gt;
#** sentiment analysis.&lt;br /&gt;
#* For another assignment, it might be&lt;br /&gt;
#** localization and&lt;br /&gt;
#** helpfulness&lt;br /&gt;
#Displaying the information in an appropriate view.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comments on Prior Teams Implementation ==&lt;br /&gt;
* The criteria are numbered in the view, and those numbers do not correspond to anything on the rubric form.  &lt;br /&gt;
** So if the rubric is long, it would be quite difficult for the reviewer to figure out what automated feedback referred to which comment&lt;br /&gt;
* There is too much specific information on metrics that is encoded into the text.&lt;br /&gt;
** While some of the info is in configuration files, the help text for the info buttons is in the code.  Also, calls for each metric are programmed into the code, though, depending on how diverse they are, this is perhaps unavoidable&lt;br /&gt;
* The code can be more modularized. &lt;br /&gt;
** Currently there are many repetitive blocks of code. For ex; in _response_analysis.html for the getReviewFeedback(), the API call for each type of tag (sentiment, suggestion, etc) is being repeated. Only the API link differs there. So it might be more beneficial to store the API link in the config file and use the variable in the function&lt;br /&gt;
&lt;br /&gt;
== API Endpoints==&lt;br /&gt;
* https://peer-reviews-nlp.herokuapp.com/all for all metrics at once&lt;br /&gt;
* https://peer-reviews-nlp.herokuapp.com/volume for volume metrics only&lt;br /&gt;
* https://peer-reviews-nlp.herokuapp.com/sentiment for sentiment metrics only&lt;br /&gt;
* https://peer-reviews-nlp.herokuapp.com/suggestions for suggestions metrics only&lt;br /&gt;
&lt;br /&gt;
== JSON Formatting ==&lt;br /&gt;
* Input Text is passed in the following JSON format&lt;br /&gt;
  { &lt;br /&gt;
      &amp;quot;text&amp;quot; : &amp;quot;This is an excellent project. Keep up the great work&amp;quot; &lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
* Output is returned in the following JSON format:&lt;br /&gt;
  {          &lt;br /&gt;
      &amp;quot;sentiment_score&amp;quot;: 0.9,&lt;br /&gt;
      &amp;quot;sentiment_tone&amp;quot;: &amp;quot;Positive&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions&amp;quot;: &amp;quot;absent&amp;quot;,&lt;br /&gt;
      &amp;quot;suggestions_chances&amp;quot;: 10.17,&lt;br /&gt;
      &amp;quot;text&amp;quot;: &amp;quot;This is an excellent project. Keep up the great work&amp;quot;,&lt;br /&gt;
      &amp;quot;total_volume&amp;quot;: 10,&lt;br /&gt;
      &amp;quot;volume_without_stopwords&amp;quot;: 6&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire ()&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi ()&lt;br /&gt;
&lt;br /&gt;
* Srujan ()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
* https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Spring_2021_-_E2112._Integrate_Suggestion_Detection_Algorithm&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1952&lt;br /&gt;
* https://github.com/harshkachhadia/expertiza/tree/beta&lt;br /&gt;
* https://youtu.be/OYZvNVa3GZ8&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140448</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140448"/>
		<updated>2021-11-02T20:47:55Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time students learn from the reviews they receive to improve their own performance. In order to make this happen,it would be good to have everyone give quality reviews instead of generic ones. Currently Expertiza has a few classifiers that can detect useful features of review comments, such as whether they contain suggestions. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms, such as problem detection and sentiment analysis, also exist as newer web services.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
There are Several tasks that we are looking to address by the end of the project which are seen below: &lt;br /&gt;
&lt;br /&gt;
# When a student submits a review (in the response_controller), we would like to call this web service with the student’s review as the input. We would then want to tell the student whether their reviews contain suggestions or not, so they can make improvements based on the results of the webservice. &lt;br /&gt;
#* The response_controller should pass a text string (the comments field of each Answer object) to the web service.&lt;br /&gt;
#* In fact, the response_controller could pass this string to a whole set of metrics (volume, sentiment, problem detection, suggestion counter).&lt;br /&gt;
# We would also like to evaluate how much time this API is taking and if possible work a way out to improve it. We don’t want the system to be terribly slow.&lt;br /&gt;
# We also have a web service for problem detection.  That should be integrated too.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
&lt;br /&gt;
* Prashan Sengo (psengo)&lt;br /&gt;
&lt;br /&gt;
* Griffin Brookshire ()&lt;br /&gt;
&lt;br /&gt;
* Divyang Doshi ()&lt;br /&gt;
&lt;br /&gt;
* Srujan ()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Relevant Links ===&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=140445</id>
		<title>CSC/ECE 517 Fall 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=140445"/>
		<updated>2021-11-02T20:27:22Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Final Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2117. Refactor questionaires_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2128. Refactor student_quizzes_controller.rb &amp;amp; late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2129. Refactor auth_controller.rb &amp;amp; password_retrieval_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2132. Add tests cases for review mapping helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2134. Write unit tests for admin_controller.rb and institution_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2138. Auto-generate submission directory names based on assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2142. Improve e-mail notifications]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2133. Write tests for popup_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2120. Refactor reputation_web_service_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2139. Remove multiple topics at a time]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2131. Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2121. Refactor suggestion_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2122. Refactor impersonate_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2123. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2126. Refactor account_request_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2124. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2125. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2127. Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2130. Refactor submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2140. Create new late policy successfully and fix Bank link]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp;amp; Institutions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2144. Refactor delayed mailer and scheduled task]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2147. Role-based reviewing]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2146. Introduce a Student View for instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - Refactor Evaluation of SQL Queries]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2135. Email notification to reviewers and instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2168. Testing - Reputations]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2166. Testing - Scoring &amp;amp; Grades]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm#Description_about_project CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool#Description_about_project CSC/ECE 517 Fall 2021 - E2152. Revision_planning_tool]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2170._Testing_-_Response_Maps#Description_about_project CSC/ECE 517 Fall 2021 - E2170. Testing - Response Maps]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza#Description_about_project CSC/ECE 517 Fall 2021 - E2153. Improving search facility in Expertiza]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper CSC/ECE 517 Fall 2021 - E2162. Further refactoring and improvement of review mapping helper]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2165._Fix_teammate-review_view CSC/ECE 517 Fall 2021 - E2165. Fix teammate review view ]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail CSC/ECE 517 Fall 2021 - E2158. Grading audit trail ]&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140443</id>
		<title>CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm&amp;diff=140443"/>
		<updated>2021-11-02T20:24:48Z</updated>

		<summary type="html">&lt;p&gt;Psengo: Created page with &amp;quot;To be created...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To be created...&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139429</id>
		<title>CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139429"/>
		<updated>2021-10-20T18:22:26Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== E2141. OSS project Finklestein: Instructors &amp;amp; Institutions ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E2141 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/psengo7/expertiza.git]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E2141 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The original issue was that when an admin tries to create a new instructor with a new institution a &amp;quot;No method error in Users#Create&amp;quot; occurs. However when running the program a different issue was seen below...&lt;br /&gt;
&lt;br /&gt;
    [[File:task2_issue.png]]&lt;br /&gt;
&lt;br /&gt;
To resolve this the following lines were commented out in the following files : &lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''122'''''&amp;lt;/font&amp;gt;  if @user.save&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;    password = @user.reset_password &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''124'''''   #  prepared_mail = MailerHelper.send_mail_to_user(@user, &amp;quot;Your Expertiza account and password have been created.&amp;quot;, &amp;quot;user_welcome&amp;quot;, password)&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''125'''''    # prepared_mail.deliver&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''126'''''&amp;lt;/font&amp;gt;    flash[:success] = &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''149'''''&amp;lt;/font&amp;gt;  # Function which has a MailerHelper which sends the mail welcome email to the user after signing up&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''150'''''&amp;lt;/font&amp;gt;  def email_welcome &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''151'''''&amp;lt;/font&amp;gt;    # #this will send an account creation notification to user via email.&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''152'''''    # MailerHelper.send_mail_to_user(self, &amp;quot;Your Expertiza account and password has been created&amp;quot;, &amp;quot;user_welcome&amp;quot;, password).deliver_now prepared_mail.deliver&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''153'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
This resolved the issues of being able to add an instructor with a newly created institution as seen in the images below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [[File:Success_task2_part1.png]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Success_task2_part2.png]]&lt;br /&gt;
&lt;br /&gt;
However due to the fact that commenting out the MailHelper could result in cascading issues in other parts of the project we decided that the best action would be to not make changes and notify the mentors of this issue until a proper resolution could be made.&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
 We tested if the Institution column was on the page&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.17.133:8080/ Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team:'''&lt;br /&gt;
  Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
  psengo (psengo@ncsu.edu)&lt;br /&gt;
  kyao (kyao@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Yunkai Xiao (yxiao28@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139428</id>
		<title>CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139428"/>
		<updated>2021-10-20T18:21:13Z</updated>

		<summary type="html">&lt;p&gt;Psengo: /* Task2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== E2141. OSS project Finklestein: Instructors &amp;amp; Institutions ==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open-source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows instructors to manager courses and assignments for students. Students can form up teams in Expertiza to work on different projects and assignments and do peer review about other students' submissions. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
 &lt;br /&gt;
* E2141 Project aims to fix the associations problems between the Institution and Instructor class.&lt;br /&gt;
&lt;br /&gt;
* The forked git repository for this project can be found [https://github.com/psengo7/expertiza.git]&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
The following tasks were accomplished in E2141 project:&lt;br /&gt;
&lt;br /&gt;
* Task1: The institution list should be sorted alphabetically.&lt;br /&gt;
** Details: When creating a course, the drop-down list for selecting the institution does not show in alphabetical order.&lt;br /&gt;
  [[File:E1971-Task1.png]]&lt;br /&gt;
&lt;br /&gt;
* Task2: Adding a new institution during creation of an instructor profile.&lt;br /&gt;
** Details: The admin can attempt to create a new institution when creating a new instructor. But, after one types in the name of the institution &amp;amp; clicks create, it crashes.&lt;br /&gt;
  [[File:E1971-Task2.png]]&lt;br /&gt;
&lt;br /&gt;
* Task3: Listing of instructors should show their institutions on the same line as their new feature.&lt;br /&gt;
** Details: When listing users, there is currently no column to display the user’s associated institution.&lt;br /&gt;
  [[File:E1971-Task3.png]]&lt;br /&gt;
&lt;br /&gt;
====Task1====&lt;br /&gt;
As the issue is the Institution drop-down list is not alphabetically sorted. We simply added a step of sort when the Institution list was retrieved from the Database.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;_course.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''line3'''''&amp;lt;/font&amp;gt; &amp;lt;%= select(&amp;quot;course&amp;quot;, &amp;quot;institutions_id&amp;quot;, Institution.all&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;.order(:name)&amp;lt;/font&amp;gt;.collect{ |c| [ c.name, c.id] }) %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task2====&lt;br /&gt;
The original issue was that when an admin tries to create a new instructor with a new institution a &amp;quot;No method error in Users#Create&amp;quot; occurs. However when running the program a different issue was seen below...&lt;br /&gt;
&lt;br /&gt;
    [[File:task2_issue.png]]&lt;br /&gt;
&lt;br /&gt;
To resolve this the following lines were commented out in the following files : &lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/controllers/users_controller.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''122'''''&amp;lt;/font&amp;gt;  if @user.save&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''123'''''&amp;lt;/font&amp;gt;    password = @user.reset_password &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''124'''''&amp;lt;/font&amp;gt;    # prepared_mail = MailerHelper.send_mail_to_user(@user, &amp;quot;Your Expertiza account and password have been created.&amp;quot;, &amp;quot;user_welcome&amp;quot;, password)&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''125'''''    # prepared_mail.deliver&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''126'''''&amp;lt;/font&amp;gt;    flash[:success] = &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''149'''''&amp;lt;/font&amp;gt;  # Function which has a MailerHelper which sends the mail welcome email to the user after signing up&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''150'''''&amp;lt;/font&amp;gt;  def email_welcome &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''151'''''&amp;lt;/font&amp;gt;    # #this will send an account creation notification to user via email.&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''152'''''    # MailerHelper.send_mail_to_user(self, &amp;quot;Your Expertiza account and password has been created&amp;quot;, &amp;quot;user_welcome&amp;quot;, password).deliver_now prepared_mail.deliver&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''153'''''&amp;lt;/font&amp;gt;  end&lt;br /&gt;
&lt;br /&gt;
This resolved the issues of being able to add an instructor with a newly created institution as seen in the images below&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    [[File:Success_task2_part1.png]]&lt;br /&gt;
&lt;br /&gt;
    [[File:Success_task2_part2.png]]&lt;br /&gt;
&lt;br /&gt;
However due to the fact that commenting out the MailHelper could result in cascading issues in other parts of the project we decided that the best action would be to not make changes and notify the mentors of this issue until a proper resolution could be made.&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
The issue is that the user page is not displaying the user's associated institution. To fix this issue, we added an 'institution' column in the HTML file retrieving the institution names of each user.&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/models/user.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''111'''''  def institution(ip_address = nil)&lt;br /&gt;
 '''''112'''''    if User.anonymized_view?(ip_address)&lt;br /&gt;
 '''''113'''''      self.role.name + ', ' + self.id.to_s&lt;br /&gt;
 '''''114'''''    else&lt;br /&gt;
 '''''115'''''      if self[:role_id] == 2&lt;br /&gt;
 '''''116'''''        self[:institution_id].nil? ? &amp;quot;&amp;quot; : Institution.find(self[:institution_id]).name&lt;br /&gt;
 '''''117'''''      end&lt;br /&gt;
 '''''118'''''    end&lt;br /&gt;
 '''''119'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;app/views/users/list.html.erb&amp;lt;/font&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''20'''''&amp;lt;/font&amp;gt;  &amp;lt;tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''21'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''22'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Full Name&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''23'''''      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Institution&amp;lt;/th&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''24'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Email Address&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''25'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Role&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''26'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Parent&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''27'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Review&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''28'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Submission&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''29'''''&amp;lt;/font&amp;gt;      &amp;lt;th class=&amp;quot;head&amp;quot;&amp;gt;Metareview&amp;lt;/th&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''30'''''&amp;lt;/font&amp;gt;  &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''31'''''&amp;lt;/font&amp;gt;  &amp;lt;% for user in @users %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''32'''''&amp;lt;/font&amp;gt;    &amp;lt;% if ((params[:show] != 'true' &amp;amp;&amp;amp; !user.name(session[:ip]).include?(&amp;quot;_hidden&amp;quot;)) || params[:show] == 'true')%&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''33'''''&amp;lt;/font&amp;gt;      &amp;lt;tr class=&amp;quot;exp&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''34'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user =&amp;gt; {:name =&amp;gt; user.name(session[:ip])}), :method =&amp;gt; :post %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''35'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.fullname(session[:ip]), :controller=&amp;gt; 'users', :action =&amp;gt; 'show', :id =&amp;gt; user.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''36'''''        &amp;lt;td&amp;gt;&amp;lt;%= user.institution(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/font&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''37'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= user.email(session[:ip]) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''38'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= link_to user.role.name, :controller =&amp;gt; 'roles', :action =&amp;gt; 'show', :id =&amp;gt; user.role.id %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''39'''''&amp;lt;/font&amp;gt;        &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;%= user.parent.try :name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''40'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''41'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_submission) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''42'''''&amp;lt;/font&amp;gt;        &amp;lt;td&amp;gt;&amp;lt;%= User.yesorno(user.email_on_review_of_review) %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''43'''''&amp;lt;/font&amp;gt;      &amp;lt;/tr&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''44'''''&amp;lt;/font&amp;gt;    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;font color=&amp;quot;grey&amp;quot;&amp;gt;'''''45'''''&amp;lt;/font&amp;gt;  &amp;lt;% end -%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Task Demonstration==&lt;br /&gt;
====Task1====&lt;br /&gt;
 [[File:Task1-new.png]]&lt;br /&gt;
====Task2====&lt;br /&gt;
 [[File:Task2-new.png]]&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
====Task3====&lt;br /&gt;
 [[File:Task2-2-new.png]]&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
====Test for Task1====&lt;br /&gt;
We created 4 institutions and check if they are alphabetically sorted in the selection box&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/features/course_creation_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''13'''''  it &amp;quot;check if the courses are sorted alphabetically&amp;quot; do&lt;br /&gt;
  '''''14'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''15'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''16'''''    visit &amp;quot;/course/new?private=1&amp;quot;&lt;br /&gt;
  '''''17'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[1]&amp;quot;).text).to eq(&amp;quot;A&amp;quot;)&lt;br /&gt;
  '''''18'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[2]&amp;quot;).text).to eq(&amp;quot;B&amp;quot;)&lt;br /&gt;
  '''''19'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[3]&amp;quot;).text).to eq(&amp;quot;C&amp;quot;)&lt;br /&gt;
  '''''20'''''    expect(page.find(:xpath, &amp;quot;//*[@id=\&amp;quot;course_institutions_id\&amp;quot;]/option[4]&amp;quot;).text).to eq(&amp;quot;D&amp;quot;)&lt;br /&gt;
  '''''21'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Test for Task2====&lt;br /&gt;
 We tried to create a new instructor6 with a new institution name&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''233'''''  it 'save successfully with a new institution' do&lt;br /&gt;
  '''''234'''''    session = {user: admin}&lt;br /&gt;
  '''''235'''''    params = {&lt;br /&gt;
  '''''236'''''      user: {name: 'instructor6',&lt;br /&gt;
  '''''237'''''             crypted_password: 'password',&lt;br /&gt;
  '''''238'''''             role_id: 2,&lt;br /&gt;
  '''''239'''''             password_salt: 1,&lt;br /&gt;
  '''''240'''''             fullname: '6, instructor',&lt;br /&gt;
  '''''241'''''             email: 'yzhu48@ncsu.edu',&lt;br /&gt;
  '''''242'''''             parent_id: 1,&lt;br /&gt;
  '''''243'''''             private_by_default: false,&lt;br /&gt;
  '''''244'''''             mru_directory_path: nil,&lt;br /&gt;
  '''''245'''''             email_on_review: true,&lt;br /&gt;
  '''''246'''''             email_on_submission: true,&lt;br /&gt;
  '''''247'''''             email_on_review_of_review: true,&lt;br /&gt;
  '''''248'''''             is_new_user: false,&lt;br /&gt;
  '''''249'''''             master_permission_granted: 0,&lt;br /&gt;
  '''''250'''''             handle: 'handle',&lt;br /&gt;
  '''''251'''''             digital_certificate: nil,&lt;br /&gt;
  '''''252'''''             timezonepref: 'Eastern Time (US &amp;amp; Canada)',&lt;br /&gt;
  '''''253'''''             public_key: nil,&lt;br /&gt;
  '''''254'''''             copy_of_emails: nil,&lt;br /&gt;
  '''''255'''''             institution_id: 666,&lt;br /&gt;
  '''''256'''''             institution: {&lt;br /&gt;
  '''''257'''''                 name: 'yzhu48'&lt;br /&gt;
  '''''258'''''             }&lt;br /&gt;
  '''''259'''''       }&lt;br /&gt;
  '''''260'''''    }  &lt;br /&gt;
  '''''261'''''    post :create, params, session&lt;br /&gt;
  '''''262'''''    allow_any_instance_of(User).to receive(:undo_link).with('The user &amp;quot;instructor6&amp;quot; has been successfully created. ').and_return(true)&lt;br /&gt;
  '''''263'''''    expect(flash[:success]).to eq &amp;quot;A new password has been sent to new user's e-mail address.&amp;quot;&lt;br /&gt;
  '''''264'''''    expect(response).to redirect_to('http://test.host/users/list')&lt;br /&gt;
  '''''265'''''  end&lt;br /&gt;
&lt;br /&gt;
====Test for Task3====&lt;br /&gt;
 We tested if the Institution column was on the page&lt;br /&gt;
  '''Changed files:''' &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;spec/controllers/users_controller_spec.rb&amp;lt;/font&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
  &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;'''''18'''''  it &amp;quot;check if instructors show their institutions on the same line as their new feature&amp;quot; do&lt;br /&gt;
  '''''19'''''    create(:superadmin, name: 'super_administrator2')&lt;br /&gt;
  '''''20'''''    login_as('super_administrator2')&lt;br /&gt;
  '''''21'''''    visit &amp;quot;/users/list&amp;quot;&lt;br /&gt;
  '''''22'''''    expect(page.has_content?(&amp;quot;Institution&amp;quot;)).to eq(true)&lt;br /&gt;
  '''''23'''''  end&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Process Video==&lt;br /&gt;
 Video Demonstration for Testing Task1: [https://youtu.be/FXQu1fcbM20 Task1-Video]&lt;br /&gt;
 Video Demonstration for Testing Task2: [https://youtu.be/3BIsI2UpNRo Task2-Video]&lt;br /&gt;
 Video Demonstration for Testing Task3: [https://youtu.be/ZmLfvYLmLTo Task3-Video]&lt;br /&gt;
&lt;br /&gt;
==Project Deployment==&lt;br /&gt;
[http://152.46.17.133:8080/ Expertiza_Team_4430]&lt;br /&gt;
&lt;br /&gt;
==Team Information==&lt;br /&gt;
  '''Team:'''&lt;br /&gt;
  Kai Gao (kgao2@ncsu.edu)&lt;br /&gt;
  psengo (psengo@ncsu.edu)&lt;br /&gt;
  kyao (kyao@ncsu.edu)&lt;br /&gt;
  '''Mentor:''' Yunkai Xiao (yxiao28@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza website]&lt;br /&gt;
&lt;br /&gt;
[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/YongjianZhu/expertiza GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Success_task2_part2.png&amp;diff=139427</id>
		<title>File:Success task2 part2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Success_task2_part2.png&amp;diff=139427"/>
		<updated>2021-10-20T18:19:27Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Success_task2_part1.png&amp;diff=139426</id>
		<title>File:Success task2 part1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Success_task2_part1.png&amp;diff=139426"/>
		<updated>2021-10-20T18:18:04Z</updated>

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139425</id>
		<title>CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139425"/>
		<updated>2021-10-20T18:17:30Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Psengo: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Psengo</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139414</id>
		<title>CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp; Institutions</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2141._OSS_project_Finklestein:_Instructors_%26_Institutions&amp;diff=139414"/>
		<updated>2021-10-20T17:28:58Z</updated>

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

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

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