<?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=Pjain22</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=Pjain22"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pjain22"/>
	<updated>2026-06-07T22:54:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124624</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1937. Integrate suggestion detection algorithm.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124624"/>
		<updated>2019-04-27T01:34:11Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Dr. Gehringer (mentor)&lt;br /&gt;
* Sushan Basnet (sbasnet2)&lt;br /&gt;
* Jasmine Wang (jfwang2)&lt;br /&gt;
* Bill Mwaniki (bnmwanik)&lt;br /&gt;
* Pratik Kumar Kundanmal Jain (pjain22)&lt;br /&gt;
&lt;br /&gt;
==Project plan==&lt;br /&gt;
===Problem statement===&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, we hope students learn from the reviews they receive to improve their own performance. In order to make this happen, we would like to have everyone give quality reviews instead of generic ones. Currently we have a few classifiers that can detect useful features of review comments, such as how many suggestions they contain. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms will be so coded in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How it will work===&lt;br /&gt;
&lt;br /&gt;
In order to make the API call, the response_controller.rb will be responsible for sending a JSON input to the web service. The input will contain the review comment submitted by the user in the following format: &lt;br /&gt;
&lt;br /&gt;
Below is a sample input &lt;br /&gt;
  Sample Input:&lt;br /&gt;
  {&lt;br /&gt;
  	&amp;quot;reviews&amp;quot;:[{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;review text here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;,&amp;quot;suggestion&amp;quot;,&amp;quot;sentiment&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;another review here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;more text, maybe a large para or whatever you like&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;sentiment&amp;quot;, &amp;quot;suggestion&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		...&lt;br /&gt;
  	}]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Once the request is send, we expect the output to be in the following format:&lt;br /&gt;
&lt;br /&gt;
 Sample Output: (as 'suggestion' and 'volume' as you might expect)&lt;br /&gt;
 {&lt;br /&gt;
 	&amp;quot;metrics&amp;quot;:[{&lt;br /&gt;
 		&amp;quot;suggestion&amp;quot;:{&lt;br /&gt;
 			&amp;quot;suggestions_chances&amp;quot;:30,&lt;br /&gt;
 			&amp;quot;suggestions&amp;quot;:&amp;quot;absent&amp;quot;&lt;br /&gt;
 		},&lt;br /&gt;
 		&amp;quot;volume&amp;quot;:{&lt;br /&gt;
 			&amp;quot;total_volume&amp;quot;:10,&lt;br /&gt;
 			&amp;quot;volume_without_stopwords&amp;quot;:3&lt;br /&gt;
 		}&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	}]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The output (which is a JSON) will be parsed and the suggestion metrics such as the tone and presence of suggestion will be extracted so the user will be able to view a summarized result of how well their review comments were. In addition, an average score will be computed based on the scores they received for each comment section, and the result will be presented in a colorful format to the user after they hit the submit button.&lt;br /&gt;
&lt;br /&gt;
===Previous work===&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1308 Fall 2018 pull request]&lt;br /&gt;
* They had a functional suggestion detection API call that successfully communicated with the PeerLogic Server and retrieved the output. &lt;br /&gt;
* They included their API call in response.html.erb using JavaScript.&lt;br /&gt;
* They were able to display the output for each review beside the review. They displayed all of the information returned from the endpoint, which can look clunky.&lt;br /&gt;
* Since the code is added in the views, they performed manual testing in the views.&lt;br /&gt;
&lt;br /&gt;
More information about the suggestion detection service can be found at https://www.peerlogic.org&lt;br /&gt;
&lt;br /&gt;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart to Describe Plan of Action ===&lt;br /&gt;
&lt;br /&gt;
[[FIle:x.png]]&lt;br /&gt;
&lt;br /&gt;
== Changes Made ==&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default review view from displaying analysis for each comment to summarized analysis for all comments&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, suggestions, suggestions_chances returned from API&lt;br /&gt;
* Include displaying analysis for each review as a &amp;quot;debug&amp;quot; option&lt;br /&gt;
* Ensure that CORS does not need to be enabled for API call to work&lt;br /&gt;
* Write unit tests for our method(s) in response_controller.rb&lt;br /&gt;
* Fix grammar issues in response.html.erb&lt;br /&gt;
* Evaluate how much time this API is taking and, if possible, work a way out to improve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that we changed ===&lt;br /&gt;
* '''app/views/response/response.html.erb''' -  Refactored and reworked JS methods for the autosave and form submits, added a new hidden button to the response form &lt;br /&gt;
* '''app/controllers/response_controller.rb''' - Refactored and reworked methods for the autosave and form submits, added an API method to pass to view&lt;br /&gt;
* app/helpers/review_mapping_helper.rb - Adjusted the bar thickness according to desired specifications&lt;br /&gt;
* config/routes.rb - Added another route to support the new review confirmation page listed below&lt;br /&gt;
&lt;br /&gt;
=== New files we added ===&lt;br /&gt;
* '''app/models/metric.rb'''  - New ActiveRecord model added to act as a template for future API usage&lt;br /&gt;
* '''db/migrate/20190425194052_create_metrics.rb''' - New table added for permanent storage of the Metric class&lt;br /&gt;
* '''app/views/response/show_confirmation_page.erb - The new page added for review confirmation&lt;br /&gt;
* '''test/fixtures/metrics.yml''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''test/models/metric_test.rb''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''app/assets/images/lightbulb.png''' - Lightbulb picture for the new review confirmation page&lt;br /&gt;
* '''app/assets/images/music_note.png''' - A music note picture for the new review confirmation page&lt;br /&gt;
&lt;br /&gt;
==== Response Controller ====&lt;br /&gt;
Lines 359 and 360 are where we will retrieve the input from each review comment found in the form.&lt;br /&gt;
* The '''Answer''' model represents the review provided by the reviewer.&lt;br /&gt;
* On line 360, answer: v[:score] is the review comment from a given textarea HTML element&lt;br /&gt;
* params[:responses] stores the aggregate review data provided by the user&lt;br /&gt;
&lt;br /&gt;
[[File:create_answers.png]]&lt;br /&gt;
&lt;br /&gt;
=== Confirmation Page View ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Student View=====&lt;br /&gt;
The program flow is as follows:&lt;br /&gt;
&lt;br /&gt;
# After the reviewer has filled out their review, they have 2 choices: See an analysis of their review or Save the review.&lt;br /&gt;
# The reviewer selects to view their analysis by clicking on &amp;quot;Confirm Submission&amp;quot; button&lt;br /&gt;
# The program directs the reviewer to the new confirmation page which displays an analysis of their review.&lt;br /&gt;
# The reviewer has 2 options in the confirmation page: Submit the review or go back and modify their review.&lt;br /&gt;
# If the reviewer decides to Submit their review, the program directs them back to where they started (Create or edit review).&lt;br /&gt;
&lt;br /&gt;
The image below shows the above steps in a visual depiction.&lt;br /&gt;
[[File:program_flow.png]]&lt;br /&gt;
&lt;br /&gt;
==== Detailed Popup Information ====&lt;br /&gt;
Below we showcase the available information from the API if a reviewer is curious to find more details&lt;br /&gt;
&lt;br /&gt;
[[File:review_response_w_popup_1.png]]&lt;br /&gt;
[[File:review_response_w_popup_2.png]]&lt;br /&gt;
[[File:review_response_w_popup_3.png]]&lt;br /&gt;
&lt;br /&gt;
==== Conditional Formatting ====&lt;br /&gt;
To make the interface more user-friendly, we used conditional formatting to color our text. For the suggestions metrics, anything &amp;gt;50% means suggestions are present while anything &amp;lt;50% means suggestions are absent. Our conditional formatting is set so &amp;quot;Yes (&amp;gt;50%)&amp;quot; is green, 50% is yellow, and &amp;quot;No (&amp;lt;50%)&amp;quot; is red. The formatting is the same for the class average of suggestions metrics.&lt;br /&gt;
&lt;br /&gt;
For tone, there are three options in the API: positive, neutral, and negative. We created conditional formatting in our view file so positive is green text, neutral is yellow text, and negative is red text.&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
&lt;br /&gt;
=== Travis CI ===&lt;br /&gt;
Since we changed the controller and UI in our project to add the redirect view, the current Travis CI test build is failing.&lt;br /&gt;
* For TESTFOLDER=features, in the response.hmtl.erb view, we changed the submit button text from &amp;quot;Submit&amp;quot; to &amp;quot;Confirm Submission&amp;quot; in order to accurately reflect the new redirect page.&lt;br /&gt;
* For TESTFOLDER=controllers, we modified the save method inside response_controller.rb to redirect according to logic defined above.&lt;br /&gt;
&lt;br /&gt;
=== Tests ===&lt;br /&gt;
* We tested the new model added i.e. Metric model in metric.rb.&lt;br /&gt;
* The RSpec file is added to the rspec/models folder with the name metric_spec.rb.&lt;br /&gt;
* The testing tests the calculation of the average of suggestions chances from each response for a particular assignment.&lt;br /&gt;
* This also tests the output text of the sentiment that is received based on an input numerical value.&lt;br /&gt;
&lt;br /&gt;
=== View Tests ===&lt;br /&gt;
We have...&lt;br /&gt;
* Manually tested response.html.erb to verify the Review page outputs the correct message&lt;br /&gt;
* Provided sample inputs and shown expected outputs using screenshots&lt;br /&gt;
&lt;br /&gt;
==Links to our work==&lt;br /&gt;
* [https://github.com/pratikkumar-jain/expertiza/tree/beta Our repository]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1427 Pull request]&lt;br /&gt;
* [https://www.youtube.com/watch?time_continue=1&amp;amp;v=FjHAODvHtk4 YouTube Video]&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124623</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1937. Integrate suggestion detection algorithm.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124623"/>
		<updated>2019-04-27T01:33:46Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Dr. Gehringer (mentor)&lt;br /&gt;
* Sushan Basnet (sbasnet2)&lt;br /&gt;
* Jasmine Wang (jfwang2)&lt;br /&gt;
* Bill Mwaniki (bnmwanik)&lt;br /&gt;
* Pratik Kumar Kundanmal Jain (pjain22)&lt;br /&gt;
&lt;br /&gt;
==Project plan==&lt;br /&gt;
===Problem statement===&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, we hope students learn from the reviews they receive to improve their own performance. In order to make this happen, we would like to have everyone give quality reviews instead of generic ones. Currently we have a few classifiers that can detect useful features of review comments, such as how many suggestions they contain. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms will be so coded in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How it will work===&lt;br /&gt;
&lt;br /&gt;
In order to make the API call, the response_controller.rb will be responsible for sending a JSON input to the web service. The input will contain the review comment submitted by the user in the following format: &lt;br /&gt;
&lt;br /&gt;
Below is a sample input &lt;br /&gt;
  Sample Input:&lt;br /&gt;
  {&lt;br /&gt;
  	&amp;quot;reviews&amp;quot;:[{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;review text here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;,&amp;quot;suggestion&amp;quot;,&amp;quot;sentiment&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;another review here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;more text, maybe a large para or whatever you like&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;sentiment&amp;quot;, &amp;quot;suggestion&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		...&lt;br /&gt;
  	}]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Once the request is send, we expect the output to be in the following format:&lt;br /&gt;
&lt;br /&gt;
 Sample Output: (as 'suggestion' and 'volume' as you might expect)&lt;br /&gt;
 {&lt;br /&gt;
 	&amp;quot;metrics&amp;quot;:[{&lt;br /&gt;
 		&amp;quot;suggestion&amp;quot;:{&lt;br /&gt;
 			&amp;quot;suggestions_chances&amp;quot;:30,&lt;br /&gt;
 			&amp;quot;suggestions&amp;quot;:&amp;quot;absent&amp;quot;&lt;br /&gt;
 		},&lt;br /&gt;
 		&amp;quot;volume&amp;quot;:{&lt;br /&gt;
 			&amp;quot;total_volume&amp;quot;:10,&lt;br /&gt;
 			&amp;quot;volume_without_stopwords&amp;quot;:3&lt;br /&gt;
 		}&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	}]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The output (which is a JSON) will be parsed and the suggestion metrics such as the tone and presence of suggestion will be extracted so the user will be able to view a summarized result of how well their review comments were. In addition, an average score will be computed based on the scores they received for each comment section, and the result will be presented in a colorful format to the user after they hit the submit button.&lt;br /&gt;
&lt;br /&gt;
===Previous work===&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1308 Fall 2018 pull request]&lt;br /&gt;
* They had a functional suggestion detection API call that successfully communicated with the PeerLogic Server and retrieved the output. &lt;br /&gt;
* They included their API call in response.html.erb using JavaScript.&lt;br /&gt;
* They were able to display the output for each review beside the review. They displayed all of the information returned from the endpoint, which can look clunky.&lt;br /&gt;
* Since the code is added in the views, they performed manual testing in the views.&lt;br /&gt;
&lt;br /&gt;
More information about the suggestion detection service can be found at https://www.peerlogic.org&lt;br /&gt;
&lt;br /&gt;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart to Describe Plan of Action ===&lt;br /&gt;
&lt;br /&gt;
[[FIle:x.png]]&lt;br /&gt;
&lt;br /&gt;
== Changes Made ==&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default review view from displaying analysis for each comment to summarized analysis for all comments&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, suggestions, suggestions_chances returned from API&lt;br /&gt;
* Include displaying analysis for each review as a &amp;quot;debug&amp;quot; option&lt;br /&gt;
* Ensure that CORS does not need to be enabled for API call to work&lt;br /&gt;
* Write unit tests for our method(s) in response_controller.rb&lt;br /&gt;
* Fix grammar issues in response.html.erb&lt;br /&gt;
* Evaluate how much time this API is taking and, if possible, work a way out to improve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that we changed ===&lt;br /&gt;
* '''app/views/response/response.html.erb''' -  Refactored and reworked JS methods for the autosave and form submits, added a new hidden button to the response form &lt;br /&gt;
* '''app/controllers/response_controller.rb''' - Refactored and reworked methods for the autosave and form submits, added an API method to pass to view&lt;br /&gt;
* app/helpers/review_mapping_helper.rb - Adjusted the bar thickness according to desired specifications&lt;br /&gt;
* config/routes.rb - Added another route to support the new review confirmation page listed below&lt;br /&gt;
&lt;br /&gt;
=== New files we added ===&lt;br /&gt;
* '''app/models/metric.rb'''  - New ActiveRecord model added to act as a template for future API usage&lt;br /&gt;
* '''db/migrate/20190425194052_create_metrics.rb''' - New table added for permanent storage of the Metric class&lt;br /&gt;
* '''app/views/response/show_confirmation_page.erb - The new page added for review confirmation&lt;br /&gt;
* '''test/fixtures/metrics.yml''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''test/models/metric_test.rb''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''app/assets/images/lightbulb.png''' - Lightbulb picture for the new review confirmation page&lt;br /&gt;
* '''app/assets/images/music_note.png''' - A music note picture for the new review confirmation page&lt;br /&gt;
&lt;br /&gt;
==== Response Controller ====&lt;br /&gt;
Lines 359 and 360 are where we will retrieve the input from each review comment found in the form.&lt;br /&gt;
* The '''Answer''' model represents the review provided by the reviewer.&lt;br /&gt;
* On line 360, answer: v[:score] is the review comment from a given textarea HTML element&lt;br /&gt;
* params[:responses] stores the aggregate review data provided by the user&lt;br /&gt;
&lt;br /&gt;
[[File:create_answers.png]]&lt;br /&gt;
&lt;br /&gt;
=== Confirmation Page View ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Student View=====&lt;br /&gt;
The program flow is as follows:&lt;br /&gt;
&lt;br /&gt;
# After the reviewer has filled out their review, they have 2 choices: See an analysis of their review or Save the review.&lt;br /&gt;
# The reviewer selects to view their analysis by clicking on &amp;quot;Confirm Submission&amp;quot; button&lt;br /&gt;
# The program directs the reviewer to the new confirmation page which displays an analysis of their review.&lt;br /&gt;
# The reviewer has 2 options in the confirmation page: Submit the review or go back and modify their review.&lt;br /&gt;
# If the reviewer decides to Submit their review, the program directs them back to where they started (Create or edit review).&lt;br /&gt;
&lt;br /&gt;
The image below shows the above steps in a visual depiction.&lt;br /&gt;
[[File:program_flow.png]]&lt;br /&gt;
&lt;br /&gt;
==== Detailed Popup Information ====&lt;br /&gt;
Below we showcase the available information from the API if a reviewer is curious to find more details&lt;br /&gt;
&lt;br /&gt;
[[File:review_response_w_popup_1.png]]&lt;br /&gt;
[[File:review_response_w_popup_2.png]]&lt;br /&gt;
[[File:review_response_w_popup_3.png]]&lt;br /&gt;
&lt;br /&gt;
==== Conditional Formatting ====&lt;br /&gt;
To make the interface more user-friendly, we used conditional formatting to color our text. For the suggestions metrics, anything &amp;gt;50% means suggestions are present while anything &amp;lt;50% means suggestions are absent. Our conditional formatting is set so &amp;quot;Yes (&amp;gt;50%)&amp;quot; is green, 50% is yellow, and &amp;quot;No (&amp;lt;50%)&amp;quot; is red. The formatting is the same for the class average of suggestions metrics.&lt;br /&gt;
&lt;br /&gt;
For tone, there are three options in the API: positive, neutral, and negative. We created conditional formatting in our view file so positive is green text, neutral is yellow text, and negative is red text.&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
&lt;br /&gt;
=== Travis CI ===&lt;br /&gt;
Since we changed the controller and UI in our project to add the redirect view, the current Travis CI test build is failing.&lt;br /&gt;
* For TESTFOLDER=features, in the response.hmtl.erb view, we changed the submit button text from &amp;quot;Submit&amp;quot; to &amp;quot;Confirm Submission&amp;quot; in order to accurately reflect the new redirect page.&lt;br /&gt;
* For TESTFOLDER=controllers, we modified the save method inside response_controller.rb to redirect according to logic defined above.&lt;br /&gt;
&lt;br /&gt;
=== Tests ===&lt;br /&gt;
* We tested the new model added i.e. Metric model in metric.rb.&lt;br /&gt;
* The RSpec file is added to the rspec/models folder with the name metric_spec.rb.&lt;br /&gt;
* The testing tests the calculation of the average of suggestions chances from each response for a particular assignment.&lt;br /&gt;
* This also tests the output text of the sentiment that is received based on a input numerical value.&lt;br /&gt;
&lt;br /&gt;
=== View Tests ===&lt;br /&gt;
We have...&lt;br /&gt;
* Manually tested response.html.erb to verify the Review page outputs the correct message&lt;br /&gt;
* Provided sample inputs and shown expected outputs using screenshots&lt;br /&gt;
&lt;br /&gt;
==Links to our work==&lt;br /&gt;
* [https://github.com/pratikkumar-jain/expertiza/tree/beta Our repository]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1427 Pull request]&lt;br /&gt;
* [https://www.youtube.com/watch?time_continue=1&amp;amp;v=FjHAODvHtk4 YouTube Video]&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124622</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1937. Integrate suggestion detection algorithm.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124622"/>
		<updated>2019-04-27T01:30:28Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* View Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Dr. Gehringer (mentor)&lt;br /&gt;
* Sushan Basnet (sbasnet2)&lt;br /&gt;
* Jasmine Wang (jfwang2)&lt;br /&gt;
* Bill Mwaniki (bnmwanik)&lt;br /&gt;
* Pratik Kumar Kundanmal Jain (pjain22)&lt;br /&gt;
&lt;br /&gt;
==Project plan==&lt;br /&gt;
===Problem statement===&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, we hope students learn from the reviews they receive to improve their own performance. In order to make this happen, we would like to have everyone give quality reviews instead of generic ones. Currently we have a few classifiers that can detect useful features of review comments, such as how many suggestions they contain. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms will be so coded in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How it will work===&lt;br /&gt;
&lt;br /&gt;
In order to make the API call, the response_controller.rb will be responsible for sending a JSON input to the web service. The input will contain the review comment submitted by the user in the following format: &lt;br /&gt;
&lt;br /&gt;
Below is a sample input &lt;br /&gt;
  Sample Input:&lt;br /&gt;
  {&lt;br /&gt;
  	&amp;quot;reviews&amp;quot;:[{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;review text here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;,&amp;quot;suggestion&amp;quot;,&amp;quot;sentiment&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;another review here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;more text, maybe a large para or whatever you like&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;sentiment&amp;quot;, &amp;quot;suggestion&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		...&lt;br /&gt;
  	}]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Once the request is send, we expect the output to be in the following format:&lt;br /&gt;
&lt;br /&gt;
 Sample Output: (as 'suggestion' and 'volume' as you might expect)&lt;br /&gt;
 {&lt;br /&gt;
 	&amp;quot;metrics&amp;quot;:[{&lt;br /&gt;
 		&amp;quot;suggestion&amp;quot;:{&lt;br /&gt;
 			&amp;quot;suggestions_chances&amp;quot;:30,&lt;br /&gt;
 			&amp;quot;suggestions&amp;quot;:&amp;quot;absent&amp;quot;&lt;br /&gt;
 		},&lt;br /&gt;
 		&amp;quot;volume&amp;quot;:{&lt;br /&gt;
 			&amp;quot;total_volume&amp;quot;:10,&lt;br /&gt;
 			&amp;quot;volume_without_stopwords&amp;quot;:3&lt;br /&gt;
 		}&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	}]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The output (which is a JSON) will be parsed and the suggestion metrics such as the tone and presence of suggestion will be extracted so the user will be able to view a summarized result of how well their review comments were. In addition, an average score will be computed based on the scores they received for each comment section, and the result will be presented in a colorful format to the user after they hit the submit button.&lt;br /&gt;
&lt;br /&gt;
===Previous work===&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1308 Fall 2018 pull request]&lt;br /&gt;
* They had a functional suggestion detection API call that successfully communicated with the PeerLogic Server and retrieved the output. &lt;br /&gt;
* They included their API call in response.html.erb using JavaScript.&lt;br /&gt;
* They were able to display the output for each review beside the review. They displayed all of the information returned from the endpoint, which can look clunky.&lt;br /&gt;
* Since the code is added in the views, they performed manual testing in the views.&lt;br /&gt;
&lt;br /&gt;
More information about the suggestion detection service can be found at https://www.peerlogic.org&lt;br /&gt;
&lt;br /&gt;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart to Describe Plan of Action ===&lt;br /&gt;
&lt;br /&gt;
[[FIle:x.png]]&lt;br /&gt;
&lt;br /&gt;
== Changes Made ==&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default review view from displaying analysis for each comment to summarized analysis for all comments&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, suggestions, suggestions_chances returned from API&lt;br /&gt;
* Include displaying analysis for each review as a &amp;quot;debug&amp;quot; option&lt;br /&gt;
* Ensure that CORS does not need to be enabled for API call to work&lt;br /&gt;
* Write unit tests for our method(s) in response_controller.rb&lt;br /&gt;
* Fix grammar issues in response.html.erb&lt;br /&gt;
* Evaluate how much time this API is taking and, if possible, work a way out to improve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that we changed ===&lt;br /&gt;
* '''app/views/response/response.html.erb''' -  Refactored and reworked JS methods for the autosave and form submits, added a new hidden button to the response form &lt;br /&gt;
* '''app/controllers/response_controller.rb''' - Refactored and reworked methods for the autosave and form submits, added an API method to pass to view&lt;br /&gt;
* app/helpers/review_mapping_helper.rb - Adjusted the bar thickness according to desired specifications&lt;br /&gt;
* config/routes.rb - Added another route to support the new review confirmation page listed below&lt;br /&gt;
&lt;br /&gt;
=== New files we added ===&lt;br /&gt;
* '''app/models/metric.rb'''  - New ActiveRecord model added to act as a template for future API usage&lt;br /&gt;
* '''db/migrate/20190425194052_create_metrics.rb''' - New table added for permanent storage of the Metric class&lt;br /&gt;
* '''app/views/response/show_confirmation_page.erb - The new page added for review confirmation&lt;br /&gt;
* '''test/fixtures/metrics.yml''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''test/models/metric_test.rb''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''app/assets/images/lightbulb.png''' - Lightbulb picture for the new review confirmation page&lt;br /&gt;
* '''app/assets/images/music_note.png''' - A music note picture for the new review confirmation page&lt;br /&gt;
&lt;br /&gt;
==== Response Controller ====&lt;br /&gt;
Lines 359 and 360 are where we will retrieve the input from each review comment found in the form.&lt;br /&gt;
* The '''Answer''' model represents the review provided by the reviewer.&lt;br /&gt;
* On line 360, answer: v[:score] is the review comment from a given textarea HTML element&lt;br /&gt;
* params[:responses] stores the aggregate review data provided by the user&lt;br /&gt;
&lt;br /&gt;
[[File:create_answers.png]]&lt;br /&gt;
&lt;br /&gt;
=== Confirmation Page View ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Student View=====&lt;br /&gt;
The program flow is as follows:&lt;br /&gt;
&lt;br /&gt;
# After the reviewer has filled out their review, they have 2 choices: See an analysis of their review or Save the review.&lt;br /&gt;
# The reviewer selects to view their analysis by clicking on &amp;quot;Confirm Submission&amp;quot; button&lt;br /&gt;
# The program directs the reviewer to the new confirmation page which displays an analysis of their review.&lt;br /&gt;
# The reviewer has 2 options in the confirmation page: Submit the review or go back and modify their review.&lt;br /&gt;
# If the reviewer decides to Submit their review, the program directs them back to where they started (Create or edit review).&lt;br /&gt;
&lt;br /&gt;
The image below shows the above steps in a visual depiction.&lt;br /&gt;
[[File:program_flow.png]]&lt;br /&gt;
&lt;br /&gt;
==== Detailed Popup Information ====&lt;br /&gt;
Below we showcase the available information from the API if a reviewer is curious to find more details&lt;br /&gt;
&lt;br /&gt;
[[File:review_response_w_popup_1.png]]&lt;br /&gt;
[[File:review_response_w_popup_2.png]]&lt;br /&gt;
[[File:review_response_w_popup_3.png]]&lt;br /&gt;
&lt;br /&gt;
==== Conditional Formatting ====&lt;br /&gt;
To make the interface more user-friendly, we used conditional formatting to color our text. For the suggestions metrics, anything &amp;gt;50% means suggestions are present while anything &amp;lt;50% means suggestions are absent. Our conditional formatting is set so &amp;quot;Yes (&amp;gt;50%)&amp;quot; is green, 50% is yellow, and &amp;quot;No (&amp;lt;50%)&amp;quot; is red. The formatting is the same for the class average of suggestions metrics.&lt;br /&gt;
&lt;br /&gt;
For tone, there are three options in the API: positive, neutral, and negative. We created conditional formatting in our view file so positive is green text, neutral is yellow text, and negative is red text.&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
&lt;br /&gt;
=== Travis CI ===&lt;br /&gt;
Since we changed the controller and UI in our project to add the redirect view, the current Travis CI test build is failing.&lt;br /&gt;
* For TESTFOLDER=features, in the response.hmtl.erb view, we changed the submit button text from &amp;quot;Submit&amp;quot; to &amp;quot;Confirm Submission&amp;quot; in order to accurately reflect the new redirect page.&lt;br /&gt;
* For TESTFOLDER=controllers, we modified the save method inside response_controller.rb to redirect according to logic defined above.&lt;br /&gt;
&lt;br /&gt;
=== Tests ===&lt;br /&gt;
&lt;br /&gt;
=== View Tests ===&lt;br /&gt;
We have...&lt;br /&gt;
* Manually tested response.html.erb to verify the Review page outputs the correct message&lt;br /&gt;
* Provided sample inputs and shown expected outputs using screenshots&lt;br /&gt;
&lt;br /&gt;
==Links to our work==&lt;br /&gt;
* [https://github.com/pratikkumar-jain/expertiza/tree/beta Our repository]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1427 Pull request]&lt;br /&gt;
* [https://www.youtube.com/watch?time_continue=1&amp;amp;v=FjHAODvHtk4 YouTube Video]&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124621</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1937. Integrate suggestion detection algorithm.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1937._Integrate_suggestion_detection_algorithm.rb&amp;diff=124621"/>
		<updated>2019-04-27T01:27:51Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
=== Team ===&lt;br /&gt;
Dr. Gehringer (mentor)&lt;br /&gt;
* Sushan Basnet (sbasnet2)&lt;br /&gt;
* Jasmine Wang (jfwang2)&lt;br /&gt;
* Bill Mwaniki (bnmwanik)&lt;br /&gt;
* Pratik Kumar Kundanmal Jain (pjain22)&lt;br /&gt;
&lt;br /&gt;
==Project plan==&lt;br /&gt;
===Problem statement===&lt;br /&gt;
Peer-review systems like Expertiza utilize a lot of students’ input to determine each other’s performance. At the same time, we hope students learn from the reviews they receive to improve their own performance. In order to make this happen, we would like to have everyone give quality reviews instead of generic ones. Currently we have a few classifiers that can detect useful features of review comments, such as how many suggestions they contain. The suggestion-detection algorithm has been coded as a web service, and other detection algorithms will be so coded in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How it will work===&lt;br /&gt;
&lt;br /&gt;
In order to make the API call, the response_controller.rb will be responsible for sending a JSON input to the web service. The input will contain the review comment submitted by the user in the following format: &lt;br /&gt;
&lt;br /&gt;
Below is a sample input &lt;br /&gt;
  Sample Input:&lt;br /&gt;
  {&lt;br /&gt;
  	&amp;quot;reviews&amp;quot;:[{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;review text here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;,&amp;quot;suggestion&amp;quot;,&amp;quot;sentiment&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;another review here&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;problem&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		&amp;quot;text&amp;quot;:&amp;quot;more text, maybe a large para or whatever you like&amp;quot;,&lt;br /&gt;
  		&amp;quot;metrics&amp;quot;:[&amp;quot;sentiment&amp;quot;, &amp;quot;suggestion&amp;quot;]&lt;br /&gt;
  	},{&lt;br /&gt;
  		...&lt;br /&gt;
  	}]&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Once the request is send, we expect the output to be in the following format:&lt;br /&gt;
&lt;br /&gt;
 Sample Output: (as 'suggestion' and 'volume' as you might expect)&lt;br /&gt;
 {&lt;br /&gt;
 	&amp;quot;metrics&amp;quot;:[{&lt;br /&gt;
 		&amp;quot;suggestion&amp;quot;:{&lt;br /&gt;
 			&amp;quot;suggestions_chances&amp;quot;:30,&lt;br /&gt;
 			&amp;quot;suggestions&amp;quot;:&amp;quot;absent&amp;quot;&lt;br /&gt;
 		},&lt;br /&gt;
 		&amp;quot;volume&amp;quot;:{&lt;br /&gt;
 			&amp;quot;total_volume&amp;quot;:10,&lt;br /&gt;
 			&amp;quot;volume_without_stopwords&amp;quot;:3&lt;br /&gt;
 		}&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	},{&lt;br /&gt;
 		...&lt;br /&gt;
 	}]&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The output (which is a JSON) will be parsed and the suggestion metrics such as the tone and presence of suggestion will be extracted so the user will be able to view a summarized result of how well their review comments were. In addition, an average score will be computed based on the scores they received for each comment section, and the result will be presented in a colorful format to the user after they hit the submit button.&lt;br /&gt;
&lt;br /&gt;
===Previous work===&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1308 Fall 2018 pull request]&lt;br /&gt;
* They had a functional suggestion detection API call that successfully communicated with the PeerLogic Server and retrieved the output. &lt;br /&gt;
* They included their API call in response.html.erb using JavaScript.&lt;br /&gt;
* They were able to display the output for each review beside the review. They displayed all of the information returned from the endpoint, which can look clunky.&lt;br /&gt;
* Since the code is added in the views, they performed manual testing in the views.&lt;br /&gt;
&lt;br /&gt;
More information about the suggestion detection service can be found at https://www.peerlogic.org&lt;br /&gt;
&lt;br /&gt;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
=== Flowchart to Describe Plan of Action ===&lt;br /&gt;
&lt;br /&gt;
[[FIle:x.png]]&lt;br /&gt;
&lt;br /&gt;
== Changes Made ==&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default review view from displaying analysis for each comment to summarized analysis for all comments&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, suggestions, suggestions_chances returned from API&lt;br /&gt;
* Include displaying analysis for each review as a &amp;quot;debug&amp;quot; option&lt;br /&gt;
* Ensure that CORS does not need to be enabled for API call to work&lt;br /&gt;
* Write unit tests for our method(s) in response_controller.rb&lt;br /&gt;
* Fix grammar issues in response.html.erb&lt;br /&gt;
* Evaluate how much time this API is taking and, if possible, work a way out to improve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Files that we changed ===&lt;br /&gt;
* '''app/views/response/response.html.erb''' -  Refactored and reworked JS methods for the autosave and form submits, added a new hidden button to the response form &lt;br /&gt;
* '''app/controllers/response_controller.rb''' - Refactored and reworked methods for the autosave and form submits, added an API method to pass to view&lt;br /&gt;
* app/helpers/review_mapping_helper.rb - Adjusted the bar thickness according to desired specifications&lt;br /&gt;
* config/routes.rb - Added another route to support the new review confirmation page listed below&lt;br /&gt;
&lt;br /&gt;
=== New files we added ===&lt;br /&gt;
* '''app/models/metric.rb'''  - New ActiveRecord model added to act as a template for future API usage&lt;br /&gt;
* '''db/migrate/20190425194052_create_metrics.rb''' - New table added for permanent storage of the Metric class&lt;br /&gt;
* '''app/views/response/show_confirmation_page.erb - The new page added for review confirmation&lt;br /&gt;
* '''test/fixtures/metrics.yml''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''test/models/metric_test.rb''' - In support of the new ActiveRecord model called Metric&lt;br /&gt;
* '''app/assets/images/lightbulb.png''' - Lightbulb picture for the new review confirmation page&lt;br /&gt;
* '''app/assets/images/music_note.png''' - A music note picture for the new review confirmation page&lt;br /&gt;
&lt;br /&gt;
==== Response Controller ====&lt;br /&gt;
Lines 359 and 360 are where we will retrieve the input from each review comment found in the form.&lt;br /&gt;
* The '''Answer''' model represents the review provided by the reviewer.&lt;br /&gt;
* On line 360, answer: v[:score] is the review comment from a given textarea HTML element&lt;br /&gt;
* params[:responses] stores the aggregate review data provided by the user&lt;br /&gt;
&lt;br /&gt;
[[File:create_answers.png]]&lt;br /&gt;
&lt;br /&gt;
=== Confirmation Page View ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Student View=====&lt;br /&gt;
The program flow is as follows:&lt;br /&gt;
&lt;br /&gt;
# After the reviewer has filled out their review, they have 2 choices: See an analysis of their review or Save the review.&lt;br /&gt;
# The reviewer selects to view their analysis by clicking on &amp;quot;Confirm Submission&amp;quot; button&lt;br /&gt;
# The program directs the reviewer to the new confirmation page which displays an analysis of their review.&lt;br /&gt;
# The reviewer has 2 options in the confirmation page: Submit the review or go back and modify their review.&lt;br /&gt;
# If the reviewer decides to Submit their review, the program directs them back to where they started (Create or edit review).&lt;br /&gt;
&lt;br /&gt;
The image below shows the above steps in a visual depiction.&lt;br /&gt;
[[File:program_flow.png]]&lt;br /&gt;
&lt;br /&gt;
==== Detailed Popup Information ====&lt;br /&gt;
Below we showcase the available information from the API if a reviewer is curious to find more details&lt;br /&gt;
&lt;br /&gt;
[[File:review_response_w_popup_1.png]]&lt;br /&gt;
[[File:review_response_w_popup_2.png]]&lt;br /&gt;
[[File:review_response_w_popup_3.png]]&lt;br /&gt;
&lt;br /&gt;
==== Conditional Formatting ====&lt;br /&gt;
To make the interface more user-friendly, we used conditional formatting to color our text. For the suggestions metrics, anything &amp;gt;50% means suggestions are present while anything &amp;lt;50% means suggestions are absent. Our conditional formatting is set so &amp;quot;Yes (&amp;gt;50%)&amp;quot; is green, 50% is yellow, and &amp;quot;No (&amp;lt;50%)&amp;quot; is red. The formatting is the same for the class average of suggestions metrics.&lt;br /&gt;
&lt;br /&gt;
For tone, there are three options in the API: positive, neutral, and negative. We created conditional formatting in our view file so positive is green text, neutral is yellow text, and negative is red text.&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
&lt;br /&gt;
=== Travis CI ===&lt;br /&gt;
Since we changed the controller and UI in our project to add the redirect view, the current Travis CI test build is failing.&lt;br /&gt;
* For TESTFOLDER=features, in the response.hmtl.erb view, we changed the submit button text from &amp;quot;Submit&amp;quot; to &amp;quot;Confirm Submission&amp;quot; in order to accurately reflect the new redirect page.&lt;br /&gt;
* For TESTFOLDER=controllers, we modified the save method inside response_controller.rb to redirect according to logic defined above.&lt;br /&gt;
&lt;br /&gt;
=== Tests ===&lt;br /&gt;
&lt;br /&gt;
=== View Tests ===&lt;br /&gt;
We have...&lt;br /&gt;
* manual tested response.html.erb to verify the Review page outputs the correct message&lt;br /&gt;
* provided sample inputs and shon expected outputs using screenshots&lt;br /&gt;
&lt;br /&gt;
==Links to our work==&lt;br /&gt;
* [https://github.com/pratikkumar-jain/expertiza/tree/beta Our repository]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1427 Pull request]&lt;br /&gt;
* [https://www.youtube.com/watch?time_continue=1&amp;amp;v=FjHAODvHtk4 YouTube Video]&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122905</id>
		<title>CSC/ECE 517 Spring 2019 E1910 Refactor assignments controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122905"/>
		<updated>2019-04-01T22:34:32Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* RSpec Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1910 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
We have not deployed this project since we did not change or add any functionality that would affect the user. &lt;br /&gt;
&lt;br /&gt;
== Expertiza Background==&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 the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages. [3]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The assignments_controller has multiple functions with wrong naming convention, they are classic examples of bad function names. Few of the variables names used in the method can also be refactored to make it more relevant and understandable. In addition, functions code can be optimized to ensure that it follows 'Don't Repeat Yourself' (DRY) principle. Also, most of the functions have missing code comments, which should be added to the functions.&lt;br /&gt;
&lt;br /&gt;
=== Pull request link ===&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1377]&lt;br /&gt;
&lt;br /&gt;
=== Forked Github repo ===&lt;br /&gt;
[https://github.com/veehakhanna/expertiza]&lt;br /&gt;
&lt;br /&gt;
== Files modified in current project ==&lt;br /&gt;
&lt;br /&gt;
The only controller modified for this project was the:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. AssignmentsController &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Assignment_helper&lt;br /&gt;
&lt;br /&gt;
The updated method names in AssignmentController:&lt;br /&gt;
 &lt;br /&gt;
  - handle_assignment_directory_path_nonexist_case_and_answer_tagging &lt;br /&gt;
    -- missing_submission_directory&lt;br /&gt;
  - assignment_form_key_nonexist_case_handler &lt;br /&gt;
    -- assignment_submission_handler&lt;br /&gt;
  - handle_current_user_timezonepref_nil &lt;br /&gt;
    -- timezone_handler&lt;br /&gt;
  - update_nil_dd_deadline_name &lt;br /&gt;
    -- update_due_date_deadline_name&lt;br /&gt;
  - update_nil_dd_description_url &lt;br /&gt;
    -- update_due_date_description_url &lt;br /&gt;
  - assignment_form_assignment_staggered_deadline? &lt;br /&gt;
    -- assignment_staggered_deadline?&lt;br /&gt;
  - check_due_date_nameurl_not_empty &lt;br /&gt;
    -- check_due_date_nameurl &lt;br /&gt;
  - update_feedback_assignment_form_attributes &lt;br /&gt;
    -- update_feedback_attributes  &lt;br /&gt;
&lt;br /&gt;
The thought process behind changing the method names was to make the names shorter and reduce redundancy. There were a few rules that we learned from our mentor; words like ''nil'' and ''nonexist'' are not allowed in method names. So for '''handle_current_user_timezonepref_nil''' we first removed the ''nil''. Then after looking at what the method does we determined that '''timezone_handler''' would be appropriate and tells the user enough at a moments glance. More information is available about the method in the form of a block comment.&lt;br /&gt;
&lt;br /&gt;
Another example is '''assignment_form_assignment_staggered_deadline?''', the ''assignment_form'' bit is redundant, since it is the assignments controller the beginning part does not provide any new information and '''assignment_staggered_deadline?''' is sufficient.&lt;br /&gt;
&lt;br /&gt;
A different kind of naming is '''update_nil_dd_deadline_name''', we removed the ''nil'' but the ''dd'' doesn't make sense. No one would know what that stands for just by reading it. This is why this method was changed to '''update_due_date_deadline_name'''. It is not any shorter but much more useful at a glance. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''assignment_helper''' file was added to. Some of the methods in the controller were misplaced and according to the DRY principle these methods are better suited to  be in the helper method. The methods that were moved from the controller to the helper were:&lt;br /&gt;
  - assignment_submission_handler -&amp;gt; updated method name&lt;br /&gt;
  - check_due_date_nameurl(dd) -&amp;gt; updated method name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We were asked to refactor the '''action_allowed?''' method but after discussing some reafactoring methods with our mentor it was decided that refactoring this method would not promote the DRY principle and the methods created as a result would only be for that one purpose and therefore unnecessary.&lt;br /&gt;
&lt;br /&gt;
== Code Improvements ==&lt;br /&gt;
 &lt;br /&gt;
The DRY principle states, &amp;quot;Every piece of knowledge or logic must have a single, unambiguous representation within a system.&amp;quot;[4] This project was about furthering this principle and keeping this controller concise and maintainable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a controller that helps instructors, TA's, administrators, and super-administrators create/update/edit/show/delete current and past assignments. We updated the aforementioned method names so that the naming convention follows the DRY principle. Many of the method names were far too long, repetitive or unhelpful in understanding what the method actually does. In accordance with the principle we updated the method names to be simple while also being useful in letting the programmer know what the method does. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many of these methods did not have any comments to help the programmer understand the logic driving the method. To further help the programmer in understanding what the code does we added block comments at the beginning of each method that we updated. &lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
We cleaned up the controller by moving some methods from the controller into the associated helper file ('''assignment_helper.rb'''). By doing this we made the controller less messy and easier to read while maintaining and furthering the DRY principle. The code is now easily maintainable and all &amp;quot;helper&amp;quot; methods are in one place rather than separated across many files. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The delegation pattern states, &amp;quot;In delegation, an object handles a request by delegating to a second object (the delegate). The delegate is a helper object, but with the original context.&amp;quot; [5]&lt;br /&gt;
&lt;br /&gt;
As something extra, the '''create''' method was refactored so that the branch condition would be lower and there would be no repetition. We decided to use the delegation pattern because it serves the purpose of cleaning up existing methods while maintaining functionality. As per this pattern we took a request from the '''create''' method and put it in a helper method called '''update_assignment_form'''. This method handles updating the id of the ''assignment_questionnaire'' and the ''due_date'' and updating the form accordingly. The '''create''' method delegates this task to the '''update_assignment_form'''. &lt;br /&gt;
&lt;br /&gt;
The '''update_assignment_form''' delegated a tasks to the helper method, '''array_traverser'''. This method does the job of going through the array and updates id fields to be strings instead of an integer. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a result of these changes two code climate issues have been resolved which are stated below in the Code Climate section. Below are images of the way the '''create''' method used to look and how it looks now.&lt;br /&gt;
&lt;br /&gt;
Old '''create''' method:&lt;br /&gt;
&lt;br /&gt;
[[File:old_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New '''create''' method:&lt;br /&gt;
&lt;br /&gt;
[[File:new_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Code Climate===&lt;br /&gt;
&lt;br /&gt;
Code Climate checks to make sure that the code that has been written follows certain rules so that everything is legible and concise. During our refactoring we have fixed the following code climate issues. &lt;br /&gt;
&lt;br /&gt;
- The '''create''' method's Cognitive Complexity was too high. That has been resolved by the delegation we have described above. &amp;lt;br/&amp;gt;&lt;br /&gt;
- The '''create''' method was too long with 33 lines of code. That has been resolved by the delegation we have described above. &amp;lt;br/&amp;gt;&lt;br /&gt;
- The Branch Condition size for '''assignment_form_key_nonexist_case_handler''', which is now '''assignment_submission_handler''', was too high. This means that there were too many nested if/elsif/else statements. This has been resolved as a result of us refactoring the code. &amp;lt;br/&amp;gt;&lt;br /&gt;
- The Branch Condition size for '''update_feedback_assignment_form_attributes''', which is now '''update_feedback_attributes ''', was too high. This means that there were too many nested if/elsif/else statements. This has been resolved as a result of us refactoring the code.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have three current code climate issues but after discussing with our mentor we have been told to ignore those.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
&lt;br /&gt;
The code coverage for the controller was 49% when we got the project. The code coverage when we finished was 53.32%.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Tests ===&lt;br /&gt;
&lt;br /&gt;
There were already quite a few test cases for the AssignmentsController ('''assignments_controller_spec.rb'''). The '''create''' block tested just about everything. The two methods we added are private and since we branched out some functionality this needed to be a bit more explicitly tested. There is no precedence for testing private methods and it was frowned upon as per the video ''The Magic Tricks of Testing''. We tested the public method, '''create''', that calls the private method, '''update_assignment_form''' and '''array_traverser'''. We added a test with the context ''when assignment_form is saved successfully but fails to update''. &lt;br /&gt;
&lt;br /&gt;
For the other untested public methods, we found no usage directly in the controller, therefore, we did not test them. These methods are performing the tasks of assigning values to the variables and therefore that is being tested in other methods of the controllers.&lt;br /&gt;
&lt;br /&gt;
No changes were made to the associated views and model file.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
1. https://github.com/expertiza/expertiza/pull/1377 &amp;lt;br/&amp;gt;&lt;br /&gt;
2. https://github.com/veehakhanna/expertiza &amp;lt;br/&amp;gt;&lt;br /&gt;
3. http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_E1553_AAJ &amp;lt;br/&amp;gt;&lt;br /&gt;
4. https://dzone.com/articles/software-design-principles-dry-and-kiss &amp;lt;br/&amp;gt;&lt;br /&gt;
5. https://en.wikipedia.org/wiki/Delegation_pattern&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122255</id>
		<title>CSC/ECE 517 Spring 2019 E1910 Refactor assignments controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122255"/>
		<updated>2019-03-25T22:23:52Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* Files modified in current project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1910 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
We have not deployed this project since we did not change or add any functionality that would affect the user. &lt;br /&gt;
&lt;br /&gt;
== Expertiza Background==&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 the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages. [1]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The assignments_controller has multiple functions with wrong naming convention, they are classic examples of bad function names. Few of the variables names used in the method can also be refactored to make it more relevant and understandable. In addition, functions code can be optimized to ensure that it follows 'Don't Repeat Yourself' (DRY) principle. Also, most of the functions have missing code comments, which should be added to the functions.&lt;br /&gt;
&lt;br /&gt;
== Files modified in current project ==&lt;br /&gt;
&lt;br /&gt;
The only controller modified for this project was the:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. AssignmentsController &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Assignment_helper&lt;br /&gt;
&lt;br /&gt;
The updated methods in AssignmentController:&lt;br /&gt;
 &lt;br /&gt;
  - handle_assignment_directory_path_nonexist_case_and_answer_tagging &lt;br /&gt;
    -- missing_submission_directory&lt;br /&gt;
  - assignment_form_key_nonexist_case_handler &lt;br /&gt;
    -- assignment_submission_handler&lt;br /&gt;
  - Handle_current_user_timezonepref_nil &lt;br /&gt;
    -- timezone_handler&lt;br /&gt;
  - update_nil_dd_deadline_name &lt;br /&gt;
    -- update_due_date_deadline_name&lt;br /&gt;
  - update_nil_dd_description_url &lt;br /&gt;
    -- update_due_date_description_url &lt;br /&gt;
  - assignment_form_assignment_staggered_deadline? &lt;br /&gt;
    -- assignment_staggered_deadline?&lt;br /&gt;
  - check_due_date_nameurl_not_empty &lt;br /&gt;
    -- check_due_date_nameurl &lt;br /&gt;
  - update_feedback_assignment_form_attributes &lt;br /&gt;
    -- update_feedback_attributes  &lt;br /&gt;
&lt;br /&gt;
We have left a few comments in the controller that say 'used to be...' so that it can be seen where the changes have been made and these will be removed before the final submission. &lt;br /&gt;
&lt;br /&gt;
The assignment_helper file was added to. Some of the methods in the controller were misplaced and according to the DRY principle these methods are better suited to  be in the helper method. The methods that were moved from the controller to the helper were:&lt;br /&gt;
  - assignment_submission_handler -&amp;gt; updated method name&lt;br /&gt;
  - check_due_date_nameurl(dd) -&amp;gt; updated method name&lt;br /&gt;
  - edit_params_setting ** this is causing a test to fail we are currently trying to figure out why&lt;br /&gt;
&lt;br /&gt;
== Code Improvements ==&lt;br /&gt;
 &lt;br /&gt;
The DRY principle states, &amp;quot;Every piece of knowledge or logic must have a single, unambiguous representation within a system.&amp;quot;[2] This project was about furthering this principle and keeping this controller concise and maintainable. &lt;br /&gt;
&lt;br /&gt;
This is a controller that helps instructors, TA's, administrators, and super-administrators create/update/edit/show/delete current and past assignments. We updated the aforementioned method names so that the naming convention follows the DRY principle. Many of the method names were far too long or repetitive or unhelpful in understanding what the method actually completed. In accordance with the principle we updated the method names to be simple while also being useful in letting the programmer know what the method does. &lt;br /&gt;
&lt;br /&gt;
Many of these methods did not have any comments to help the programmer understand the logic driving the method. To further help the programmer in understanding what the code does we added block comments at the beginning of each method that we updated. &lt;br /&gt;
  &lt;br /&gt;
We cleaned up the controller by moving some methods from the controller into the associated helper file (assignment_helper.rb). By doing this we made the controller-less messy and easier to read while maintaining and furthering the DRY principle. The code is now easily maintainable and all &amp;quot;helper&amp;quot; methods are in one place rather than separated across many files. &lt;br /&gt;
&lt;br /&gt;
The create method was refactored so that the branch condition would be lower. We took a part of the functionality and put it in its own method called &amp;quot;update_assignment_form&amp;quot;. This method handles updating the id of the assignment_questionnaire and the due_date and updating the form accordingly. As a result of this change two code climate issues have been resolved:&lt;br /&gt;
  - The length of the create method was too long&lt;br /&gt;
  - The cognitive complexity has been reduced&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;update_assignment_form&amp;quot; method had redundancy of code and so we created two different functions for that part and created a generalized function to run the logic based on the option that is passed to the function. This way we overcame the redundancy part in the function by modularizing the logic.&lt;br /&gt;
&lt;br /&gt;
Old create method:&lt;br /&gt;
&lt;br /&gt;
[[File:old_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New create method:&lt;br /&gt;
&lt;br /&gt;
[[File:new_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
update_assignment_form method:&lt;br /&gt;
&lt;br /&gt;
[[File:new_method_1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There were many existing test cases for this controller. We have made sure that no test cases were violated by our changes. No changes were made to the associated views or model files.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
There were already quite a few test cases for the AssignmentsController. We have not added any new tests but made sure that no tests were failing due to our changes. No changes were made to the associated views and model file.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
1. http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_E1553_AAJ &amp;lt;br/&amp;gt;&lt;br /&gt;
2. https://dzone.com/articles/software-design-principles-dry-and-kiss &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122250</id>
		<title>File:New method 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122250"/>
		<updated>2019-03-25T22:20:20Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: uploaded a new version of &amp;amp;quot;File:New method 1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122247</id>
		<title>File:New method 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122247"/>
		<updated>2019-03-25T22:19:01Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: uploaded a new version of &amp;amp;quot;File:New method 1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122242</id>
		<title>File:New method 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122242"/>
		<updated>2019-03-25T22:17:34Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: uploaded a new version of &amp;amp;quot;File:New method 1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122240</id>
		<title>File:New method 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122240"/>
		<updated>2019-03-25T22:16:57Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: uploaded a new version of &amp;amp;quot;File:New method 1.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122238</id>
		<title>CSC/ECE 517 Spring 2019 E1910 Refactor assignments controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_E1910_Refactor_assignments_controller.rb&amp;diff=122238"/>
		<updated>2019-03-25T22:14:41Z</updated>

		<summary type="html">&lt;p&gt;Pjain22: /* Code Improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1910 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
We have not deployed this project since we did not change or add any functionality that would affect the user. &lt;br /&gt;
&lt;br /&gt;
== Expertiza Background==&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 the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages. [1]&lt;br /&gt;
&lt;br /&gt;
== Description of the current project ==&lt;br /&gt;
&lt;br /&gt;
The assignments_controller has multiple functions with wrong naming convention, they are classic examples of bad function names. Few of the variables names used in the method can also be refactored to make it more relevant and understandable. In addition, functions code can be optimized to ensure that it follows 'Don't Repeat Yourself' (DRY) principle. Also, most of the functions have missing code comments, which should be added to the functions.&lt;br /&gt;
&lt;br /&gt;
== Files modified in current project ==&lt;br /&gt;
&lt;br /&gt;
The only controller modified for this project was the:&amp;lt;br/&amp;gt;&lt;br /&gt;
1. AssignmentsController &amp;lt;br/&amp;gt;&lt;br /&gt;
2. Assignment_helper&lt;br /&gt;
&lt;br /&gt;
The updated methods in AssignmentController:&lt;br /&gt;
 &lt;br /&gt;
  - handle_assignment_directory_path_nonexist_case_and_answer_tagging &lt;br /&gt;
    -- missing_submission_directory&lt;br /&gt;
  - assignment_form_key_nonexist_case_handler &lt;br /&gt;
    -- assignment_submission_handler&lt;br /&gt;
  - Handle_current_user_timezonepref_nil &lt;br /&gt;
    -- timezone_handler&lt;br /&gt;
  - update_nil_dd_deadline_name &lt;br /&gt;
    -- update_due_date_deadline_name&lt;br /&gt;
  - update_nil_dd_description_url &lt;br /&gt;
    -- update_due_date_description_url &lt;br /&gt;
  - assignment_form_assignment_staggered_deadline? &lt;br /&gt;
    -- assignment_staggered_deadline?&lt;br /&gt;
  - check_due_date_nameurl_not_empty &lt;br /&gt;
    -- check_due_date_nameurl &lt;br /&gt;
  - update_feedback_assignment_form_attributes &lt;br /&gt;
    -- update_feedback_attributes  &lt;br /&gt;
&lt;br /&gt;
We have left a few comments in the controller that say 'used to be...' so that it can be seen where the changes have been made and these will be removed before the final submission. &lt;br /&gt;
&lt;br /&gt;
The assignment_helper file was added to. Some of the methods in the controller were misplaced and according to the DRY principle these methods are better suited to  be in the helper method. The methods that were moved from the controller to the helper were:&lt;br /&gt;
  - assignment_submission_handler -&amp;gt; updated method name&lt;br /&gt;
  - check_due_date_nameurl(dd) -&amp;gt; updated method name&lt;br /&gt;
  - edit_params_setting ** this is causing a test to fail we are currently trying to figure out why&lt;br /&gt;
&lt;br /&gt;
[[File:[[File:Example.jpg]]]]== Code Improvements ==&lt;br /&gt;
 &lt;br /&gt;
The DRY principle states, &amp;quot;Every piece of knowledge or logic must have a single, unambiguous representation within a system.&amp;quot;[2] This project was about furthering this principle and keeping this controller concise and maintainable. &lt;br /&gt;
&lt;br /&gt;
This is a controller that helps instructors, TA's, administrators, and super-administrators create/update/edit/show/delete current and past assignments. We updated the afore mentioned method names so that the naming convention follows the DRY principle. Many of the method names were far too long or repetitive or unhelpful in understanding what the method actually completed. In accordance with principle we updated the method names to be simple while also being useful in letting the programmer know what the method does. &lt;br /&gt;
&lt;br /&gt;
Many of these methods did not have any comments to help the programmer understand the logic driving the method. To further help the programmer in understanding what the code does we added block comments at the beginning of each method that we updated. &lt;br /&gt;
  &lt;br /&gt;
We cleaned up the controller by moving some methods from the controller into the associated helper file (assignment_helper.rb). By doing this we made the controller less messy and easier to read while maintaining and furthering the DRY principle. The code is now easily maintainable and all &amp;quot;helper&amp;quot; methods are in one place rather than separated across many files. &lt;br /&gt;
&lt;br /&gt;
The create method was refactored so that the branch condition would be lower. We took a part of the functionality and put it in its own method called &amp;quot;update_assignment_form&amp;quot;. This method handles updating the id of the assignment_questionnaire and the due_date and updating the form accordingly. As a result of this change two code climate issues have been resolved:&lt;br /&gt;
  - The length of the create method was too long&lt;br /&gt;
  - The cognitive complexity has been reduced&lt;br /&gt;
&lt;br /&gt;
Old create method:&lt;br /&gt;
&lt;br /&gt;
[[File:old_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New create method:&lt;br /&gt;
&lt;br /&gt;
[[File:new_create_method.png]]&lt;br /&gt;
&lt;br /&gt;
update_assignment_form method:&lt;br /&gt;
&lt;br /&gt;
[[File:new_method_1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There were many existing test cases for this controller. We have made sure that no test cases were violated by our changes. No changes were made to the associated views or model files.&lt;br /&gt;
&lt;br /&gt;
== Testing Details==&lt;br /&gt;
&lt;br /&gt;
=== RSpec ===&lt;br /&gt;
There were already quite a few test cases for the AssignmentsController. We have not added any new tests but made sure that no tests were failing due to our changes. No changes were made to the associated views and model file.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
1. http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2015/oss_E1553_AAJ &amp;lt;br/&amp;gt;&lt;br /&gt;
2. https://dzone.com/articles/software-design-principles-dry-and-kiss &amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pjain22</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122237</id>
		<title>File:New method 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_method_1.png&amp;diff=122237"/>
		<updated>2019-03-25T22:13:20Z</updated>

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