<?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=Nnegi2</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=Nnegi2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nnegi2"/>
	<updated>2026-09-05T13:22:09Z</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_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=131118</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=131118"/>
		<updated>2019-12-07T06:38:41Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=100&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 100&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added padding between the edit and delete links on index page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Hitissue11.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Hitissue2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Hitissue3.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Hitissue4.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Hitissue5.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
'''''Before fix'''''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Manual Testing ()'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''''Afterfix'''''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the controller 'late_policies_controller.rb' and model 'late_policy.rb' we created 2 test files late_policy_spec.rb and late_policies_controller_spec.rb. To write test cases we used rspec functions and tested the functions on the basis of :&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;What they returned&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which page got rendered&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which flash error got produced&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which method got called&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
We also used stubbing and mocking functions to carry out our tests. After executing our tests we got an increase in the overall code coverage of over 0.5% for each file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the results of SimpleCov gem highlighting the code coverage of our tests.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Testplanyess.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130908</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130908"/>
		<updated>2019-12-07T03:52:52Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=50&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 50&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added padding between the edit and delete links on index page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
'''''Before fix'''''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Manual Testing ()'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''''Afterfix'''''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test the controller 'late_policies_controller.rb' and model 'late_policy.rb' we created 2 test files late_policy_spec.rb and late_policies_controller_spec.rb. To write test cases we used rspec functions and tested the functions on the basis of :&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;What they returned&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which page got rendered&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which flash error got produced&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Which method got called&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
We also used stubbing and mocking functions to carry out our tests. After executing our tests we got an increase in the overall code coverage of over 0.5% for each file.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Here are the results of SimpleCov gem highlighting the code coverage of our tests.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130871</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130871"/>
		<updated>2019-12-07T03:37:54Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=50&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 50&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added padding between the edit and delete links on index page&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130870</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130870"/>
		<updated>2019-12-07T03:37:38Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=50&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 50&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added padding between the edit and delete links on index page&amp;lt;li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130850</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130850"/>
		<updated>2019-12-07T03:31:35Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=50&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 50&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130848</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=130848"/>
		<updated>2019-12-07T03:31:03Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach &amp;amp; Fix===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Renaming done on the UI as well as on the backend&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Varible names refactored appropritely&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Flash messages changed accordingly&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The error which is raised is due to the following validation present in the model late_policy.rb. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
     &amp;lt;h6&amp;gt;validates :max_penalty, numericality: {less_than: 50}&amp;lt;/h6&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;After discussing with professor we have decided to increase the max penalty limit to 100&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a flash error message in the create function of late_policies_controller.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    if params[:late_policy][:max_penalty].to_i&amp;gt;=50&lt;br /&gt;
      flash[:error] = &amp;quot;Maximum penalty cannot be greater than or equal to 50&amp;quot;&lt;br /&gt;
      invalid_max_penalty = true;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added a back link in which redirects the user to edit assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Saved the assignment object in a session variable when the user clicks on the the edit asignment icon&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also added a back button on index page since there was no direct way of going back to edit assignment page once a late policy was created&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
    &amp;lt;%= link_to 'Back', :controller=&amp;gt; 'assignments', :action =&amp;gt; 'edit', :id =&amp;gt; session[:assignment] %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 4: The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;While testing this issue we noticed that the functionality was working perfectly fine, however, it was not user friendly.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We decided to add a tooltip icon explaining how this functionality works&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We also inproved its UI by adding the alignment and padding.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Issue 5: Neither late_policy.rb nor late_policies_controller.rb have any tests at all.  Define a test plan, and write appropriate tests for these classes.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created and saved successfully without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the General tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update all the dates relative to the first date keeping the days gap between all the dates the same as before.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Rsz late policy.png]]&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Log in to Expertiza as an Instructor by entering the credentials: Username: instructor6, Password: password&lt;br /&gt;
&lt;br /&gt;
The following route is common to testing all the issues:&lt;br /&gt;
&lt;br /&gt;
                                Welcome page -&amp;gt; Manage Assignments -&amp;gt; Select a Course -&amp;gt; Select Edit option for any assignment -&amp;gt; Edit Assignment (General) -&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 1''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; No 'penalty policy' on the page. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 2''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Late policy is successfully created and saved. &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 3''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; New late policy -&amp;gt; Enter information and Create -&amp;gt; Back -&amp;gt; Edit Assignment (General) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 4''' - &amp;lt;pre&amp;gt; Due Dates -&amp;gt; Show/Hide Date Updater -&amp;gt; Enter number of days -&amp;gt; Hit + / - &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128490</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128490"/>
		<updated>2019-11-11T03:22:42Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Upload.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Approach.png]]&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128488</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128488"/>
		<updated>2019-11-11T03:21:52Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Upload.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Approach.jpg]]&lt;br /&gt;
&lt;br /&gt;
===Expected Results===&lt;br /&gt;
----&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
*  Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
*  Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
* Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
* Hitarth Shah (hshah4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
----&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/rajitnb/expertiza GitHub Project Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Approach.PNG&amp;diff=128485</id>
		<title>File:Approach.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Approach.PNG&amp;diff=128485"/>
		<updated>2019-11-11T03:21:13Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128461</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128461"/>
		<updated>2019-11-11T03:01:34Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Scope of the Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Upload.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Scope===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
1. Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
2. Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
1. Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
2. Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
3. Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
4. Hitarth Shah (hshah4@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128459</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128459"/>
		<updated>2019-11-11T03:01:12Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Scope of the Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Upload.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Scope of the Project===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - The scope of this issue is to change &amp;quot;penalty policy&amp;quot; to &amp;quot;late policy&amp;quot; on all the relevant UI screens (app/views/late_policies).&lt;br /&gt;
* '''Issue 2''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - The scope of this issue is to fix the function in ruby and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - The scope of this issue is to write test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to write tests for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Project Mentors===&lt;br /&gt;
----&lt;br /&gt;
1. Edward Gehringer (efg@ncsu.edu)&lt;br /&gt;
2. Ramya Vijayakumar (rvijaya4@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
----&lt;br /&gt;
1. Rajit Bharambe (rbharam@ncsu.edu)&lt;br /&gt;
2. Saahil Chawande (schawan@ncsu.edu)&lt;br /&gt;
3. Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
4. Hitarth Shah (hshah4@ncsu.edu)&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128447</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128447"/>
		<updated>2019-11-11T02:51:14Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
[[File:Upload.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Scope of the Project===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using Rspec'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to test late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use the Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128445</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128445"/>
		<updated>2019-11-11T02:50:18Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Fix issues related to deadlines and late policies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Scope of the Project===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using Rspec'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to test late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually runnung the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128442</id>
		<title>CSC/ECE 517 Fall 2019 - E1978. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=128442"/>
		<updated>2019-11-11T02:48:10Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Fix issues related to deadlines and late policies==&lt;br /&gt;
&lt;br /&gt;
This page gives a description of the issues and the approach towards solving them in the E1978. Fix issues related to deadlines and late policies project.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
===Problem Description===&lt;br /&gt;
----&lt;br /&gt;
Expertiza can automatically deduct points if a student is late in performing some action (e.g., submitting or reviewing). This is implemented by defining a new “late policy” and applying it to the assignment. Late policies are managed on the Due dates tab of assignment creation (or editing).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
----&lt;br /&gt;
The current implementation of Expertiza has the following Issues:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
* '''Issue 3''' - After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* '''Issue 4''' - The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work. Expertiza has a way of adjusting due dates for a new assignment. If a new assignment is created by copying an old assignment, the due dates are copied too. It is likely that sometimes the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.) is wished. To avoid the need to edit all the deadlines manually, Expertiza has a date updater. However, it does not work.&lt;br /&gt;
* '''Issue 5''' - Neither late_policy.rb nor late_policies_controller.rb have any tests at all.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Scope of the Project===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Issues described in the above section all exist in the Due Dates tab on the Edit Assignment page.&lt;br /&gt;
* '''Issue 1''' - Once this issue is fixed, the Due Dates tab while editing an assignment will have no ambiguity between &amp;quot;late policy&amp;quot; and &amp;quot;penalty policy&amp;quot;, as &amp;quot;late policy&amp;quot; will be used exclusively.&lt;br /&gt;
* '''Issue 2''' - Once this issue is fixed, late policies can be created without raising the &amp;quot;The following error occurred while saving the penalty policy:&amp;quot; error.&lt;br /&gt;
* '''Issue 3''' - Once this issue is fixed, the back link after creating a late policy will rightly take the user to the Edit Assignment page.&lt;br /&gt;
* '''Issue 4''' - Once this issue is fixed, &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater will work and update the dates as it is supposed to.&lt;br /&gt;
* '''Issue 5''' - The code coverage will definitely increase once tests for late_policy.rb and late_policies_controller.rb are written.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Approach===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Automated Testing Using Rspec'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
We plan to create two new files, late_policy_spec.rb and late_policies_controller_spec.rb to test late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''Coverage'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To make sure we are covering all of our code (100%) with test cases we will use Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually runnung the test file, the SimpleCov gem will highlight the lines of code which are being covered by our test cases in green color, and for those which are not being covered in red.&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Milestones===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''11/01''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/11''' – Create Design Doc&lt;br /&gt;
&lt;br /&gt;
'''11/15''' – setting up project environment and updating Design Doc &lt;br /&gt;
&lt;br /&gt;
'''11/25''' – Fix Issues 1,2 and 3 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''11/30''' – Fix issues 4 and 5 with well-defined test cases&lt;br /&gt;
&lt;br /&gt;
'''12/04''' – Update design doc and create &amp;amp; upload video&lt;br /&gt;
&lt;br /&gt;
'''12/06''' – Write tests for edge cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127704</id>
		<title>CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127704"/>
		<updated>2019-11-07T01:12:52Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1963 Changing assignment Participant role=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
 &lt;br /&gt;
* E1963 This project aims to enable the instructor to change the role of an assignment participant. There are two ways to add a new assignment participant, first being through the Add button on the assignment participant page. Another way is to import via a spreadsheet with the list of users that are to be added. The motivation of E1963 was to enable the instructors adding these users using either of the methods mentioned above to change these users' role. A user can have one of the following roles - participant, reader, reviewer, submitter.&lt;br /&gt;
&lt;br /&gt;
* The existing UI had the a dropdown that displayed the role of the user, we have added a Submit button below each dropdown to enable the instructor to change the role of the user. On clicking the submit button, the role associated with that user is changed in the persistent storage. We have also added a flash message which confirms the change to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following issues were targeted in this project:&lt;br /&gt;
* '''#1:'''  The instructor does not have the option to change the role of the user, once he/she has been added to the assignment. Thus, if the instructor wishes to change the role of a user from say a reviewer to a submitter, he/she is not able to save the changes.&lt;br /&gt;
* '''#2:''' With the changes made for the issue mentioned above, the instructor will be able to save the changes manually. We would like to maintain the same behavior when the assignment participants are imported from excel. Upon creating a new user using an Excel import, the user should have the role of a participant by default. An instructor was then unable to change the role of the assignment participant.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
 Manage Assignments -&amp;gt; Add new participant icon under Actions&lt;br /&gt;
&lt;br /&gt;
===Current implementation===&lt;br /&gt;
For each of the assignment participant record, there is a dropdown which contains the role of the participant. When the instructor attempts to change the value in the dropdown, it is not reflected in the backend, as there is no call associated with it, to submit the changes. Thus when the user revisits the page, the changes would he would have made are not retained. &lt;br /&gt;
&lt;br /&gt;
Authorization of the user is based on the flags can_submit, can_review and can_take_quiz flags, which are set to be true or false based on the role of the user. By default, the user is assigned the role of a participant in any assignment. Thus, the goal is to modify these flags and save them in the database when the role of the assignment participant is changed, so that it is a persistent change.&lt;br /&gt;
Authorization of the users based on the flags can be deduced as follows:&lt;br /&gt;
* Participant has can_submit=true, can_review=true and can_take_quiz=true&lt;br /&gt;
* Reader has can_submit= false, can_review=true and can_take_quiz= true&lt;br /&gt;
* Submitter has can_submit=true, can_review= false and can_take_quiz=false&lt;br /&gt;
* Reviewer has can_submit=false, can_review= true and can_take_quiz=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problems: &lt;br /&gt;
* 1. There is no way to change the role of the user, once the user has been added to the assignment as a participant. (Submit button now resolves this issue.)&lt;br /&gt;
* 2. Instructor is not given any confirmation that the role of the participant has been reverted to the original value once he/she navigates somewhere else. This is misleading for an instructor as the he/she might be under the impression that the changes he/she made have been saved. (Flash message now lets the user know about the change.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Snapshots depicting the issue===&lt;br /&gt;
&lt;br /&gt;
* As an Instructor, go to Manage Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot ManageAssignments.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on add participant &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot AssignmentParticipants copy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Note that the user on the first record is currently a &amp;quot;Reader&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Currently Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Change the role of the &amp;quot;Reader&amp;quot; to say &amp;quot;Submitter&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submitter.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refresh or re-navigate to this page and note that the changes are reverted&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot back to Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Changes are made in the partial for participants &amp;quot;_participant.rb&amp;quot;, so that the submit button is rendered on the view. &lt;br /&gt;
Upon changing the selected value for the user role, 'update_authorizations' method is called from participants controller which passes the participant id as a parameter to the method to change it's role in the database. The selected role is passed as a parameter 'authorization' to the update authorization method that updates the can_submit, can_take_quiz, and can_review flags appropriately for each role as described above for the selected participant id.&lt;br /&gt;
 &lt;br /&gt;
Implementing the above mentioned changes, allows the instructor to change the value of role in the dropdown which retains the corresponding record on tap of the Submit button. We have verified that the changes in the above mentioned flags are reflected in the database. The instructor will be presented with a success message on changing the role of the selected participant, on clicking submit. The instructor can revisit the page and expect the updated value to be retained. Both the problems listed above are taken care of such as the instructor is facilitated with an option to change the participant, as well as knows that the change made will be durable.&lt;br /&gt;
&lt;br /&gt;
===Snapshots after the changes===&lt;br /&gt;
&lt;br /&gt;
* Submit button has been added to each row of assignment participants&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submit Added 1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Change the &amp;quot;Reader&amp;quot; to &amp;quot;Submitter&amp;quot;, on the first record and click on submit. Changes have been persisted. Flash message confirmation is also provided to the Instructor to let him/her know of the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Additional Changes===&lt;br /&gt;
&amp;lt;i&amp;gt;(These changes were not part of the assigned issue E1963, these are additional issues that we encountered while fixing E1963)&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above-mentioned issue, we fixed a few other issues that we observed , which were relevant to Assignment Participant and Course Participant Controllers, namely:&lt;br /&gt;
&lt;br /&gt;
'''1. Export Details''' in Assignment Participants view: We noticed that a a blank csv file was getting generated on exporting detail button in Manage Assignments. We discovered that the reason for this issue is that in the import method, the model defined was that of AssignmentParticipant whereas all the parsing methods for export were present in Assignment model. We did the required changes, tested the functionality and note that this is working fine now.&lt;br /&gt;
The changes for this are made in the common module - export_file_controller.rb following which the export and export_details methods are now called from the assignment.rb as opposed to assignment_participant.rb where there are no export methods and their corresponding implementations.&lt;br /&gt;
Now, the Export Detail button generates a comma-seperated file with the following headers:&lt;br /&gt;
* Assignment Name&lt;br /&gt;
* Assignment Instructor&lt;br /&gt;
* Team ID / Author ID	&lt;br /&gt;
* Reviewee (Team / Student Name)&lt;br /&gt;
* Reviewer&lt;br /&gt;
* Question / Criterion&lt;br /&gt;
* Question ID&lt;br /&gt;
* Answer / Comment ID&lt;br /&gt;
* Answer / Comment&lt;br /&gt;
* Score&lt;br /&gt;
&lt;br /&gt;
'''2. ''' Along with the previous issue, we found that since the partials were shared among Assignment Participant and Course Participant, Course Participant also had the Export Details section and the corresponding button. However, it is not required and we believe that it should be removed from the view. We consulted Dr. Gehringer and based on his feedback as well, we removed the semi-view consisting of &amp;quot;Export Details&amp;quot; from Course Participant. The changes are made in the file &amp;quot;start.html.erb&amp;quot; by using conditional rendering of the partial based on the model name.&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Remove Export Detauls.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Remove Export Details.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. Missing Handle: Assignment Participant''' on adding a new Assignment Participant: We observed that when a new assignment participant is created, if a user already exists with the username, the existing user is added to that Assignment and his existing handle attribute in Users table is mapped to the handle attribute in Participants table. However, if a new user is added not currently in the Users table, a new entry is created first in the Users table and is then replicated in the Participants table. Although, we noticed that the handle attribute in Participants table was coming as null. We fixed this issue by making change in the define_attributes method in ImportFileHelper.rb.&lt;br /&gt;
&lt;br /&gt;
'''4. Import Assignment Participants''' was not working - It is expected that if a user does not exist in the system, on importing assignment participants, a user will be created and he/she will be added to the assignment as a participant. With the current implementation, the user was getting created, however corresponding AssignmentParticipant was not getting created due to a validation with respect to handle. We have fixed this issue by setting the handle in AssignmentParticipants to be the same as the name of the user created (in accordance with the current functionality - when a user is added as an AssignmentParticipant from the UI). This facilitates us to import AssignmentParticipants. &lt;br /&gt;
The mandatory minimal attributes required to import an assignment participant are :&lt;br /&gt;
* Username&lt;br /&gt;
* Full name&lt;br /&gt;
* Email id &lt;br /&gt;
* Password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. The role in the Assignment Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''6. The role in the Course Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant Role CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Rspec test has been added to check the update authorizations functionality in the participants_controller_spec.rb. The test verifies the change of flags mentioned above as per the authorization of the user. The tests also checks whether the expected flash message is visible on the UI. Code coverage is '''100%''' for all the code that we have added in the controllers, as part of this project. &lt;br /&gt;
&lt;br /&gt;
To make sure we covered all of our code (100%) with test cases we used Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem highlights the lines of code which are covered by our test cases with green color, and with red color for lines for which are not covered by our test cases. The image below shows the output of SimpleCov gem for the file participants_controller_spec.rb with 100% code coverage (all green).&lt;br /&gt;
&lt;br /&gt;
'''Please see the coverage of the code as shown in the screenshot below:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot code coverage.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Please find the tests added below:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#validate_authorizations' do&lt;br /&gt;
  #Test case for successful update of participant to reviewer, expects the success flash message&lt;br /&gt;
  it 'updates the authorizations for the participant to make them reviewer' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:success]).to eq 'The role of the selected participants has been successfully updated.'&lt;br /&gt;
    expect(participant.can_review).to eq(true)&lt;br /&gt;
    expect(participant.can_submit).to eq(false)&lt;br /&gt;
    expect(participant.can_take_quiz).to eq(false)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #Test for case where we expect to encounter an error in update_attributes method&lt;br /&gt;
  it ' throws an exception while validating authorizations' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    allow(participant).to receive(:update_attributes).and_raise(StandardError)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:error]).to eq 'The update action failed.'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team===&lt;br /&gt;
#Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
#Richa Dua (rdua2@ncsu.edu)&lt;br /&gt;
#Roshani Narasimhan (rnarasi2@ncsu.edu)&lt;br /&gt;
'''Mentor:''' Sharique Khan (mkhan8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [https://github.com/expertiza/expertiza Link to expertiza]&lt;br /&gt;
* [https://github.com/RoshaniN/expertiza-team-622.git Link to changes E1963]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1533 Link to Pull request]&lt;br /&gt;
* [http://152.46.19.56:8080/ Link to deployed application on VCL]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127703</id>
		<title>CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127703"/>
		<updated>2019-11-07T01:12:18Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1963 Changing assignment Participant role=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
 &lt;br /&gt;
* E1963 This project aims to enable the instructor to change the role of an assignment participant. There are two ways to add a new assignment participant, first being through the Add button on the assignment participant page. Another way is to import via a spreadsheet with the list of users that are to be added. The motivation of E1963 was to enable the instructors adding these users using either of the methods mentioned above to change these users' role. A user can have one of the following roles - participant, reader, reviewer, submitter.&lt;br /&gt;
&lt;br /&gt;
* The existing UI had the a dropdown that displayed the role of the user, we have added a Submit button below each dropdown to enable the instructor to change the role of the user. On clicking the submit button, the role associated with that user is changed in the persistent storage. We have also added a flash message which confirms the change to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following issues were targeted in this project:&lt;br /&gt;
* '''#1:'''  The instructor does not have the option to change the role of the user, once he/she has been added to the assignment. Thus, if the instructor wishes to change the role of a user from say a reviewer to a submitter, he/she is not able to save the changes.&lt;br /&gt;
* '''#2:''' With the changes made for the issue mentioned above, the instructor will be able to save the changes manually. We would like to maintain the same behavior when the assignment participants are imported from excel. Upon creating a new user using an Excel import, the user should have the role of a participant by default. An instructor was then unable to change the role of the assignment participant.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
 Manage Assignments -&amp;gt; Add new participant icon under Actions&lt;br /&gt;
&lt;br /&gt;
===Current implementation===&lt;br /&gt;
For each of the assignment participant record, there is a dropdown which contains the role of the participant. When the instructor attempts to change the value in the dropdown, it is not reflected in the backend, as there is no call associated with it, to submit the changes. Thus when the user revisits the page, the changes would he would have made are not retained. &lt;br /&gt;
&lt;br /&gt;
Authorization of the user is based on the flags can_submit, can_review and can_take_quiz flags, which are set to be true or false based on the role of the user. By default, the user is assigned the role of a participant in any assignment. Thus, the goal is to modify these flags and save them in the database when the role of the assignment participant is changed, so that it is a persistent change.&lt;br /&gt;
Authorization of the users based on the flags can be deduced as follows:&lt;br /&gt;
* Participant has can_submit=true, can_review=true and can_take_quiz=true&lt;br /&gt;
* Reader has can_submit= false, can_review=true and can_take_quiz= true&lt;br /&gt;
* Submitter has can_submit=true, can_review= false and can_take_quiz=false&lt;br /&gt;
* Reviewer has can_submit=false, can_review= true and can_take_quiz=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problems: &lt;br /&gt;
* 1. There is no way to change the role of the user, once the user has been added to the assignment as a participant. (Submit button now resolves this issue.)&lt;br /&gt;
* 2. Instructor is not given any confirmation that the role of the participant has been reverted to the original value once he/she navigates somewhere else. This is misleading for an instructor as the he/she might be under the impression that the changes he/she made have been saved. (Flash message now lets the user know about the change.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Snapshots depicting the issue===&lt;br /&gt;
&lt;br /&gt;
* As an Instructor, go to Manage Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot ManageAssignments.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on add participant &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot AssignmentParticipants copy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Note that the user on the first record is currently a &amp;quot;Reader&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Currently Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Change the role of the &amp;quot;Reader&amp;quot; to say &amp;quot;Submitter&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submitter.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refresh or re-navigate to this page and note that the changes are reverted&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot back to Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Changes are made in the partial for participants &amp;quot;_participant.rb&amp;quot;, so that the submit button is rendered on the view. &lt;br /&gt;
Upon changing the selected value for the user role, 'update_authorizations' method is called from participants controller which passes the participant id as a parameter to the method to change it's role in the database. The selected role is passed as a parameter 'authorization' to the update authorization method that updates the can_submit, can_take_quiz, and can_review flags appropriately for each role as described above for the selected participant id.&lt;br /&gt;
 &lt;br /&gt;
Implementing the above mentioned changes, allows the instructor to change the value of role in the dropdown which retains the corresponding record on tap of the Submit button. We have verified that the changes in the above mentioned flags are reflected in the database. The instructor will be presented with a success message on changing the role of the selected participant, on clicking submit. The instructor can revisit the page and expect the updated value to be retained. Both the problems listed above are taken care of such as the instructor is facilitated with an option to change the participant, as well as knows that the change made will be durable.&lt;br /&gt;
&lt;br /&gt;
===Snapshots after the changes===&lt;br /&gt;
&lt;br /&gt;
* Submit button has been added to each row of assignment participants&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submit Added 1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Change the &amp;quot;Reader&amp;quot; to &amp;quot;Submitter&amp;quot;, on the first record and click on submit. Changes have been persisted. Flash message confirmation is also provided to the Instructor to let him/her know of the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Additional Changes===&lt;br /&gt;
&amp;lt;i&amp;gt;(These changes were not part of the assigned issue E1963, these are additional issues that we encountered while fixing E1963)&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above-mentioned issue, we fixed a few other issues that we observed , which were relevant to Assignment Participant and Course Participant Controllers, namely:&lt;br /&gt;
&lt;br /&gt;
'''1. Export Details''' in Assignment Participants view: We noticed that a a blank csv file was getting generated on exporting detail button in Manage Assignments. We discovered that the reason for this issue is that in the import method, the model defined was that of AssignmentParticipant whereas all the parsing methods for export were present in Assignment model. We did the required changes, tested the functionality and note that this is working fine now.&lt;br /&gt;
The changes for this are made in the common module - export_file_controller.rb following which the export and export_details methods are now called from the assignment.rb as opposed to assignment_participant.rb where there are no export methods and their corresponding implementations.&lt;br /&gt;
Now, the Export Detail button generates a comma-seperated file with the following headers:&lt;br /&gt;
* Assignment Name&lt;br /&gt;
* Assignment Instructor&lt;br /&gt;
* Team ID / Author ID	&lt;br /&gt;
* Reviewee (Team / Student Name)&lt;br /&gt;
* Reviewer&lt;br /&gt;
* Question / Criterion&lt;br /&gt;
* Question ID&lt;br /&gt;
* Answer / Comment ID&lt;br /&gt;
* Answer / Comment&lt;br /&gt;
* Score&lt;br /&gt;
&lt;br /&gt;
'''2. ''' Along with the previous issue, we found that since the partials were shared among Assignment Participant and Course Participant, Course Participant also had the Export Details section and the corresponding button. However, it is not required and we believe that it should be removed from the view. We consulted Dr. Gehringer and based on his feedback as well, we removed the semi-view consisting of &amp;quot;Export Details&amp;quot; from Course Participant. The changes are made in the file &amp;quot;start.html.erb&amp;quot; by using conditional rendering of the partial based on the model name.&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Remove Export Detauls.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Remove Export Details.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. Missing Handle: Assignment Participant''' on adding a new Assignment Participant: We observed that when a new assignment participant is created, if a user already exists with the username, the existing user is added to that Assignment and his existing handle attribute in Users table is mapped to the handle attribute in Participants table. However, if a new user is added not currently in the Users table, a new entry is created first in the Users table and is then replicated in the Participants table. Although, we noticed that the handle attribute in Participants table was coming as null. We fixed this issue by making change in the define_attributes method in ImportFileHelper.rb.&lt;br /&gt;
&lt;br /&gt;
'''4. Import Assignment Participants''' was not working - It is expected that if a user does not exist in the system, on importing assignment participants, a user will be created and he/she will be added to the assignment as a participant. With the current implementation, the user was getting created, however corresponding AssignmentParticipant was not getting created due to a validation with respect to handle. We have fixed this issue by setting the handle in AssignmentParticipants to be the same as the name of the user created (in accordance with the current functionality - when a user is added as an AssignmentParticipant from the UI). This facilitates us to import AssignmentParticipants. &lt;br /&gt;
The mandatory minimal attributes required to import an assignment participant are :&lt;br /&gt;
* Username&lt;br /&gt;
* Full name&lt;br /&gt;
* Email id &lt;br /&gt;
* Password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. The role in the Assignment Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''6. The role in the Course Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant Role CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Rspec test has been added to check the update authorizations functionality in the participants_controller_spec.rb. The test verifies the change of flags mentioned above as per the authorization of the user. The tests also checks whether the expected flash message is visible on the UI. Code coverage is '''100%''' for all the code that we have added in the controllers, as part of this project. &lt;br /&gt;
&lt;br /&gt;
To make sure we covered all of our code (100%) with test cases we used Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test file, the SimpleCov gem highlights the lines of code which are covered by our test cases with green color, and with red color for lines for which are not covered by our test cases. The image below shows the output of SimpleCov gem for the file participants_controller_spec.rb.&lt;br /&gt;
&lt;br /&gt;
'''Please see the coverage of the code as shown in the screenshot below:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot code coverage.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Please find the tests added below:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#validate_authorizations' do&lt;br /&gt;
  #Test case for successful update of participant to reviewer, expects the success flash message&lt;br /&gt;
  it 'updates the authorizations for the participant to make them reviewer' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:success]).to eq 'The role of the selected participants has been successfully updated.'&lt;br /&gt;
    expect(participant.can_review).to eq(true)&lt;br /&gt;
    expect(participant.can_submit).to eq(false)&lt;br /&gt;
    expect(participant.can_take_quiz).to eq(false)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #Test for case where we expect to encounter an error in update_attributes method&lt;br /&gt;
  it ' throws an exception while validating authorizations' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    allow(participant).to receive(:update_attributes).and_raise(StandardError)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:error]).to eq 'The update action failed.'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team===&lt;br /&gt;
#Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
#Richa Dua (rdua2@ncsu.edu)&lt;br /&gt;
#Roshani Narasimhan (rnarasi2@ncsu.edu)&lt;br /&gt;
'''Mentor:''' Sharique Khan (mkhan8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [https://github.com/expertiza/expertiza Link to expertiza]&lt;br /&gt;
* [https://github.com/RoshaniN/expertiza-team-622.git Link to changes E1963]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1533 Link to Pull request]&lt;br /&gt;
* [http://152.46.19.56:8080/ Link to deployed application on VCL]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127701</id>
		<title>CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127701"/>
		<updated>2019-11-07T01:11:32Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1963 Changing assignment Participant role=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
 &lt;br /&gt;
* E1963 This project aims to enable the instructor to change the role of an assignment participant. There are two ways to add a new assignment participant, first being through the Add button on the assignment participant page. Another way is to import via a spreadsheet with the list of users that are to be added. The motivation of E1963 was to enable the instructors adding these users using either of the methods mentioned above to change these users' role. A user can have one of the following roles - participant, reader, reviewer, submitter.&lt;br /&gt;
&lt;br /&gt;
* The existing UI had the a dropdown that displayed the role of the user, we have added a Submit button below each dropdown to enable the instructor to change the role of the user. On clicking the submit button, the role associated with that user is changed in the persistent storage. We have also added a flash message which confirms the change to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following issues were targeted in this project:&lt;br /&gt;
* '''#1:'''  The instructor does not have the option to change the role of the user, once he/she has been added to the assignment. Thus, if the instructor wishes to change the role of a user from say a reviewer to a submitter, he/she is not able to save the changes.&lt;br /&gt;
* '''#2:''' With the changes made for the issue mentioned above, the instructor will be able to save the changes manually. We would like to maintain the same behavior when the assignment participants are imported from excel. Upon creating a new user using an Excel import, the user should have the role of a participant by default. An instructor was then unable to change the role of the assignment participant.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
 Manage Assignments -&amp;gt; Add new participant icon under Actions&lt;br /&gt;
&lt;br /&gt;
===Current implementation===&lt;br /&gt;
For each of the assignment participant record, there is a dropdown which contains the role of the participant. When the instructor attempts to change the value in the dropdown, it is not reflected in the backend, as there is no call associated with it, to submit the changes. Thus when the user revisits the page, the changes would he would have made are not retained. &lt;br /&gt;
&lt;br /&gt;
Authorization of the user is based on the flags can_submit, can_review and can_take_quiz flags, which are set to be true or false based on the role of the user. By default, the user is assigned the role of a participant in any assignment. Thus, the goal is to modify these flags and save them in the database when the role of the assignment participant is changed, so that it is a persistent change.&lt;br /&gt;
Authorization of the users based on the flags can be deduced as follows:&lt;br /&gt;
* Participant has can_submit=true, can_review=true and can_take_quiz=true&lt;br /&gt;
* Reader has can_submit= false, can_review=true and can_take_quiz= true&lt;br /&gt;
* Submitter has can_submit=true, can_review= false and can_take_quiz=false&lt;br /&gt;
* Reviewer has can_submit=false, can_review= true and can_take_quiz=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problems: &lt;br /&gt;
* 1. There is no way to change the role of the user, once the user has been added to the assignment as a participant. (Submit button now resolves this issue.)&lt;br /&gt;
* 2. Instructor is not given any confirmation that the role of the participant has been reverted to the original value once he/she navigates somewhere else. This is misleading for an instructor as the he/she might be under the impression that the changes he/she made have been saved. (Flash message now lets the user know about the change.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Snapshots depicting the issue===&lt;br /&gt;
&lt;br /&gt;
* As an Instructor, go to Manage Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot ManageAssignments.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on add participant &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot AssignmentParticipants copy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Note that the user on the first record is currently a &amp;quot;Reader&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Currently Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Change the role of the &amp;quot;Reader&amp;quot; to say &amp;quot;Submitter&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submitter.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refresh or re-navigate to this page and note that the changes are reverted&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot back to Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Changes are made in the partial for participants &amp;quot;_participant.rb&amp;quot;, so that the submit button is rendered on the view. &lt;br /&gt;
Upon changing the selected value for the user role, 'update_authorizations' method is called from participants controller which passes the participant id as a parameter to the method to change it's role in the database. The selected role is passed as a parameter 'authorization' to the update authorization method that updates the can_submit, can_take_quiz, and can_review flags appropriately for each role as described above for the selected participant id.&lt;br /&gt;
 &lt;br /&gt;
Implementing the above mentioned changes, allows the instructor to change the value of role in the dropdown which retains the corresponding record on tap of the Submit button. We have verified that the changes in the above mentioned flags are reflected in the database. The instructor will be presented with a success message on changing the role of the selected participant, on clicking submit. The instructor can revisit the page and expect the updated value to be retained. Both the problems listed above are taken care of such as the instructor is facilitated with an option to change the participant, as well as knows that the change made will be durable.&lt;br /&gt;
&lt;br /&gt;
===Snapshots after the changes===&lt;br /&gt;
&lt;br /&gt;
* Submit button has been added to each row of assignment participants&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submit Added 1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Change the &amp;quot;Reader&amp;quot; to &amp;quot;Submitter&amp;quot;, on the first record and click on submit. Changes have been persisted. Flash message confirmation is also provided to the Instructor to let him/her know of the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Additional Changes===&lt;br /&gt;
&amp;lt;i&amp;gt;(These changes were not part of the assigned issue E1963, these are additional issues that we encountered while fixing E1963)&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above-mentioned issue, we fixed a few other issues that we observed , which were relevant to Assignment Participant and Course Participant Controllers, namely:&lt;br /&gt;
&lt;br /&gt;
'''1. Export Details''' in Assignment Participants view: We noticed that a a blank csv file was getting generated on exporting detail button in Manage Assignments. We discovered that the reason for this issue is that in the import method, the model defined was that of AssignmentParticipant whereas all the parsing methods for export were present in Assignment model. We did the required changes, tested the functionality and note that this is working fine now.&lt;br /&gt;
The changes for this are made in the common module - export_file_controller.rb following which the export and export_details methods are now called from the assignment.rb as opposed to assignment_participant.rb where there are no export methods and their corresponding implementations.&lt;br /&gt;
Now, the Export Detail button generates a comma-seperated file with the following headers:&lt;br /&gt;
* Assignment Name&lt;br /&gt;
* Assignment Instructor&lt;br /&gt;
* Team ID / Author ID	&lt;br /&gt;
* Reviewee (Team / Student Name)&lt;br /&gt;
* Reviewer&lt;br /&gt;
* Question / Criterion&lt;br /&gt;
* Question ID&lt;br /&gt;
* Answer / Comment ID&lt;br /&gt;
* Answer / Comment&lt;br /&gt;
* Score&lt;br /&gt;
&lt;br /&gt;
'''2. ''' Along with the previous issue, we found that since the partials were shared among Assignment Participant and Course Participant, Course Participant also had the Export Details section and the corresponding button. However, it is not required and we believe that it should be removed from the view. We consulted Dr. Gehringer and based on his feedback as well, we removed the semi-view consisting of &amp;quot;Export Details&amp;quot; from Course Participant. The changes are made in the file &amp;quot;start.html.erb&amp;quot; by using conditional rendering of the partial based on the model name.&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Remove Export Detauls.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Remove Export Details.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. Missing Handle: Assignment Participant''' on adding a new Assignment Participant: We observed that when a new assignment participant is created, if a user already exists with the username, the existing user is added to that Assignment and his existing handle attribute in Users table is mapped to the handle attribute in Participants table. However, if a new user is added not currently in the Users table, a new entry is created first in the Users table and is then replicated in the Participants table. Although, we noticed that the handle attribute in Participants table was coming as null. We fixed this issue by making change in the define_attributes method in ImportFileHelper.rb.&lt;br /&gt;
&lt;br /&gt;
'''4. Import Assignment Participants''' was not working - It is expected that if a user does not exist in the system, on importing assignment participants, a user will be created and he/she will be added to the assignment as a participant. With the current implementation, the user was getting created, however corresponding AssignmentParticipant was not getting created due to a validation with respect to handle. We have fixed this issue by setting the handle in AssignmentParticipants to be the same as the name of the user created (in accordance with the current functionality - when a user is added as an AssignmentParticipant from the UI). This facilitates us to import AssignmentParticipants. &lt;br /&gt;
The mandatory minimal attributes required to import an assignment participant are :&lt;br /&gt;
* Username&lt;br /&gt;
* Full name&lt;br /&gt;
* Email id &lt;br /&gt;
* Password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. The role in the Assignment Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''6. The role in the Course Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant Role CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Rspec test has been added to check the update authorizations functionality in the participants_controller_spec.rb. The test verifies the change of flags mentioned above as per the authorization of the user. The tests also checks whether the expected flash message is visible on the UI. Code coverage is '''100%''' for all the code that we have added in the controllers, as part of this project. &lt;br /&gt;
&lt;br /&gt;
To make sure we covered all of our code (100%) with test cases we used Ruby Code Coverage plugin of RubyMine and SimpleCov gem. After manually running the test case, the SimpleCov gem highlights the lines of code which are covered by our test cases with green color, and with red color for lines for which are not covered by our test cases. The image below shows the output of SimpleCov gem for the file participants_controller_spec.rb.&lt;br /&gt;
&lt;br /&gt;
'''Please see the coverage of the code as shown in the screenshot below:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot code coverage.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Please find the tests added below:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#validate_authorizations' do&lt;br /&gt;
  #Test case for successful update of participant to reviewer, expects the success flash message&lt;br /&gt;
  it 'updates the authorizations for the participant to make them reviewer' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:success]).to eq 'The role of the selected participants has been successfully updated.'&lt;br /&gt;
    expect(participant.can_review).to eq(true)&lt;br /&gt;
    expect(participant.can_submit).to eq(false)&lt;br /&gt;
    expect(participant.can_take_quiz).to eq(false)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #Test for case where we expect to encounter an error in update_attributes method&lt;br /&gt;
  it ' throws an exception while validating authorizations' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    allow(participant).to receive(:update_attributes).and_raise(StandardError)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:error]).to eq 'The update action failed.'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team===&lt;br /&gt;
#Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
#Richa Dua (rdua2@ncsu.edu)&lt;br /&gt;
#Roshani Narasimhan (rnarasi2@ncsu.edu)&lt;br /&gt;
'''Mentor:''' Sharique Khan (mkhan8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [https://github.com/expertiza/expertiza Link to expertiza]&lt;br /&gt;
* [https://github.com/RoshaniN/expertiza-team-622.git Link to changes E1963]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1533 Link to Pull request]&lt;br /&gt;
* [http://152.46.19.56:8080/ Link to deployed application on VCL]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127662</id>
		<title>CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127662"/>
		<updated>2019-11-07T00:48:27Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1963 Changing assignment Participant role=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
 &lt;br /&gt;
* E1963 This project aims to enable the instructor to change the role of an assignment participant. There are two ways to add a new assignment participant, first being through the Add button on the assignment participant page. Another way is to import via a spreadsheet with the list of users that are to be added. The motivation of E1963 was to enable the instructors adding these users using either of the methods mentioned above to change these users' role. A user can have one of the following roles - participant, reader, reviewer, submitter.&lt;br /&gt;
&lt;br /&gt;
* The existing UI had the a dropdown that displayed the role of the user, we have added a Submit button below each dropdown to enable the instructor to change the role of the user. On clicking the submit button, the role associated with that user is changed in the persistent storage. We have also added a flash message which confirms the change to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following issues were targeted in this project:&lt;br /&gt;
* '''#1:'''  The instructor does not have the option to change the role of the user, once he/she has been added to the assignment. Thus, if the instructor wishes to change the role of a user from say a reviewer to a submitter, he/she is not able to save the changes.&lt;br /&gt;
* '''#2:''' With the changes made for the issue mentioned above, the instructor will be able to save the changes manually. We would like to maintain the same behavior when the assignment participants are imported from excel. Upon creating a new user using an Excel import, the user should have the role of a participant by default. An instructor was then unable to change the role of the assignment participant.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
 Manage Assignments -&amp;gt; Add new participant icon under Actions&lt;br /&gt;
&lt;br /&gt;
===Current implementation===&lt;br /&gt;
For each of the assignment participant record, there is a dropdown which contains the role of the participant. When the instructor attempts to change the value in the dropdown, it is not reflected in the backend, as there is no call associated with it, to submit the changes. Thus when the user revisits the page, the changes would he would have made are not retained. &lt;br /&gt;
&lt;br /&gt;
Authorization of the user is based on the flags can_submit, can_review and can_take_quiz flags, which are set to be true or false based on the role of the user. By default, the user is assigned the role of a participant in any assignment. Thus, the goal is to modify these flags and save them in the database when the role of the assignment participant is changed, so that it is a persistent change.&lt;br /&gt;
Authorization of the users based on the flags can be deduced as follows:&lt;br /&gt;
* Participant has can_submit=true, can_review=true and can_take_quiz=true&lt;br /&gt;
* Reader has can_submit= false, can_review=true and can_take_quiz= true&lt;br /&gt;
* Submitter has can_submit=true, can_review= false and can_take_quiz=false&lt;br /&gt;
* Reviewer has can_submit=false, can_review= true and can_take_quiz=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problems: &lt;br /&gt;
* 1. There is no way to change the role of the user, once the user has been added to the assignment as a participant. (Submit button now resolves this issue.)&lt;br /&gt;
* 2. Instructor is not given any confirmation that the role of the participant has been reverted to the original value once he/she navigates somewhere else. This is misleading for an instructor as the he/she might be under the impression that the changes he/she made have been saved. (Flash message now lets the user know about the change.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Snapshots depicting the issue===&lt;br /&gt;
&lt;br /&gt;
* As an Instructor, go to Manage Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot ManageAssignments.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on add participant &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot AssignmentParticipants copy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Note that the user on the first record is currently a &amp;quot;Reader&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Currently Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Change the role of the &amp;quot;Reader&amp;quot; to say &amp;quot;Submitter&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submitter.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refresh or re-navigate to this page and note that the changes are reverted&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot back to Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Changes are made in the partial for participants &amp;quot;_participant.rb&amp;quot;, so that the submit button is rendered on the view. &lt;br /&gt;
Upon changing the selected value for the user role, 'update_authorizations' method is called from participants controller which passes the participant id as a parameter to the method to change it's role in the database. The selected role is passed as a parameter 'authorization' to the update authorization method that updates the can_submit, can_take_quiz, and can_review flags appropriately for each role as described above for the selected participant id.&lt;br /&gt;
 &lt;br /&gt;
Implementing the above mentioned changes, allows the instructor to change the value of role in the dropdown which retains the corresponding record on tap of the Submit button. We have verified that the changes in the above mentioned flags are reflected in the database. The instructor will be presented with a success message on changing the role of the selected participant, on clicking submit. The instructor can revisit the page and expect the updated value to be retained. Both the problems listed above are taken care of such as the instructor is facilitated with an option to change the participant, as well as knows that the change made will be durable.&lt;br /&gt;
&lt;br /&gt;
===Snapshots after the changes===&lt;br /&gt;
&lt;br /&gt;
* Submit button has been added to each row of assignment participants&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submit Added 1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Change the &amp;quot;Reader&amp;quot; to &amp;quot;Submitter&amp;quot;, on the first record and click on submit. Changes have been persisted. Flash message confirmation is also provided to the Instructor to let him/her know of the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Additional Changes===&lt;br /&gt;
&amp;lt;i&amp;gt;(These changes were not part of the assigned issue E1963, these are additional issues that we encountered while fixing E1963)&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above-mentioned issue, we fixed a few other issues that we observed , which were relevant to Assignment Participant and Course Participant Controllers, namely:&lt;br /&gt;
&lt;br /&gt;
'''1. Export Details''' in Assignment Participants view: We noticed that a a blank csv file was getting generated on exporting detail button in Manage Assignments. We discovered that the reason for this issue is that in the import method, the model defined was that of AssignmentParticipant whereas all the parsing methods for export were present in Assignment model. We did the required changes, tested the functionality and note that this is working fine now.&lt;br /&gt;
The changes for this are made in the common module - export_file_controller.rb following which the export and export_details methods are now called from the assignment.rb as opposed to assignment_participant.rb where there are no export methods and their corresponding implementations.&lt;br /&gt;
Now, the Export Detail button generates a comma-seperated file with the following headers:&lt;br /&gt;
* Assignment Name&lt;br /&gt;
* Assignment Instructor&lt;br /&gt;
* Team ID / Author ID	&lt;br /&gt;
* Reviewee (Team / Student Name)&lt;br /&gt;
* Reviewer&lt;br /&gt;
* Question / Criterion&lt;br /&gt;
* Question ID&lt;br /&gt;
* Answer / Comment ID&lt;br /&gt;
* Answer / Comment&lt;br /&gt;
* Score&lt;br /&gt;
&lt;br /&gt;
'''2. ''' Along with the previous issue, we found that since the partials were shared among Assignment Participant and Course Participant, Course Participant also had the Export Details section and the corresponding button. However, it is not required and we believe that it should be removed from the view. We consulted Dr. Gehringer and based on his feedback as well, we removed the semi-view consisting of &amp;quot;Export Details&amp;quot; from Course Participant. The changes are made in the file &amp;quot;start.html.erb&amp;quot; by using conditional rendering of the partial based on the model name.&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Remove Export Detauls.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Remove Export Details.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. Missing Handle: Assignment Participant''' on adding a new Assignment Participant: We observed that when a new assignment participant is created, if a user already exists with the username, the existing user is added to that Assignment and his existing handle attribute in Users table is mapped to the handle attribute in Participants table. However, if a new user is added not currently in the Users table, a new entry is created first in the Users table and is then replicated in the Participants table. Although, we noticed that the handle attribute in Participants table was coming as null. We fixed this issue by making change in the define_attributes method in ImportFileHelper.rb.&lt;br /&gt;
&lt;br /&gt;
'''4. Import Assignment Participants''' was not working - It is expected that if a user does not exist in the system, on importing assignment participants, a user will be created and he/she will be added to the assignment as a participant. With the current implementation, the user was getting created, however corresponding AssignmentParticipant was not getting created due to a validation with respect to handle. We have fixed this issue by setting the handle in AssignmentParticipants to be the same as the name of the user created (in accordance with the current functionality - when a user is added as an AssignmentParticipant from the UI). This facilitates us to import AssignmentParticipants. &lt;br /&gt;
The mandatory minimal attributes required to import an assignment participant are :&lt;br /&gt;
* Username&lt;br /&gt;
* Full name&lt;br /&gt;
* Email id &lt;br /&gt;
* Password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. The role in the Assignment Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''6. The role in the Course Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''The view before change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''The view after change:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant Role CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Rspec test has been added to check the update authorizations functionality in the participants_controller_spec.rb. The test verifies the change of flags mentioned above as per the authorization of the user. The tests also checks whether the expected flash message is visible on the UI. Code coverage is '''100%''' for all the code that we have added in the controllers, as part of this project. &lt;br /&gt;
&lt;br /&gt;
'''Please see the coverage of the code as shown in the screenshot below:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot code coverage.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 We checked the code coverage using Ruby Code Coverage plugin and SimpleCov gem.&lt;br /&gt;
&lt;br /&gt;
'''Please find the tests added below:'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  describe '#validate_authorizations' do&lt;br /&gt;
  #Test case for successful update of participant to reviewer, expects the success flash message&lt;br /&gt;
  it 'updates the authorizations for the participant to make them reviewer' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:success]).to eq 'The role of the selected participants has been successfully updated.'&lt;br /&gt;
    expect(participant.can_review).to eq(true)&lt;br /&gt;
    expect(participant.can_submit).to eq(false)&lt;br /&gt;
    expect(participant.can_take_quiz).to eq(false)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  #Test for case where we expect to encounter an error in update_attributes method&lt;br /&gt;
  it ' throws an exception while validating authorizations' do&lt;br /&gt;
    allow(Participant).to receive(:find).with('1').and_return(participant)&lt;br /&gt;
    allow(participant).to receive(:update_attributes).and_raise(StandardError)&lt;br /&gt;
    params = {authorization: 'reviewer', id: 1}&lt;br /&gt;
    session = {user: instructor}&lt;br /&gt;
    get :update_authorizations, params, session&lt;br /&gt;
    expect(flash[:error]).to eq 'The update action failed.'&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team===&lt;br /&gt;
#Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
#Richa Dua (rdua2@ncsu.edu)&lt;br /&gt;
#Roshani Narasimhan (rnarasi2@ncsu.edu)&lt;br /&gt;
'''Mentor:''' Sharique Khan (mkhan8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [https://github.com/expertiza/expertiza Link to expertiza]&lt;br /&gt;
* [https://github.com/RoshaniN/expertiza-team-622.git Link to changes E1963]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1533 Link to Pull request]&lt;br /&gt;
* [http://152.46.19.56:8080/ Link to deployed application on VCL]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127381</id>
		<title>CSC/ECE 517 Fall 2019 - E1963. Changing assignment participant role</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2019_-_E1963._Changing_assignment_participant_role&amp;diff=127381"/>
		<updated>2019-11-06T21:02:35Z</updated>

		<summary type="html">&lt;p&gt;Nnegi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= E1963 Changing assignment Participant role=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Background===&lt;br /&gt;
 &lt;br /&gt;
* E1963 This project aims to enable the instructor to change the role of an assignment participant. There are two ways to add a new assignment participant, first being through the Add button on the assignment participant page. Another way is to import via a spreadsheet with the list of users that are to be added. The motivation of E1963 was to enable the instructors adding these users using either of the methods mentioned above to change these users' role. A user can have one of the following roles - participant, reader, reviewer, submitter.&lt;br /&gt;
&lt;br /&gt;
* The existing UI had the a dropdown that displayed the role of the user, we have added a Submit button below each dropdown to enable the instructor to change the role of the user. On tapping the submit button, the role associated with that user is changed in the persistent storage. We have also added a flash message which confirms the change to the user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following issues were targeted in this project:&lt;br /&gt;
* '''#1:'''  The instructor does not have the option to change the role of the user, once he/she has been added to the assignment. Thus, if the instructor wishes to change the role of a user from say a reviewer to a submitter, he/she is not able to save the changes.&lt;br /&gt;
* '''#2:''' With the changes made for the issue mentioned above, the instructor will be able to save the changes manually. We would like to maintain the same behavior when the assignment participants are imported from excel. Upon creating a new user using an Excel import, the user should have the role of a participant by default. An instructor was then unable to change the role of the assignment participant.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
 Manage Assignments -&amp;gt; Add new participant &lt;br /&gt;
&lt;br /&gt;
===Current implementation===&lt;br /&gt;
For each of the assignment participant record, there is a dropdown which contains the role of the participant. When the instructor attempts to change the value in the dropdown, it is not reflected in the backend, as there is no call associated with it, to submit the changes. Thus when the user revisits the page, the changes would he would have made are not retained. &lt;br /&gt;
&lt;br /&gt;
Authorization of the user is based on the flags can_submit, can_review and can_take_quiz flags, which are set to be true or false based on the role of the user. By default, the user is assigned the role of a participant in any assignment. Thus, the goal is to modify these flags and save them in the database when the role of the assignment participant is changed, so that it is a persistent change.&lt;br /&gt;
Authorization of the users based on the flags can be deduced as follows:&lt;br /&gt;
* Participant has can_submit=true, can_review=true and can_take_quiz=true&lt;br /&gt;
* Reader has can_submit= false, can_review=true and can_take_quiz= true&lt;br /&gt;
* Submitter has can_submit=true, can_review= false and can_take_quiz=false&lt;br /&gt;
* Reviewer has can_submit=false, can_review= true and can_take_quiz=false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Problems: &lt;br /&gt;
* 1. There is no way to change the role of the user, once the user has been added to the assignment as a participant. (Submit button now resolves this issue.)&lt;br /&gt;
* 2. Instructor is not given any confirmation that the role of the participant has been reverted to the original value once he/she navigates somewhere else. This is misleading for an instructor as the he/she might be under the impression that the changes he/she made have been saved. (Flash message now lets the user know about the change.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Snapshots depicting the issue===&lt;br /&gt;
&lt;br /&gt;
* As an Instructor, go to Manage Assignments&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot ManageAssignments.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Click on add participant &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot AssignmentParticipants copy.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Note that the user on the first record is currently a &amp;quot;Reader&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Currently Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Change the role of the &amp;quot;Reader&amp;quot; to say &amp;quot;Submitter&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submitter.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Refresh or re-navigate to this page and note that the changes are reverted&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot back to Reader.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Changes are made in the partial for participants &amp;quot;_participant.rb&amp;quot;, so that the submit button is rendered on the view. &lt;br /&gt;
Upon changing the selected value for the user role, 'update_authorizations' method is called from participants controller which passes the participant id as a parameter to the method to change it's role in the database. The selected role is passed as a parameter 'authorization' to the update authorization method that updates the can_submit, can_take_quiz, and can_review flags appropriately for each role as described above for the selected participant id.&lt;br /&gt;
 &lt;br /&gt;
Implementing the above mentioned changes, allows the instructor to change the value of role in the dropdown which retains the corresponding record on tap of the Submit button. We have verified that the changes in the above mentioned flags are reflected in the database. The instructor will be presented with a success message on changing the role of the selected participant, on clicking submit. The instructor can revisit the page and expect the updated value to be retained. Both the problems listed above are taken care of such as the instructor is facilitated with an option to change the participant, as well as knows that the change made will be durable.&lt;br /&gt;
&lt;br /&gt;
===Snapshots after the changes===&lt;br /&gt;
&lt;br /&gt;
* Submit button has been added to each row of assignment participants&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot Submit Added 1.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
* Change the &amp;quot;Reader&amp;quot; to &amp;quot;Submitter&amp;quot;, on the first record and click on submit. Changes have been persisted. Flash message confirmation is also provided to the Instructor to let him/her know of the change.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Additional Changes===&lt;br /&gt;
&amp;lt;i&amp;gt;(These changes were not part of the assigned issue E1963, these are additional issues that we encountered while fixing E1963)&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above-mentioned issue, we fixed a few other issues that we encountered , which were relevant to Assignment Participant and Course Participant Controllers, namely:&lt;br /&gt;
&lt;br /&gt;
'''1. Export Details''' in Assignment Participants view: We noticed that a a blank csv file was getting generated on exporting detail button in Manage Assignments. We discovered that the reason for this issue is that in the import method, the model defined was that of AssignmentParticipant whereas all the parsing methods for export were present in Assignment model. We did the required changes, tested the functionality and note that this is working fine now.&lt;br /&gt;
The changes for this are made in the common module - export_file_controller.rb following which the export and export_details methods are now called from the assignment.rb as opposed to assignment_participant.rb where there are no export methods and their corresponding implementations.&lt;br /&gt;
Now, the Export Detail button generates a comma-seperated file with the following headers:&lt;br /&gt;
* Assignment Name&lt;br /&gt;
* Assignment Instructor&lt;br /&gt;
* Team ID / Author ID	&lt;br /&gt;
* Reviewee (Team / Student Name)&lt;br /&gt;
* Reviewer&lt;br /&gt;
* Question / Criterion&lt;br /&gt;
* Question ID&lt;br /&gt;
* Answer / Comment ID&lt;br /&gt;
* Answer / Comment&lt;br /&gt;
* Score&lt;br /&gt;
&lt;br /&gt;
'''2. ''' Along with the previous issue, we found that since the partials were shared among Assignment Participant and Course Participant, Course Participant also had the Export Details section and the corresponding button. However, it is not required and we believe that it should be removed from the view. We consulted Dr. Gehringer and based on his feedback as well, we removed the semi-view consisting of &amp;quot;Export Details&amp;quot; from Course Participant. The changes are made in the file &amp;quot;start.html.erb&amp;quot; by using conditional rendering of the partial based on the model name.&lt;br /&gt;
&lt;br /&gt;
The view before change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view after change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screenshot submitter saved 2.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''3. Missing Handle: Assignment Participant''' on adding a new Assignment Participant: We observed that when a new assignment participant is created, if a user already exists with the username, the existing user is added to that Assignment and his existing handle attribute in Users table is mapped to the handle attribute in Participants table. However, if a new user is added not currently in the Users table, a new entry is created first in the Users table and is then replicated in the Participants table. Although, we noticed that the handle attribute in Participants table was coming as null. We fixed this issue by making change in the define_attributes method in ImportFileHelper.rb.&lt;br /&gt;
&lt;br /&gt;
'''4. Import Assignment Participants''' was not working - It is expected that if a user does not exist in the system, on importing assignment participants, a user will be created and he/she will be added to the assignment as a participant. With the current implementation, the user was getting created, however corresponding AssignmentParticipant was not getting created due to a validation with respect to handle. We have fixed this issue by setting the handle in AssignmentParticipants to be the same as the name of the user created (in accordance with the current functionality - when a user is added as an AssignmentParticipant from the UI). This facilitates us to import AssignmentParticipants. &lt;br /&gt;
The mandatory minimal attributes required to import an assignment participant are :&lt;br /&gt;
* Username&lt;br /&gt;
* Full name&lt;br /&gt;
* Email id &lt;br /&gt;
* Password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. The role in the Assignment Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The view before change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot Before Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The view after change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant AP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''6. The role in the Course Participant view''' doesn't have a header unlike all the other attributes on the view. We added a header for the role, thereby increasing the readability and consistency on the UI. The required changes are made in the partial &amp;quot;_user_list.html&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The view before change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[File:Screen Shot Before Participant CP.png]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The view after change:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Screen Shot After Participant Role CP.png]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Test Plan===&lt;br /&gt;
Rspec test has been added to check the update authorizations functionality in the participants_controller_spec.rb. The test verifies the change of flags mentioned above as per the authorization of the user. The tests also checks whether the expected flash message is visible on the UI. Code coverage is 100% for all the code that we have added as part of this project. We checked the code coverage using Ruby Code Coverage plugin and SimpleCov gem.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[File:Screen Shot Before Participant CP.png]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Team===&lt;br /&gt;
#Natansh Negi (nnegi2@ncsu.edu)&lt;br /&gt;
#Richa Dua (rdua2@ncsu.edu)&lt;br /&gt;
#Roshani Narasimhan (rnarasi2@ncsu.edu)&lt;br /&gt;
'''Mentor:''' Sharique Khan (mkhan8@ncsu.edu)&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
* [https://github.com/expertiza/expertiza Link to expertiza]&lt;br /&gt;
* [https://github.com/RoshaniN/expertiza-team-622.git Link to changes E1963]&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1533 Link to Pull request]&lt;br /&gt;
* [http://152.46.19.56:8080/ Link to deployed application on VCL]&lt;/div&gt;</summary>
		<author><name>Nnegi2</name></author>
	</entry>
</feed>