<?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=Jjjagtap</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=Jjjagtap"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jjjagtap"/>
	<updated>2026-09-19T17:14:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127866</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127866"/>
		<updated>2019-11-07T03:05:19Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Automated Test Cases for new late policy validations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message.&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
	#validaes penalty per unit field&lt;br /&gt;
	describe 'validate penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates max_penalty field&lt;br /&gt;
	describe 'validate max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates penalty unit field&lt;br /&gt;
	describe 'validate penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe 'validate times_used backgorund field' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates policy_name field&lt;br /&gt;
	describe 'validate policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id. This session variable gets overwritten every time whenever an edit page for the new assignment is opened. So the bug in the back link is fixed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Click on Create button without entering any details    ====&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter the policy name which already exists. You can find it out on list of policies page.    ====&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter alphabet or string in penalty per unit field    ====&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Max Penalty cannot be greater than or equal to 50. Try entering a larger number ====&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====   Enter valid data in all fields. ====&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
====Test Case log after running rspec file====&lt;br /&gt;
[[File:Testrspec.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Test Cases for back link ====&lt;br /&gt;
There are three different cases covered under the back link testing on the new late policy page.&lt;br /&gt;
&lt;br /&gt;
===== Test Case 1: Back Link directly from new late policy page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
It is redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 2: Back Link after error on validation =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Click on create without Entering values -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
An error message is shown regarding the validations when the create button is clicked. When the Back button is clicked at this stage,  it is &lt;br /&gt;
redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 3: Back Link after visiting the index page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Submit a policy -&amp;gt; Create New policy -&amp;gt; Back&lt;br /&gt;
&lt;br /&gt;
Once a policy is created we are redirected to the index page of the policies which lists all the policies available. Now if we try to create a new policy from here and click on the Back button after that, we are redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
27.125%&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127863</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127863"/>
		<updated>2019-11-07T03:03:46Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Automated Test Cases for new late policy validations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message.&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
	#validaes penalty per unit field&lt;br /&gt;
	describe 'validate penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates max_penalty field&lt;br /&gt;
	describe 'validate max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates penalty unit field&lt;br /&gt;
	describe 'validate penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe 'validate times_used backgorund field' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates policy_name field&lt;br /&gt;
	describe 'validate policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id. This session variable gets overwritten every time whenever an edit page for the new assignment is opened. So the bug in the back link is fixed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Click on Create button without entering any details    ====&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter the policy name which already exists. You can find it out on list of policies page.    ====&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter alphabet or string in penalty per unit field    ====&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Max Penalty cannot be greater than or equal to 50. Try entering a larger number ====&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====   Enter valid data in all fields. ====&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:Testrspec.PNG]]&lt;br /&gt;
&lt;br /&gt;
==== Test Cases for back link ====&lt;br /&gt;
There are three different cases covered under the back link testing on the new late policy page.&lt;br /&gt;
&lt;br /&gt;
===== Test Case 1: Back Link directly from new late policy page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
It is redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 2: Back Link after error on validation =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Click on create without Entering values -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
An error message is shown regarding the validations when the create button is clicked. When the Back button is clicked at this stage,  it is &lt;br /&gt;
redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 3: Back Link after visiting the index page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Submit a policy -&amp;gt; Create New policy -&amp;gt; Back&lt;br /&gt;
&lt;br /&gt;
Once a policy is created we are redirected to the index page of the policies which lists all the policies available. Now if we try to create a new policy from here and click on the Back button after that, we are redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
27.125%&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127857</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=127857"/>
		<updated>2019-11-07T03:02:13Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Automated Test Cases for new late policy validations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message.&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
	#validaes penalty per unit field&lt;br /&gt;
	describe 'validate penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates max_penalty field&lt;br /&gt;
	describe 'validate max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates penalty unit field&lt;br /&gt;
	describe 'validate penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe 'validate times_used backgorund field' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates policy_name field&lt;br /&gt;
	describe 'validate policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id. This session variable gets overwritten every time whenever an edit page for the new assignment is opened. So the bug in the back link is fixed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Click on Create button without entering any details    ====&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter the policy name which already exists. You can find it out on list of policies page.    ====&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Enter alphabet or string in penalty per unit field    ====&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====    Max Penalty cannot be greater than or equal to 50. Try entering a larger number ====&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====   Enter valid data in all fields. ====&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
[[File:Testrspec.png]]&lt;br /&gt;
&lt;br /&gt;
==== Test Cases for back link ====&lt;br /&gt;
There are three different cases covered under the back link testing on the new late policy page.&lt;br /&gt;
&lt;br /&gt;
===== Test Case 1: Back Link directly from new late policy page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
It is redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 2: Back Link after error on validation =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Click on create without Entering values -&amp;gt; Back.&lt;br /&gt;
&lt;br /&gt;
An error message is shown regarding the validations when the create button is clicked. When the Back button is clicked at this stage,  it is &lt;br /&gt;
redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== Test Case 3: Back Link after visiting the index page =====&lt;br /&gt;
Flow: Assignments -&amp;gt; Edit Button -&amp;gt; Due Dates Tab -&amp;gt; New Late Policy -&amp;gt; Submit a policy -&amp;gt; Create New policy -&amp;gt; Back&lt;br /&gt;
&lt;br /&gt;
Once a policy is created we are redirected to the index page of the policies which lists all the policies available. Now if we try to create a new policy from here and click on the Back button after that, we are redirected to the due dates tab of that assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
27.125%&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrspec.PNG&amp;diff=127850</id>
		<title>File:Testrspec.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrspec.PNG&amp;diff=127850"/>
		<updated>2019-11-07T02:59:47Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrspec.png&amp;diff=127847</id>
		<title>File:Testrspec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Testrspec.png&amp;diff=127847"/>
		<updated>2019-11-07T02:58:05Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Rspec.png&amp;diff=127846</id>
		<title>File:Rspec.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Rspec.png&amp;diff=127846"/>
		<updated>2019-11-07T02:57:16Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: uploaded a new version of &amp;amp;quot;File:Rspec.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;testing rspec file&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126843</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126843"/>
		<updated>2019-11-02T01:31:27Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
	#validaes penalty per unit field&lt;br /&gt;
	describe 'validate penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates max_penalty field&lt;br /&gt;
	describe 'validate max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates penalty unit field&lt;br /&gt;
	describe 'validate penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe 'validate times_used backgorund field' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	#validates policy_name field&lt;br /&gt;
	describe 'validate policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
end&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;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id. This session variable get overwritten every time whenever an edit page for new assignment is opened. So the bug in the back link is fixed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126840</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126840"/>
		<updated>2019-11-02T01:05:21Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Automated Test Cases for new late policy validations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126839</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126839"/>
		<updated>2019-11-02T01:04:43Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126838</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126838"/>
		<updated>2019-11-02T01:04:24Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
'''File created:''' spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126837</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126837"/>
		<updated>2019-11-02T01:04:00Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
'''File created:'''spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126836</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126836"/>
		<updated>2019-11-02T01:03:29Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection. A new late policy must not be created if any of these validations fail.&lt;br /&gt;
'''File created:'''spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126835</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126835"/>
		<updated>2019-11-02T01:02:48Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the Test Plan subsection.&lt;br /&gt;
'''File created:'''spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126834</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126834"/>
		<updated>2019-11-02T01:01:24Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 1: Failure to create a new policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The test cases have been mentioned in Test Plan section automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
A new Rspec File has been written to carry out the automatic testing. All the test cases have been mentioned in the [[Media:Example.ogg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126833</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126833"/>
		<updated>2019-11-02T00:56:32Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 1: Failure to create a new policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
'''Updated File:''' app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126832</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126832"/>
		<updated>2019-11-02T00:56:12Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 2: Back link redirects to the wrong page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
Updated File: app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
&lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126831</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126831"/>
		<updated>2019-11-02T00:56:01Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 2: Back link redirects to the wrong page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
Updated File: app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
'''Solution''' &lt;br /&gt;
We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126830</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126830"/>
		<updated>2019-11-02T00:55:36Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 1: Failure to create a new policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
'''Solution'''&lt;br /&gt;
&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
Updated File: app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126829</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126829"/>
		<updated>2019-11-02T00:52:51Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem 1: Failure to create a new policy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
Solution:&lt;br /&gt;
There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
A new late policy would not be created if any of the validations fail and the user would be notified of the errors by a flash error message&lt;br /&gt;
&lt;br /&gt;
Updated File: app/views/late_policies/new.html.erb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;% flash[:error] = @late_policy.errors.full_messages.join(&amp;quot;&amp;lt;br/&amp;gt;&amp;quot;).html_safe %&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126828</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126828"/>
		<updated>2019-11-02T00:45:37Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Team Information: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126827</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126827"/>
		<updated>2019-11-02T00:45:24Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Code Coverage: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage==&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126826</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126826"/>
		<updated>2019-11-02T00:44:49Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Tasks Accomplished: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126825</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126825"/>
		<updated>2019-11-02T00:43:56Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
====Manual Testing via UI====&lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
====Automated Test Cases for new late policy validations====&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126824</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126824"/>
		<updated>2019-11-02T00:43:19Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
''' update method at app/controllers/assignments_controller.rb '''    &lt;br /&gt;
&amp;lt;pre&amp;gt; session[:assignment_id] = @assignment_form.assignment.id  &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment_id] , :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    redirect_to action: 'index', id: params[:late_policy][:assign_id]    &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
&amp;lt;pre&amp;gt;    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126822</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126822"/>
		<updated>2019-11-02T00:42:17Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126821</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126821"/>
		<updated>2019-11-02T00:42:01Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
====Problem 1: Failure to create a new policy====&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Problem 2: Back link redirects to the wrong page====&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126820</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126820"/>
		<updated>2019-11-02T00:41:26Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Project Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126819</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126819"/>
		<updated>2019-11-02T00:40:53Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
===='''Problem Statement'''====&lt;br /&gt;
E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link&lt;br /&gt;
&lt;br /&gt;
===='''Background'''====&lt;br /&gt;
&lt;br /&gt;
: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
===='''Issue 1:'''====&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
===='''Issue 2:'''====&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Newpolicy1.png&amp;diff=126818</id>
		<title>File:Newpolicy1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Newpolicy1.png&amp;diff=126818"/>
		<updated>2019-11-01T22:24:56Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_late_policy_test1.png&amp;diff=126817</id>
		<title>File:New late policy test1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_late_policy_test1.png&amp;diff=126817"/>
		<updated>2019-11-01T22:20:53Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126816</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126816"/>
		<updated>2019-11-01T22:10:06Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Automated Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126815</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126815"/>
		<updated>2019-11-01T22:09:13Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126814</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126814"/>
		<updated>2019-11-01T22:08:45Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Test Cases for new late policy validations:'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
describe LatePolicy do&lt;br /&gt;
	let(:policy) do&lt;br /&gt;
		LatePolicy.new penalty_per_unit: 10.0, max_penalty: 30, penalty_unit: &amp;quot;Day&amp;quot;, times_used: 0, instructor_id: 6, policy_name: 'rspectest'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_per_unit' do&lt;br /&gt;
		it 'returns the penalty_per_unit' do&lt;br /&gt;
			expect(policy.penalty_per_unit).to eq(10.0)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		it 'Validate presence of penalty_per_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_per_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if penalty_per_unit is less than max_penalty' do&lt;br /&gt;
      			policy.max_penalty = 20&lt;br /&gt;
			policy.penalty_per_unit = 30&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#max_penalty' do&lt;br /&gt;
		it 'returns the max_penalty' do&lt;br /&gt;
			expect(policy.max_penalty).to eq(30)&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of max_penalty which cannot be blank' do&lt;br /&gt;
      			policy.max_penalty = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
		it 'Validate if max_penalty is less tha 50' do&lt;br /&gt;
      			policy.max_penalty = 60&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#penalty_unit' do&lt;br /&gt;
		it 'returns the penalty_unit' do&lt;br /&gt;
			expect(policy.penalty_unit).to eq('Day')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of penalty_unit which cannot be blank' do&lt;br /&gt;
      			policy.penalty_unit = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&lt;br /&gt;
    		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#times_used' do&lt;br /&gt;
		it 'returns times_used' do&lt;br /&gt;
			expect(policy.times_used).to eq(0)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	describe '#policy_name' do&lt;br /&gt;
		it 'returns the policy name' do&lt;br /&gt;
			expect(policy.policy_name).to eq('rspectest')&lt;br /&gt;
		end&lt;br /&gt;
		it 'Validate presence of policy name which cannot be blank' do&lt;br /&gt;
      			policy.policy_name = nil&lt;br /&gt;
      			expect(policy).not_to be_valid&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;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126813</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126813"/>
		<updated>2019-11-01T22:06:26Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy!&lt;br /&gt;
&lt;br /&gt;
'''Test Cases for new late policy validations:'''&lt;br /&gt;
A new late policy must not be created if any of these validations fail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; Late Policy Name&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy Name must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Late Policy must be unique&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Penalty Points per unit&lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Penalty points must be a number&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;penalty points must be less than total penalty points&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;Maximum Penalty &lt;br /&gt;
    &amp;lt;ol&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must not be blank&amp;lt;/li&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;Maximum Penalty must be less than 50&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;/ol&amp;gt;&lt;br /&gt;
  &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All these test cases have been automatically tested by writing a new RSpec file: spec/models/late_policy_spec.rb&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
==Code Coverage:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126809</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126809"/>
		<updated>2019-11-01T21:06:42Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @late_policy.errors.any? %&amp;gt;&lt;br /&gt;
  &amp;lt;div id=&amp;quot;error_explanation&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;h2&amp;gt;&lt;br /&gt;
      &amp;lt;%= pluralize(@late_policy.errors.count, &amp;quot;error&amp;quot;) %&amp;gt;&lt;br /&gt;
      prohibited this post from being saved:&lt;br /&gt;
    &amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;ul&amp;gt;&lt;br /&gt;
    &amp;lt;% @late_policy.errors.full_messages.each do |msg| %&amp;gt;&lt;br /&gt;
      &amp;lt;li&amp;gt;&amp;lt;%= msg %&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;/ul&amp;gt;&lt;br /&gt;
  &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link/ Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126804</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126804"/>
		<updated>2019-11-01T20:59:46Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png|500px]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png|500px]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png|500px]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126803</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126803"/>
		<updated>2019-11-01T20:58:31Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]|500px]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]|500px]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]|500px]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]|500px]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]|500px]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126802</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126802"/>
		<updated>2019-11-01T20:54:39Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126801</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126801"/>
		<updated>2019-11-01T20:54:07Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
==Tasks Accomplished:==&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126800</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126800"/>
		<updated>2019-11-01T20:53:12Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126799</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126799"/>
		<updated>2019-11-01T20:52:24Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== About Expertiza ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
== Peer Review Information ==&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
== Current Implementation ==&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Problems in Current Implementation ==&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Solutions to Problems in Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
'''Test Plan'''&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
== Team Information: ==&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126797</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126797"/>
		<updated>2019-11-01T20:49:52Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
'''Test Plan'''&lt;br /&gt;
abs&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126796</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126796"/>
		<updated>2019-11-01T20:48:41Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
1. Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
2. Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
3. Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126795</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126795"/>
		<updated>2019-11-01T20:47:05Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Team Information: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126793</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126793"/>
		<updated>2019-11-01T20:44:36Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
'''Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126792</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126792"/>
		<updated>2019-11-01T20:43:42Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Solutions to Problems in Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126791</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126791"/>
		<updated>2019-11-01T20:40:47Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
&lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126790</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126790"/>
		<updated>2019-11-01T20:40:34Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
6. Create/test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126789</id>
		<title>CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing &quot;Back&quot; link</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link&amp;diff=126789"/>
		<updated>2019-11-01T20:39:46Z</updated>

		<summary type="html">&lt;p&gt;Jjjagtap: /* Peer Review Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== About Expertiza ===&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open-source project based on 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&lt;br /&gt;
&lt;br /&gt;
=== Peer Review Information ===&lt;br /&gt;
&lt;br /&gt;
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:&lt;br /&gt;
Instructor Login: username -&amp;gt; instructor6, password -&amp;gt; password&lt;br /&gt;
&lt;br /&gt;
'''Navigation to test via UI''': &lt;br /&gt;
1. Login to expertiza using the above credentials.&lt;br /&gt;
2. Click on Assignments under Manage Notifications.&lt;br /&gt;
3. Click on Edit icon under any of the Assignments.&lt;br /&gt;
4. Navigate to Due Dates Tab.&lt;br /&gt;
5. Scroll Down and click on &amp;quot;New Late Policy&amp;quot;.&lt;br /&gt;
6. Create and test new Late Policy !&lt;br /&gt;
&lt;br /&gt;
=== Problem Statement ===&lt;br /&gt;
'''E1960. Create new late policy successfully and fixing &amp;quot;Back&amp;quot; link''' &lt;br /&gt;
&lt;br /&gt;
Mentor: Yashad Trivedi (ytrived@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
'''Background''': An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission. &lt;br /&gt;
'''&lt;br /&gt;
Issue 1:'''&lt;br /&gt;
If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
'''Issue 2:'''&lt;br /&gt;
If an instructor, while creating a policy, clicks on &amp;quot;Back&amp;quot; link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current Implementation ===&lt;br /&gt;
'''Functionality:'''&lt;br /&gt;
An Instructor has the option to create new late policies to be applied to the assignments.&lt;br /&gt;
An Instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Problems in Current Implementation ===&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
The create button on the new page of late_policy is not working. &lt;br /&gt;
Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Solutions to Problems in Current Implementation ===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1: Failure to create a new policy'''&lt;br /&gt;
    Solution:&lt;br /&gt;
    There was no provision to handle the validations of the form in the new late_policy page.&lt;br /&gt;
&lt;br /&gt;
[[File:Case-1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-2.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-3.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-4.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Case-5.png]]&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
'''Problem 2: Back link redirects to the wrong page'''&lt;br /&gt;
An instructor can choose to go back to the previous page from the create new policy page.&lt;br /&gt;
When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page&lt;br /&gt;
&lt;br /&gt;
    Solution: &lt;br /&gt;
    We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, &lt;br /&gt;
    we can send it to this particular assignment with the help of assignment id.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/views/late_policies/new.html.erb'''&lt;br /&gt;
    &amp;lt;%= f.hidden_field :assign_id, value: params[:id] %&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller =&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; params[:id], :anchor =&amp;gt; &amp;quot;tabs-5&amp;quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''app/controllers/late_policies_controller.rb''' &lt;br /&gt;
    redirect_to action: 'index', id: params[:late_policy][:assign_id]&lt;br /&gt;
&lt;br /&gt;
''' app/views/late_policies/index.html.erb''' &lt;br /&gt;
    &amp;lt;%= link_to 'New late policy', :action =&amp;gt; 'new', :id =&amp;gt; params[:id]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 1'''&lt;br /&gt;
    Step 1: Click Back on Create New Policy page&lt;br /&gt;
[[File:Back-1.1.png]]&lt;br /&gt;
    Step 2: Redirected to the Due Dates tab of the assignment page it came from&lt;br /&gt;
[[File:Back-1.2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Back Case - 2'''&lt;br /&gt;
    Step 1: On Index Page of Late Policies. Click Create New Policy&lt;br /&gt;
[[File:Back-2.1.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 2: Click Back&lt;br /&gt;
[[File:Back-2.2d.png]]&lt;br /&gt;
&lt;br /&gt;
    Step 3: Redirected to the due dates tab of assignment page it came from&lt;br /&gt;
[[File:Back-2.3.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Tasks Accomplished:'''&lt;br /&gt;
Following tasks were accomplished in this project:&lt;br /&gt;
Corrected the code for the late_policies controller and new late_policy page.&lt;br /&gt;
Improved the code for the Back button inside the new late_policy page.&lt;br /&gt;
Added RSPEC test cases for testing changes done in late_policies Controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Information: ===&lt;br /&gt;
&lt;br /&gt;
Devarsh Shah&lt;br /&gt;
&lt;br /&gt;
Jay Jagtap&lt;br /&gt;
&lt;br /&gt;
Ritesh Ghorse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
2.[https://github.com/jayjagtap/expertiza/ GitHub Project Repository Fork]&lt;br /&gt;
&lt;br /&gt;
3.[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;br /&gt;
&lt;br /&gt;
4.[http://152.46.17.218:8080/ Demo Link]&lt;br /&gt;
&lt;br /&gt;
5.[http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1960._Create_new_late_policy_successfully_and_fixing_%22Back%22_link| Expertiza project documentation wiki]&lt;br /&gt;
&lt;br /&gt;
6.[https://relishapp.com/rspec Rspec Documentation]&lt;br /&gt;
&lt;br /&gt;
7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Jjjagtap</name></author>
	</entry>
</feed>