<?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=Sbasnet2</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=Sbasnet2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sbasnet2"/>
	<updated>2026-05-16T06:23:34Z</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=123765</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=123765"/>
		<updated>2019-04-11T19:09:52Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Proposed changes */&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;
 File(s) involved in making API Call: response_controller.rb&lt;br /&gt;
 FIle(s) involved in displaying the received output: response.html.erb&lt;br /&gt;
&lt;br /&gt;
===Proposed changes===&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;
=== Anticipated View ===&lt;br /&gt;
&lt;br /&gt;
[[File:y.png]]&lt;br /&gt;
&lt;br /&gt;
The user will be given a summary of the feedback in a colorful format. The user will not see all the fields of the JSON and only the necessary text fields, whereas currently the user sees all the fields in the output from the API call. We expect to make the detailed view optional so that it can be used for debug purposes, and not be seen in the production server.&lt;br /&gt;
&lt;br /&gt;
===Files that will change===&lt;br /&gt;
* '''app/views/response/response.html.erb''': Fix grammar issues, generate view with metrics&lt;br /&gt;
* '''app/controllers/response_controller.rb''': Call API here to pass to view&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
* Use RSpec testing on response_controller.rb to test the method(s) we implement&lt;br /&gt;
* Use manual testing on response.html.erb to test view we create&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;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Y.png&amp;diff=123764</id>
		<title>File:Y.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Y.png&amp;diff=123764"/>
		<updated>2019-04-11T19:06:25Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</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=123762</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=123762"/>
		<updated>2019-04-11T18:53:16Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Previous work */&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;
 File(s) involved in making API Call: response_controller.rb&lt;br /&gt;
 FIle(s) involved in displaying the received output: response.html.erb&lt;br /&gt;
&lt;br /&gt;
===Proposed changes===&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;
===Files that will change===&lt;br /&gt;
* '''app/views/response/response.html.erb''': Fix grammar issues, generate view with metrics&lt;br /&gt;
* '''app/controllers/response_controller.rb''': Call API here to pass to view&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
* Use RSpec testing on response_controller.rb to test the method(s) we implement&lt;br /&gt;
* Use manual testing on response.html.erb to test view we create&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;/div&gt;</summary>
		<author><name>Sbasnet2</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=123761</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=123761"/>
		<updated>2019-04-11T18:52:16Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Previous work */&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;
[[File:Prev.png]]&lt;br /&gt;
&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;
 File(s) involved in making API Call: response_controller.rb&lt;br /&gt;
 FIle(s) involved in displaying the received output: response.html.erb&lt;br /&gt;
&lt;br /&gt;
===Proposed changes===&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;
===Files that will change===&lt;br /&gt;
* '''app/views/response/response.html.erb''': Fix grammar issues, generate view with metrics&lt;br /&gt;
* '''app/controllers/response_controller.rb''': Call API here to pass to view&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
* Use RSpec testing on response_controller.rb to test the method(s) we implement&lt;br /&gt;
* Use manual testing on response.html.erb to test view we create&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;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:X.png&amp;diff=123760</id>
		<title>File:X.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:X.png&amp;diff=123760"/>
		<updated>2019-04-11T18:49:30Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</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=123759</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=123759"/>
		<updated>2019-04-11T18:45:12Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Problem statement */&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;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
===Proposed changes===&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;
===Files that will change===&lt;br /&gt;
* '''app/views/response/response.html.erb''': Fix grammar issues, generate view with metrics&lt;br /&gt;
* '''app/controllers/response_controller.rb''': Call API here to pass to view&lt;br /&gt;
&lt;br /&gt;
==Testing plan==&lt;br /&gt;
* Use RSpec testing on response_controller.rb to test the method(s) we implement&lt;br /&gt;
* Use manual testing on response.html.erb to test view we create&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;/div&gt;</summary>
		<author><name>Sbasnet2</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=123427</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=123427"/>
		<updated>2019-04-07T17:03:37Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Proposed changes */&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==&lt;br /&gt;
===Task===&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;
====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;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
====Proposed changes====&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;/div&gt;</summary>
		<author><name>Sbasnet2</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=123425</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=123425"/>
		<updated>2019-04-07T16:54:55Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: /* Proposed changes */&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==&lt;br /&gt;
===Task===&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;
====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;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
====Proposed changes====&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;/div&gt;</summary>
		<author><name>Sbasnet2</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=123422</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=123422"/>
		<updated>2019-04-07T16:52:48Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &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==&lt;br /&gt;
===Task===&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;
====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;
[[File:Prev.png]]&lt;br /&gt;
&lt;br /&gt;
====Proposed changes====&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;/div&gt;</summary>
		<author><name>Sbasnet2</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=123421</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=123421"/>
		<updated>2019-04-07T16:52:24Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &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==&lt;br /&gt;
===Task===&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;
====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;
====Proposed changes====&lt;br /&gt;
* Move API calls of suggestion-detection algorithm from view to response_controller.rb&lt;br /&gt;
* Change default view from displaying analysis for each review to summarized analysis for all reviews&lt;br /&gt;
** Do not include comment text in analysis view&lt;br /&gt;
** Focus on sentiment_score, sentiment_tone, and suggestions metrics 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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Prev.png]]&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Prev.png&amp;diff=123420</id>
		<title>File:Prev.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Prev.png&amp;diff=123420"/>
		<updated>2019-04-07T16:50:32Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrun.png&amp;diff=122117</id>
		<title>File:Testrun.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrun.png&amp;diff=122117"/>
		<updated>2019-03-25T17:54:00Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=122116</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1906. Refactor stage deadlines in Assignment.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=122116"/>
		<updated>2019-03-25T17:52:45Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1906 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
=='''Expertiza Background'''==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a web application developed using Ruby on Rails Framework whose creation and maintenance is taken care of by students as well as the faculty of NCSU.It's code is available on Github [https://github.com/expertiza/expertiza Expertiza on GitHub].Expertiza allows the instructor to create and edit new as well as existing assignments.This also includes creating a wide range of topics under each assignment which students can sign up for.They can also publish surveys and reviews,view statistical results, set deadlines for assignments and make announcements.It provides a platform for students to signup for topics,form teams,view and submit assignments and give peer reviews and feedback.&lt;br /&gt;
&lt;br /&gt;
=='''Stage Deadline Background'''==&lt;br /&gt;
An assignment in Expertiza has many deadlines possible: deadlines for submission and review in each round,deadlines for signing up and dropping topics,submitting meta-reviews,etc.Depending on what the next deadline is,an Expertiza assignment is said to be in a particular kind of what is called &amp;quot;stage&amp;quot;.For example,if the next deadline(after the current time) is a submission deadline which is a DueDate object,then the assignment is said to be in a &amp;quot;submission&amp;quot; phase.&lt;br /&gt;
&lt;br /&gt;
[[File: StageBackground.png|center]]&lt;br /&gt;
&lt;br /&gt;
Depending on which stage an assignment is in, certain activities may be permissible or impermissible.For example, the default for a submission stage is to allow submission but not review,and in a review stage,the default is to allow review but not submission.These defaults may be changed by checking the relevant boxes on the Due Dates tab of assignment creation or editing.In the figure below it can be seen the &amp;quot;Other's work&amp;quot; link is grayed out as review is not permissible during submission phase.&lt;br /&gt;
&lt;br /&gt;
[[File: Statusinadeadline.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Important Links'''==&lt;br /&gt;
&lt;br /&gt;
[http://oss.flazzle.com/ Deployed_Project_Link]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jwboykin/expertiza Expertiza_Link_for_this_Project]&lt;br /&gt;
&lt;br /&gt;
=='''Problem Statement'''==&lt;br /&gt;
E1906 is an Expertiza based OSS project which deals basically with refactoring stage deadlines in assignment.rb file.Class assignment.rb has several methods for checking what kind of stage an assignment is in at the current time.These are:&lt;br /&gt;
&lt;br /&gt;
* current_stage_name(topic_id = nil)&lt;br /&gt;
* find_current_stage(topic_id = nil)&lt;br /&gt;
* get_current_stage(topic_id = nil)&lt;br /&gt;
* link_for_current_stage(topic_id = nil)&lt;br /&gt;
* stage_deadline(topic_id = nil)&lt;br /&gt;
&lt;br /&gt;
The goal of the project focuses on refactoring some of the above more complex methods, modifying some of the language to make it more Ruby friendly, removing some redundant code. This project is basically an attempt to make this part of the application easier to read and maintain.&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
&lt;br /&gt;
==='''Problem 1'''===&lt;br /&gt;
&lt;br /&gt;
The above methods were being used at various places to check if the assignment is 'Finished' which made the code very redundant. Assignment is said to be finished if the next_due_date is nil.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have created a new method &amp;quot;finished?&amp;quot; that checks if the next_due_date is nil (which means that the assignment is &amp;quot;finished&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # New function to check if the assignment is finished&lt;br /&gt;
  def finished?( topic_id = nil )&lt;br /&gt;
    DueDate.get_next_due_date(self.id, topic_id).nil?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have called this method at all the places where previously different methods were being used to check the same thing.&lt;br /&gt;
*Signup sheet table uses assignment finished? method instead of current_stage_name&lt;br /&gt;
[[File:Problem1_1.png‎|center]]&lt;br /&gt;
&lt;br /&gt;
*Use assignment finished? method where only a comparison to &amp;quot;Finished&amp;quot; was being done using get_current_stage and find_current_stage&lt;br /&gt;
[[File:Problem1_2.png|center]] [[File:Problem1_3.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 2'''===&lt;br /&gt;
&lt;br /&gt;
The check for a topic_id to be nil when it is a staggered assignment and return 'Unknown' when it is true was being done at many places.This was not following Ruby and Rails rules.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
To make the code DRY and more easy to understand,we have created a new private method &amp;quot;topic_missing?&amp;quot; to check if the topic_id is nil in case of staggered assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Function to check if topic id is null when its a staggered assignment&lt;br /&gt;
  def topic_missing?( topic_id = nil)&lt;br /&gt;
    topic_id.nil? and self.staggered_deadline?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactoring with new method topic_missing?&lt;br /&gt;
&lt;br /&gt;
[[File:Topic missing.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 3'''===&lt;br /&gt;
&lt;br /&gt;
find_current_stage(topic_id=nil) method is being used only locally in the assignment.rb and once in the student_teams controller to check to check whether to display or not the reviews option for team members.This method was calling another function to get the next_due_date for an assignment that was creating a chain of calls.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have removed this function.We have replaced it with finished? method in the student_teams controller(shown in screenshot above in Problem 1) and with DueDate.get_next_due_date where the next due date was required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Before :&lt;br /&gt;
 due_date = find_current_stage(topic_id)&lt;br /&gt;
 &lt;br /&gt;
 After :&lt;br /&gt;
 due_date = DueDate.get_next_due_date(self.id, topic_id)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Problem 4'''===&lt;br /&gt;
&lt;br /&gt;
get_current_stage method is returning the stage name which the assignment is in at current time.This is not very clear from the name of the method.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have changed the method name to get_current_stage_name(topic_id=nil) to make it more clear to understand.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_current_stage_name(topic_id = nil)&lt;br /&gt;
    return 'Unknown' if topic_missing?(topic_id)&lt;br /&gt;
    due_date = DueDate.get_next_due_date(self.id, topic_id)&lt;br /&gt;
    finished?(topic_id)? &amp;quot;Finished&amp;quot; : DeadlineType.find(due_date.deadline_type_id).name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactored get_current_stage with get_current_stage_name&lt;br /&gt;
&lt;br /&gt;
[[File:Get current stage name.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 5'''===&lt;br /&gt;
&lt;br /&gt;
current_stage_name(topic_id=nil) method was implementing things which was already being done by other methods and thus this method was redundant. &lt;br /&gt;
The initial code given was:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def current_stage_name(topic_id = nil)&lt;br /&gt;
    if self.staggered_deadline?&lt;br /&gt;
      return (topic_id.nil? ? 'Unknown' : get_current_stage(topic_id))&lt;br /&gt;
    end&lt;br /&gt;
    due_date = find_current_stage(topic_id)&lt;br /&gt;
&lt;br /&gt;
    unless self.staggered_deadline?&lt;br /&gt;
      if due_date != 'Finished' &amp;amp;&amp;amp; !due_date.nil? &amp;amp;&amp;amp; !due_date.deadline_name.nil?&lt;br /&gt;
        return due_date.deadline_name&lt;br /&gt;
      else&lt;br /&gt;
        return get_current_stage(topic_id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First thing we noticed was that due_date.deadline_name was always nil because there was no field to enter the deadline name on the form, and therefore, the statement  &amp;lt;pre&amp;gt; return due_date.deadline_name &amp;lt;/pre&amp;gt; was never getting executed. &lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
This method was checking for the due_date.deadline_name which was always nil. After removing the dead code, we get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def current_stage_name(topic_id = nil)&lt;br /&gt;
    if topic_missing?(topic_id)&lt;br /&gt;
      return 'Unknown'&lt;br /&gt;
    else&lt;br /&gt;
      get_current_stage(topic_id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the get_current_stage_name(topic_id=nil) method shown below and comparing it to what we have above, this code was surely redundant.That is why we removed this code and made appropriate changes wherever required within assignment.rb.&lt;br /&gt;
*Below is the get_current_stage_name method for reference&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_current_stage_name(topic_id = nil)&lt;br /&gt;
    return 'Unknown' if topic_missing?(topic_id)&lt;br /&gt;
    due_date = DueDate.get_next_due_date(self.id, topic_id)&lt;br /&gt;
    finished?(topic_id)? &amp;quot;Finished&amp;quot; : DeadlineType.find(due_date.deadline_type_id).name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After removing the current_stage_name method, its uses were replaced with get_current_stage_name. One example of the refactoring is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Current_stage.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The associated rspec tests that tested the current_stage method were also no longer needed.&lt;br /&gt;
&lt;br /&gt;
==='''Problem 6'''===&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
=='''Automated Testing using RSPEC'''==&lt;br /&gt;
&lt;br /&gt;
===='''Tests for get_current_stage_name'''====&lt;br /&gt;
&lt;br /&gt;
The current version of expertiza did not have any tests for get_current_stage(topic_id=nil) method.Now as we have changed it to get_current_stage_name(topic_id=nil),we have added its tests as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#get_current_stage_name' do&lt;br /&gt;
    context 'when topic id is nil and current assignment has staggered deadline' do&lt;br /&gt;
      it 'returns Unknown' do&lt;br /&gt;
        allow(assignment).to receive(:topic_missing?).and_return(true)&lt;br /&gt;
        expect(assignment.get_current_stage_name).to eq('Unknown')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current assignment does not have staggered deadline' do&lt;br /&gt;
      context 'when due date is nil' do&lt;br /&gt;
        it 'returns Finished' do&lt;br /&gt;
          allow(assignment).to receive(:finished?).with(123).and_return(true)&lt;br /&gt;
          expect(assignment.get_current_stage_name(123)).to eq('Finished')&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      context 'when due date is not nil and due date is not equal to Finished' do&lt;br /&gt;
        it 'returns current stage name' do&lt;br /&gt;
          allow(assignment).to receive(:finished?).with(123).and_return(false)&lt;br /&gt;
          allow(assignment).to receive(:topic_missing?).with(123).and_return(false)&lt;br /&gt;
          allow(DueDate).to receive(:get_next_due_date).with(1,123).and_return(assignment_due_date)&lt;br /&gt;
          deadline = create(:deadline_type, id: 1, name:&amp;quot;Review&amp;quot;)&lt;br /&gt;
          allow(DeadlineType).to receive(:find).with(1).and_return(deadline)&lt;br /&gt;
          expect(assignment.get_current_stage_name(123)).to eq('Review')&lt;br /&gt;
        end&lt;br /&gt;
      end &lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===='''Tests for finished?'''====&lt;br /&gt;
&lt;br /&gt;
We have added tests for the new method that we have added finished?.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#finished?' do&lt;br /&gt;
    context 'when assignment next due date is nil' do&lt;br /&gt;
      it 'returns True' do&lt;br /&gt;
        allow(DueDate).to receive(:get_next_due_date).with(1, 123).and_return(nil)&lt;br /&gt;
        expect(assignment.finished?(123)).to eq(TRUE)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  describe '#finished?' do&lt;br /&gt;
    context 'when there is a next due date' do&lt;br /&gt;
      it 'returns False' do&lt;br /&gt;
        allow(DueDate).to receive(:get_next_due_date).with(1, 123).and_return('2021-11-11 11:11:11')&lt;br /&gt;
        expect(assignment.finished?(123)).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As topic_missing? method is made private,there was no need to test this.&lt;br /&gt;
&lt;br /&gt;
===='''Tests for stage_deadline'''====&lt;br /&gt;
&lt;br /&gt;
We also have corrected the tests for stage_deadline according to the modifications done(It is using finished? and topic_missing? methods).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#stage_deadline' do&lt;br /&gt;
    context 'when topic id is nil and current assignment has staggered deadline' do&lt;br /&gt;
      it 'returns Unknown' do&lt;br /&gt;
        allow(assignment).to receive(:topic_missing?).and_return(true)&lt;br /&gt;
        expect(assignment.stage_deadline).to eq('Unknown')&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    context 'when current assignment does not have staggered deadline' do&lt;br /&gt;
      context 'when due date is nil' do&lt;br /&gt;
        it 'returns nil' do&lt;br /&gt;
          allow(assignment).to receive(:finished?).with(123).and_return(true)&lt;br /&gt;
          expect(assignment.stage_deadline(123)).to be nil&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      context 'when due date is not nil and due date is not equal to Finished' do&lt;br /&gt;
        it 'returns due date' do&lt;br /&gt;
          allow(assignment).to receive(:finished?).with(123).and_return(false)&lt;br /&gt;
          allow(DueDate).to receive(:get_next_due_date).with(1, 123).and_return(assignment_due_date)&lt;br /&gt;
          expect(assignment.stage_deadline(123)).to match('2011-11-11 11:11:11')&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end &lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Team'''==&lt;br /&gt;
[mailto:jwboykin@ncsu.edu Jimmy Boykin]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:rkaur@ncsu.edu Ramandeep Kaur]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:sbasnet2@ncsu.edu Sushan Basnet]&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=121948</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1906. Refactor stage deadlines in Assignment.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=121948"/>
		<updated>2019-03-24T22:23:27Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1906 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
=='''Expertiza Background'''==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a web application developed using Ruby on Rails Framework whose creation and maintenance is taken care of by students as well as the faculty of NCSU.It's code is available on Github [https://github.com/expertiza/expertiza Expertiza on GitHub].Expertiza allows the instructor to create and edit new as well as existing assignments.This also includes creating a wide range of topics under each assignment which students can sign up for.They can also publish surveys and reviews,view statistical results, set deadlines for assignments and make announcements.It provides a platform for students to signup for topics,form teams,view and submit assignments and give peer reviews and feedback.&lt;br /&gt;
&lt;br /&gt;
=='''Stage Deadline Background'''==&lt;br /&gt;
An assignment in Expertiza has many deadlines possible: deadlines for submission and review in each round,deadlines for signing up and dropping topics,submitting meta-reviews,etc.Depending on what the next deadline is,an Expertiza assignment is said to be in a particular kind of what is called &amp;quot;stage&amp;quot;.For example,if the next deadline(after the current time) is a submission deadline which is a DueDate object,then the assignment is said to be in a &amp;quot;submission&amp;quot; phase.&lt;br /&gt;
&lt;br /&gt;
[[File: StageBackground.png|center]]&lt;br /&gt;
&lt;br /&gt;
Depending on which stage an assignment is in, certain activities may be permissible or impermissible.For example, the default for a submission stage is to allow submission but not review,and in a review stage,the default is to allow review but not submission.These defaults may be changed by checking the relevant boxes on the Due Dates tab of assignment creation or editing.In the figure below it can be seen the &amp;quot;Other's work&amp;quot; link is grayed out as review is not permissible during submission phase.&lt;br /&gt;
&lt;br /&gt;
[[File: Statusinadeadline.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Problem Statement'''==&lt;br /&gt;
E1906 is an Expertiza based OSS project which deals basically with refactoring stage deadlines in assignment.rb file.Class assignment.rb has several methods for checking what kind of stage an assignment is in at the current time.These are:&lt;br /&gt;
&lt;br /&gt;
* current_stage_name(topic_id = nil)&lt;br /&gt;
* find_current_stage(topic_id = nil)&lt;br /&gt;
* get_current_stage(topic_id = nil)&lt;br /&gt;
* link_for_current_stage(topic_id = nil)&lt;br /&gt;
* stage_deadline(topic_id = nil)&lt;br /&gt;
&lt;br /&gt;
The goal of the project focuses on refactoring some of the above more complex methods, modifying some of the language to make it more Ruby friendly, removing some redundant code. This project is basically an attempt to make this part of the application easier to read and maintain.&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
==='''Problem 1'''===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above methods were being used at various places to check if the assignment is 'Finished' which made the code very redundant. Assignment is said to be finished if the next_due_date is nil.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have created a new method &amp;quot;finished?&amp;quot; that checks if the next_due_date is nil (which means that the assignment is &amp;quot;finished&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # New function to check if the assignment is finished&lt;br /&gt;
  def finished?( topic_id = nil )&lt;br /&gt;
    DueDate.get_next_due_date(self.id, topic_id).nil?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have called this method at all the places where previously different methods were being used to check the same thing.&lt;br /&gt;
*Signup sheet table uses assignment finished? method instead of current_stage_name&lt;br /&gt;
[[File:Problem1_1.png‎|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Use assignment finished? method where only a comparison to &amp;quot;Finished&amp;quot; was being done using get_current_stage and find_current_stage&lt;br /&gt;
[[File:Problem1_2.png|center]] [[File:Problem1_3.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 2'''===&lt;br /&gt;
&lt;br /&gt;
The check for a topic_id to be nil when it is a staggered assignment and return 'Unknown' when it is true was being done at many places.This was not following Ruby and Rails rules.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
To make the code DRY and more easy to understand,we have created a new private method &amp;quot;topic_missing?&amp;quot; to check if the topic_id is nil in case of staggered assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Function to check if topic id is null when its a staggered assignment&lt;br /&gt;
  def topic_missing?( topic_id = nil)&lt;br /&gt;
    topic_id.nil? and self.staggered_deadline?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactoring with new method topic_missing?&lt;br /&gt;
&lt;br /&gt;
[[File:Topic missing.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 3'''===&lt;br /&gt;
&lt;br /&gt;
get_current_stage method is returning the stage name which the assignment is in at current time.This is not very clear from the name of the method.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have changed the method name to get_current_stage_name(topic_id=nil) to make it more clear to understand.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Function to check if topic id is null when its a staggered assignment&lt;br /&gt;
  def topic_missing?( topic_id = nil)&lt;br /&gt;
    topic_id.nil? and self.staggered_deadline?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactored get_current_stage with get_current_stage_name&lt;br /&gt;
&lt;br /&gt;
[[File:Get current stage name.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 4'''===&lt;br /&gt;
&lt;br /&gt;
current_stage_name(topic_id=nil) method was implementing things which was already being done by other methods and thus this method was redundant. &lt;br /&gt;
The initial code given was:&lt;br /&gt;
&lt;br /&gt;
[[File:csn2.png]]&lt;br /&gt;
&lt;br /&gt;
First thing we noticed was that due_date.deadline_name was always nil because there was no field to enter the deadline name on the form, and therefore, the statement  &amp;lt;pre&amp;gt; return due_date.deadline_name &amp;lt;/pre&amp;gt; was never getting executed. &lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
This method was checking for the due_date.deadline_name which was always nil. After removing the dead code, we get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def current_stage_name(topic_id = nil)&lt;br /&gt;
    if self.staggered_deadline? and topic_id.nil?&lt;br /&gt;
      return 'Unknown'&lt;br /&gt;
    else&lt;br /&gt;
      get_current_stage(topic_id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the get_current_stage_name(topic_id=nil) method shown below and comparing it to what we have above, this code was surely redundant.That is why we removed this code and made appropriate changes wherever required within assignment.rb.&lt;br /&gt;
*Below is the get_current_stage_name method for reference*&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def get_current_stage_name(topic_id = nil)&lt;br /&gt;
     return 'Unknown' if topic_missing?(topic_id)&lt;br /&gt;
     finished?(topic_id)? &amp;quot;Finished&amp;quot; : DeadlineType.find(due_date.deadline_type_id).name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After removing the current_stage_name method, its uses were replaced with get_current_stage_name. One example of the refactoring is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:Current_stage.png|center]]&lt;br /&gt;
&lt;br /&gt;
The associated rspec tests that tested the current_stage method were also no longer needed. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Team'''==&lt;br /&gt;
[mailto:jwboykin@ncsu.edu Jimmy Boykin]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:rkaur@ncsu.edu Ramandeep Kaur]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:sbasnet2@ncsu.edu Sushan Basnet]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Csn2.png&amp;diff=121941</id>
		<title>File:Csn2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Csn2.png&amp;diff=121941"/>
		<updated>2019-03-24T22:01:23Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: uploaded a new version of &amp;amp;quot;File:Csn2.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Csn2.png&amp;diff=121940</id>
		<title>File:Csn2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Csn2.png&amp;diff=121940"/>
		<updated>2019-03-24T21:58:21Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=121935</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1906. Refactor stage deadlines in Assignment.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1906._Refactor_stage_deadlines_in_Assignment.rb&amp;diff=121935"/>
		<updated>2019-03-24T21:50:28Z</updated>

		<summary type="html">&lt;p&gt;Sbasnet2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made under E1906 OSS assignment for Spring 2019, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
=='''Expertiza Background'''==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is a web application developed using Ruby on Rails Framework whose creation and maintenance is taken care of by students as well as the faculty of NCSU.It's code is available on Github [https://github.com/expertiza/expertiza Expertiza on GitHub].Expertiza allows the instructor to create and edit new as well as existing assignments.This also includes creating a wide range of topics under each assignment which students can sign up for.They can also publish surveys and reviews,view statistical results, set deadlines for assignments and make announcements.It provides a platform for students to signup for topics,form teams,view and submit assignments and give peer reviews and feedback.&lt;br /&gt;
&lt;br /&gt;
=='''Stage Deadline Background'''==&lt;br /&gt;
An assignment in Expertiza has many deadlines possible: deadlines for submission and review in each round,deadlines for signing up and dropping topics,submitting meta-reviews,etc.Depending on what the next deadline is,an Expertiza assignment is said to be in a particular kind of what is called &amp;quot;stage&amp;quot;.For example,if the next deadline(after the current time) is a submission deadline which is a DueDate object,then the assignment is said to be in a &amp;quot;submission&amp;quot; phase.&lt;br /&gt;
&lt;br /&gt;
[[File: StageBackground.png|center]]&lt;br /&gt;
&lt;br /&gt;
Depending on which stage an assignment is in, certain activities may be permissible or impermissible.For example, the default for a submission stage is to allow submission but not review,and in a review stage,the default is to allow review but not submission.These defaults may be changed by checking the relevant boxes on the Due Dates tab of assignment creation or editing.In the figure below it can be seen the &amp;quot;Other's work&amp;quot; link is grayed out as review is not permissible during submission phase.&lt;br /&gt;
&lt;br /&gt;
[[File: Statusinadeadline.jpg|center]]&lt;br /&gt;
&lt;br /&gt;
=='''Problem Statement'''==&lt;br /&gt;
E1906 is an Expertiza based OSS project which deals basically with refactoring stage deadlines in assignment.rb file.Class assignment.rb has several methods for checking what kind of stage an assignment is in at the current time.These are:&lt;br /&gt;
&lt;br /&gt;
* current_stage_name(topic_id = nil)&lt;br /&gt;
* find_current_stage(topic_id = nil)&lt;br /&gt;
* get_current_stage(topic_id = nil)&lt;br /&gt;
* link_for_current_stage(topic_id = nil)&lt;br /&gt;
* stage_deadline(topic_id = nil)&lt;br /&gt;
&lt;br /&gt;
The goal of the project focuses on refactoring some of the above more complex methods, modifying some of the language to make it more Ruby friendly, removing some redundant code. This project is basically an attempt to make this part of the application easier to read and maintain.&lt;br /&gt;
&lt;br /&gt;
=='''Solutions Implemented'''==&lt;br /&gt;
==='''Problem 1'''===&lt;br /&gt;
&lt;br /&gt;
The above methods were being used at various places to check if the assignment is 'Finished' which made the code very redundant. Assignment is said to be finished if the next_due_date is nil.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have created a new method &amp;quot;finished?&amp;quot; that checks if the next_due_date is nil (which means that the assignment is &amp;quot;finished&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # New function to check if the assignment is finished&lt;br /&gt;
  def finished?( topic_id = nil )&lt;br /&gt;
    DueDate.get_next_due_date(self.id, topic_id).nil?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have called this method at all the places where previously different methods were being used to check the same thing.&lt;br /&gt;
*Signup sheet table uses assignment finished? method instead of current_stage_name&lt;br /&gt;
[[File:Problem1_1.png‎|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Use assignment finished? method where only a comparison to &amp;quot;Finished&amp;quot; was being done using get_current_stage and find_current_stage&lt;br /&gt;
[[File:Problem1_2.png|center]] [[File:Problem1_3.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 2'''===&lt;br /&gt;
&lt;br /&gt;
The check for a topic_id to be nil when it is a staggered assignment and return 'Unknown' when it is true was being done at many places.This was not following Ruby and Rails rules.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
To make the code DRY and more easy to understand,we have created a new private method &amp;quot;topic_missing?&amp;quot; to check if the topic_id is nil in case of staggered assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Function to check if topic id is null when its a staggered assignment&lt;br /&gt;
  def topic_missing?( topic_id = nil)&lt;br /&gt;
    topic_id.nil? and self.staggered_deadline?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactoring with new method topic_missing?&lt;br /&gt;
&lt;br /&gt;
[[File:Topic missing.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 3'''===&lt;br /&gt;
&lt;br /&gt;
get_current_stage method is returning the stage name which the assignment is in at current time.This is not very clear from the name of the method.&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
We have changed the method name to get_current_stage_name(topic_id=nil) to make it more clear to understand.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  # Function to check if topic id is null when its a staggered assignment&lt;br /&gt;
  def topic_missing?( topic_id = nil)&lt;br /&gt;
    topic_id.nil? and self.staggered_deadline?&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactored get_current_stage with get_current_stage_name&lt;br /&gt;
&lt;br /&gt;
[[File:Get current stage name.png|center]]&lt;br /&gt;
&lt;br /&gt;
==='''Problem 4'''===&lt;br /&gt;
&lt;br /&gt;
current_stage_name(topic_id=nil) method was implementing things which was already being done by other methods and thus this method was redundant.The initial code given was:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def get_current_stage_name(topic_id = nil)&lt;br /&gt;
    return 'Unknown' if topic_missing?(topic_id)&lt;br /&gt;
    finished?(topic_id)? &amp;quot;Finished&amp;quot; : DeadlineType.find(due_date.deadline_type_id).name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===='''Solution'''====&lt;br /&gt;
&lt;br /&gt;
This method was returning due_date.deadline_name which will actually never be returned because it will always be nil as there is no feature to add deadline_name in Expertiza.After removing this part and simplifying it the code looked like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def current_stage_name(topic_id = nil)&lt;br /&gt;
    if self.staggered_deadline? and topic_id.nil?&lt;br /&gt;
      return 'Unknown'&lt;br /&gt;
    else&lt;br /&gt;
      get_current_stage(topic_id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking at the get_current_stage_name(topic_id=nil) method, this code was surely redundant.That is why we removed this code and made appropriate changes wherever required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def get_current_stage_name(topic_id = nil)&lt;br /&gt;
     return 'Unknown' if topic_missing?(topic_id)&lt;br /&gt;
     finished?(topic_id)? &amp;quot;Finished&amp;quot; : DeadlineType.find(due_date.deadline_type_id).name&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Refactored current_stage_name with get_current_stage_name&lt;br /&gt;
&lt;br /&gt;
[[File:Current_stage.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Team'''==&lt;br /&gt;
[mailto:jwboykin@ncsu.edu Jimmy Boykin]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:rkaur@ncsu.edu Ramandeep Kaur]&amp;lt;br&amp;gt;&lt;br /&gt;
[mailto:sbasnet2@ncsu.edu Sushan Basnet]&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;/div&gt;</summary>
		<author><name>Sbasnet2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Current_stage_name_initial.png&amp;diff=121931</id>
		<title>File:Current stage name initial.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Current_stage_name_initial.png&amp;diff=121931"/>
		<updated>2019-03-24T21:49:38Z</updated>

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