<?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=Alunava</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=Alunava"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Alunava"/>
	<updated>2026-06-12T22:24:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=142710</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=142710"/>
		<updated>2021-12-03T18:55:01Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Project Scope==&lt;br /&gt;
[[File:Rsz late policy.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
All the issues raised mainly exist in the &amp;quot;Due Dates&amp;quot; tab on the &amp;quot;Edit Assignment&amp;quot; page.&lt;br /&gt;
* '''Issue 1''' - 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''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - Write new test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
==Problem description, Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:Issue2A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page. To achieve this, we have added the assignment reference in the current session.&lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:issue3A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements.We found out that this functionality is already working, however we added an information icon so that it is well understood by the user how to use this.&lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:issue4A.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file for 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 for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&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;
#[https://drive.google.com/file/d/1gpW2Y6mw-ctg5EZE4JZoSLS5mjJuIg1S/view?usp=sharing Working Demo Video]&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;
'''''After fix'''''&lt;br /&gt;
&lt;br /&gt;
The new code changes does not break existing functionality. Please check out below video which shows how all the five issues are being addressed :&lt;br /&gt;
 &lt;br /&gt;
#[https://drive.google.com/file/d/1gpW2Y6mw-ctg5EZE4JZoSLS5mjJuIg1S/view?usp=sharing Working Demo]&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We created two new test files, late_policy_spec.rb and late_policies_controller_spec.rb which cover test scenarios for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''late_policy_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
This test suite covers the two functions available in the model. Our test ensures that the model functions as expected. Most of the corner cases are being covered by controller test and thus the key to this test suite is ensuring all functionalities function as expected.&lt;br /&gt;
&lt;br /&gt;
[[File:Test_1.png|600px]] &lt;br /&gt;
&lt;br /&gt;
The first function in the model is for checking if for a particular instructor, the policy name already exists. For this scenario, there are two possible outcomes :&lt;br /&gt;
* Policy name already exists under an instructor.&lt;br /&gt;
* Policy name does not exists under an instructor. &lt;br /&gt;
&lt;br /&gt;
Our test cases cover both of these scenarios. &lt;br /&gt;
&lt;br /&gt;
[[File:Test_2.png|600px]]&lt;br /&gt;
[[File:Test_3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The second method in this controller checks if penalty points are being updated correctly or not. One key aspect to testing this function was the mocking of the helper method. Our model depends on a helper file to update penalty points based on certain factors. Since the functionality of the model should be independent of helper behavior, we have mocked that call. The calculation of penalty is based on the type of the deadline which can have 4 possible values :&lt;br /&gt;
* nil&lt;br /&gt;
* 1&lt;br /&gt;
* 2&lt;br /&gt;
* 5&lt;br /&gt;
&lt;br /&gt;
Based on each none or one of the penalty points from submission, review or meta_review gets updated. Our test suite goes through each and ensures the correct one is being updated. &lt;br /&gt;
&lt;br /&gt;
'''late_policies_controller_spec.rb'''&lt;br /&gt;
Our controller test ensures that the controller works as expected. We have covered the test cases for each method present in the controller, Moreover,  we tried to cover most of the corner cases. We have total of 14 controller test case and detailed test cases can be checked out in our pull request (#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]).&lt;br /&gt;
&lt;br /&gt;
Following are few test cases :&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
1.) This test case covers the scenario where the penalty per unit exceeds the max penalty for an assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxPenaltyLess.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.) Trying to create/update policy which already exists.&lt;br /&gt;
&lt;br /&gt;
[[File:SamePolicy.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:createSamePolicy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.) Delete the policy.&lt;br /&gt;
&lt;br /&gt;
[[File:DestroyPolicy.png]]&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;
Test coverage has been increased by 0.6 percentage : &lt;br /&gt;
&lt;br /&gt;
[[File:Coverage.png]]&lt;br /&gt;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
'''11/10''' – Divided tasks and started implementation&lt;br /&gt;
&lt;br /&gt;
'''11/14''' – First review of implementation and discussion on future work&lt;br /&gt;
&lt;br /&gt;
'''11/22''' – Follow up review and start with documentation update&lt;br /&gt;
&lt;br /&gt;
'''11/28''' – Work completion followed by video creation&lt;br /&gt;
&lt;br /&gt;
'''11/29''' – Final submission&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=142709</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=142709"/>
		<updated>2021-12-03T18:51:17Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem description, Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Project Scope==&lt;br /&gt;
[[File:Rsz late policy.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
All the issues raised mainly exist in the &amp;quot;Due Dates&amp;quot; tab on the &amp;quot;Edit Assignment&amp;quot; page.&lt;br /&gt;
* '''Issue 1''' - 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''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - Write new test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
==Problem description, Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:Issue1A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:Issue2A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page. To achieve this, we have added the assignment reference in the current session.&lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:issue3A.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements.We found out that this functionality is already working, however we added an information icon so that it is well understood by the user how to use this.&lt;br /&gt;
&lt;br /&gt;
'''Code Snippet : '''&lt;br /&gt;
&lt;br /&gt;
[[File:issue4A.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Added test file for 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 for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&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;
#[https://drive.google.com/file/d/1gpW2Y6mw-ctg5EZE4JZoSLS5mjJuIg1S/view?usp=sharing Working Demo Video]&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;
'''''After fix'''''&lt;br /&gt;
&lt;br /&gt;
The new code changes does not break existing functionality. Please check out below video which shows how all the five issues are being addressed :&lt;br /&gt;
 &lt;br /&gt;
#[https://drive.google.com/file/d/1gpW2Y6mw-ctg5EZE4JZoSLS5mjJuIg1S/view?usp=sharing Working Demo]&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We created two new test files, late_policy_spec.rb and late_policies_controller_spec.rb which cover test scenarios for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''late_policy_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
This test suite covers the two functions available in the model. Our test ensures that the model functions as expected. Most of the corner cases are being covered by controller test and thus the key to this test suite is ensuring all functionalities function as expected.&lt;br /&gt;
&lt;br /&gt;
[[File:Test_1.png|600px]] &lt;br /&gt;
&lt;br /&gt;
The first function in the model is for checking if for a particular instructor, the policy name already exists. For this scenario, there are two possible outcomes :&lt;br /&gt;
* Policy name already exists under an instructor.&lt;br /&gt;
* Policy name does not exists under an instructor. &lt;br /&gt;
&lt;br /&gt;
Our test cases cover both of these scenarios. &lt;br /&gt;
&lt;br /&gt;
[[File:Test_2.png|600px]]&lt;br /&gt;
[[File:Test_3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The second method in this controller checks if penalty points are being updated correctly or not. One key aspect to testing this function was the mocking of the helper method. Our model depends on a helper file to update penalty points based on certain factors. Since the functionality of the model should be independent of helper behavior, we have mocked that call. The calculation of penalty is based on the type of the deadline which can have 4 possible values :&lt;br /&gt;
* nil&lt;br /&gt;
* 1&lt;br /&gt;
* 2&lt;br /&gt;
* 5&lt;br /&gt;
&lt;br /&gt;
Based on each none or one of the penalty points from submission, review or meta_review gets updated. Our test suite goes through each and ensures the correct one is being updated. &lt;br /&gt;
&lt;br /&gt;
'''late_policies_controller_spec.rb'''&lt;br /&gt;
Our controller test ensures that the controller works as expected. We have covered the test cases for each method present in the controller, Moreover,  we tried to cover most of the corner cases. We have total of 14 controller test case and detailed test cases can be checked out in our pull request (#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]).&lt;br /&gt;
&lt;br /&gt;
Following are few test cases :&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
1.) This test case covers the scenario where the penalty per unit exceeds the max penalty for an assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:MaxPenaltyLess.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2.) Trying to create/update policy which already exists.&lt;br /&gt;
&lt;br /&gt;
[[File:SamePolicy.png]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:createSamePolicy.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.) Delete the policy.&lt;br /&gt;
&lt;br /&gt;
[[File:DestroyPolicy.png]]&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;
Test coverage has been increased by 0.6 percentage : &lt;br /&gt;
&lt;br /&gt;
[[File:Coverage.png]]&lt;br /&gt;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141672</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141672"/>
		<updated>2021-11-27T02:48:11Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Project Scope==&lt;br /&gt;
[[File:Rsz late policy.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
All the issues raised mainly exist in the &amp;quot;Due Dates&amp;quot; tab on the &amp;quot;Edit Assignment&amp;quot; page.&lt;br /&gt;
* '''Issue 1''' - 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''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - Write new test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
'''''After fix'''''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using RSpec'''&lt;br /&gt;
&lt;br /&gt;
We created two new test files, late_policy_spec.rb and late_policies_controller_spec.rb which cover test scenarios for late_policy.rb and late_policies_controller.rb repesctively.&lt;br /&gt;
&lt;br /&gt;
'''late_policy_spec.rb'''&lt;br /&gt;
&lt;br /&gt;
This test suite covers the two functions available in the model. Our test ensures that the model functions as expected. Most of the corner cases are being covered by controller test and thus the key to this test suite is ensuring all functionalities function as expected.&lt;br /&gt;
&lt;br /&gt;
[[File:Test_1.png|600px]] &lt;br /&gt;
&lt;br /&gt;
The first function in the model is for checking if for a particular instructor, the policy name already exists. For this scenario, there are two possible outcomes :&lt;br /&gt;
* Policy name already exists under an instructor.&lt;br /&gt;
* Policy name does not exists under an instructor. &lt;br /&gt;
&lt;br /&gt;
Our test cases cover both of these scenarios. &lt;br /&gt;
&lt;br /&gt;
[[File:Test_2.png|600px]]&lt;br /&gt;
[[File:Test_3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The second method in this controller checks if penalty points are being updated correctly or not. One key aspect to testing this function was the mocking of the helper method. Our model depends on a helper file to update penalty points based on certain factors. Since the functionality of the model should be independent of helper behavior, we have mocked that call. The calculation of penalty is based on the type of the deadline which can have 4 possible values :&lt;br /&gt;
* nil&lt;br /&gt;
* 1&lt;br /&gt;
* 2&lt;br /&gt;
* 5&lt;br /&gt;
&lt;br /&gt;
Based on each none or one of the penalty points from submission, review or meta_review gets updated. Our test suite goes through each and ensures the correct one is being updated. &lt;br /&gt;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_3.png&amp;diff=141671</id>
		<title>File:Test 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_3.png&amp;diff=141671"/>
		<updated>2021-11-27T02:36:48Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_2.png&amp;diff=141670</id>
		<title>File:Test 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_2.png&amp;diff=141670"/>
		<updated>2021-11-27T02:36:38Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_1.png&amp;diff=141669</id>
		<title>File:Test 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_1.png&amp;diff=141669"/>
		<updated>2021-11-27T02:36:28Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141119</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141119"/>
		<updated>2021-11-07T16:39:44Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Project Scope */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Project Scope==&lt;br /&gt;
[[File:Rsz late policy.png|600px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
All the issues raised mainly exist in the &amp;quot;Due Dates&amp;quot; tab on the &amp;quot;Edit Assignment&amp;quot; page.&lt;br /&gt;
* '''Issue 1''' - 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''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 3''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 4''' - Analyze and fix required function and write appropriate test cases (late_policies_controller.rb).&lt;br /&gt;
* '''Issue 5''' - Write new test cases for late_policies_controller.rb and late_policy.rb.&lt;br /&gt;
&lt;br /&gt;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141116</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141116"/>
		<updated>2021-11-07T16:35:43Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Project Scope==&lt;br /&gt;
[[File:Rsz late policy.png|600px]]&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;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141115</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141115"/>
		<updated>2021-11-07T16:07:22Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.&lt;br /&gt;
&lt;br /&gt;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141114</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141114"/>
		<updated>2021-11-07T16:06:25Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
====Refactoring and Design Patterns====&lt;br /&gt;
Since our goal is to fix existing functionalities we will not be updating the existing design patterns being employed in the code. Yet, we would like to discuss what makes these refactoring important. Refactoring is a systematic process of improving code without creating new functionality. Thus, a key to the success of our project is ensuring everything that was working before our changes work even after our changes have been added. To ensure this, we will continue to test the system after each issue has been fixed. This will allow us to ensure two things:&lt;br /&gt;
&lt;br /&gt;
* We are only changing what we set out to change when fixing a particular issue.&lt;br /&gt;
* We are not breaking what was working before we deployed our fix.&lt;br /&gt;
&lt;br /&gt;
We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developer alike.&lt;br /&gt;
&lt;br /&gt;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=141113</id>
		<title>CSC/ECE 517 Fall 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=141113"/>
		<updated>2021-11-07T15:49:01Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Final Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2117. Refactor questionaires_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2128. Refactor student_quizzes_controller.rb &amp;amp; late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2129. Refactor auth_controller.rb &amp;amp; password_retrieval_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2132. Add tests cases for review mapping helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2134. Write unit tests for admin_controller.rb and institution_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2138. Auto-generate submission directory names based on assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2142. Improve e-mail notifications]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2133. Write tests for popup_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2120. Refactor reputation_web_service_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2139. Remove multiple topics at a time]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2131. Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2121. Refactor suggestion_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2122. Refactor impersonate_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2123. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2126. Refactor account_request_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2124. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2125. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2127. Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2130. Refactor submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2140. Create new late policy successfully and fix Bank link]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp;amp; Institutions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2144. Refactor delayed mailer and scheduled task]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2147. Role-based reviewing]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2146. Introduce a Student View for instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - Refactor Evaluation of SQL Queries]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2135. Email notification to reviewers and instructors]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2149. Finish Github metrics integration - Reputations]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2166._Testing_-_Scoring_%26_Grades#Description_about_project CSC/ECE 517 Fall 2021 - E2166. Testing - Scoring_and_Grades]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2150._Integrate_suggestion_detection_algorithm#Description_about_project CSC/ECE 517 Fall 2021 - E2150. Integrate suggestion detection algorithm]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2151._Allow_reviewers_to_bid_on_what_to_review CSC/ECE 517 Fall 2021 - E2151. Allow reviewers to bid on what to review]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2152._Revision_planning_tool#Description_about_project CSC/ECE 517 Fall 2021 - E2152. Revision_planning_tool]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2170._Testing_-_Response_Maps#Description_about_project CSC/ECE 517 Fall 2021 - E2170. Testing - Response Maps]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2153._Improving_search_facility_in_Expertiza#Description_about_project CSC/ECE 517 Fall 2021 - E2153. Improving search facility in Expertiza]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2162._Further_refactoring_and_improvement_of_review_mapping_helper CSC/ECE 517 Fall 2021 - E2162. Further refactoring and improvement of review mapping helper]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2163._Refactor_waitlist_functionality CSC/ECE 517 Fall 2021 - E2163.  Refactor waitlist functionality]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2165._Fix_teammate-review_view CSC/ECE 517 Fall 2021 - E2165. Fix teammate review view ]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2155._Calibration_submissions_should_be_copied_along_with_calibration_assignments CSC/ECE 517 Fall 2021 - E2155. Calibration submissions should be copied along with calibration assignments]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2148._Completion/Progress_View CSC/ECE 517 Fall 2021 - E2148. Completion/Progress view]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2158._Grading_audit_trail CSC/ECE 517 Fall 2021 - E2158. Grading audit trail ]&lt;br /&gt;
*[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2159._Expertiza_internationalization CSC/ECE 517 Fall 2021 - E2159. Expertiza internationalization]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2160._Implementing_and_testing_import_export_controllers#Description_about_project CSC/ECE 517 Fall 2021 - E2160. Implementing and testing import and export controllers]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2164._Heatgrid_fixes_and_improvements#Description_about_project CSC/ECE 517 Fall 2021 - E2164. Heatgrid fixes and improvements]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2168. Testing - Reputations]]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2126._Testing_-_Team_Related_Files#Description_about_project CSC/ECE 517 Fall 2021 - E2126. Testing - Team Related Files]&lt;br /&gt;
* [https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2021_-_E2156._Issues_related_to_meta-reviewing#Description_about_project CSC/ECE 517 Fall 2021 - E2156. Issues related to meta-reviewing]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging]]&lt;br /&gt;
* [[E2157. Fix issues related to deadlines and late policies]]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141112</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141112"/>
		<updated>2021-11-07T15:45:07Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Expected Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141111</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141111"/>
		<updated>2021-11-07T15:40:35Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
'''11/06''' – Update Project Design Document based on feedback from Round 1&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141110</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141110"/>
		<updated>2021-11-07T15:38:29Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem description, Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141109</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141109"/>
		<updated>2021-11-07T15:38:11Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem description, Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Problem description, 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;
'''Problem Description: ''' Usage of different terms for the same thing causes ambiguity and can lead to unfortunate errors. In this instance having two different terms for &amp;quot;late policy&amp;quot; will cause confusion when instructors are creating assignments. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' To avoid confusion, use “late policy” exclusively. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Issue 2: Late policies cannot be created without raising an error &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The current implementation throws errors whenever late policies are created. Most of these errors are from the end of the system and not users. This is not desirable from our system as it should be able to handle internal errors and throw error messages only when they are absolutely required.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
&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;
'''Problem Description: ''' The &amp;quot;back&amp;quot; button functionality is broken. In an extensive system like ours, such issues can make our users irritable and do not provide them with the best user experience. These navigation buttons are an important part of the system and should take the users to correct pages. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that on click of the back button, the user is taken back to the assignment page.&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;
'''Problem Description: ''' If I create an assignment by copying an old assignment, the due dates are copied too.  It is likely that I want the same increment between due dates as in the old assignment (e.g., two days for the review phase, three days for resubmission, etc.).  To avoid the need to edit all the deadlines manually, Expertiza has a date updater. Currently, the broken &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; button make it hard for our users to take full advantage of this functionality. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Editing the code linked to these button should allow us to ensure that users can increment and decrement between dates as per requirements. &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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:'''&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141108</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141108"/>
		<updated>2021-11-07T15:24:59Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Problem description, Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 1: Code is missing comments.&amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' These changes were part of an already extensive implementation and thus the lack of comments makes it hard to follow the code. Proper use of commenting can make code maintenance much easier, as well as helping make finding bugs faster. Further, commenting is very important when writing functions that other people will use. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Adding comments to the late policy code flow for better readability. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Two flash messages were removed which were conveying what went wrong. &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The flash messages were good enough and helped convey what went wrong. Without them, it could be difficult for a user to figure out their mistakes and make it harder for them to make corrections. Retaining them will make our system more user-friendly. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that all correct error messages are flashed to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 3: 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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' 1. Add test file for late_policies_controller_spec.rb with appropriate test cases.&lt;br /&gt;
&lt;br /&gt;
2. Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 4: Have a test to check the min penalty as well rather than just the cap and make sure all checks pass &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' Currently we do not have a test that can also check the min penalty. Though it does not break anything, it will be a good to have check in the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Add new test cases wherever required in the code and increase the test coverage and also ensure all existing test cases are passing and functionality&lt;br /&gt;
is working as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141107</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141107"/>
		<updated>2021-11-07T15:20:03Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Expected Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
&lt;br /&gt;
This Project will be a continuation of the previous work done at #[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies E1978]&lt;br /&gt;
&lt;br /&gt;
Following problems were fixed in the previous work:&lt;br /&gt;
&lt;br /&gt;
* 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;
* Late policies cannot be created without raising an error.&lt;br /&gt;
* After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
While reviewing these changes, Expertiza developers raised the following issues/comments :&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1''' - Code is missing comments.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Two flash messages were removed that were conveying what went wrong.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - late_policy.rb and late_policies_controller.rb doesn't have any tests.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - have a test to check the min penalty as well rather than just the cap.&lt;br /&gt;
&lt;br /&gt;
These issues have made it difficult for the team to merge changes into the live code and thus our goal is to fix these issues and make the code ready for deployment.&lt;br /&gt;
&lt;br /&gt;
==Problem description, Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 1: Code is missing comments.&amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' These changes were part of an already extensive implementation and thus the lack of comments makes it hard to follow the code. Proper use of commenting can make code maintenance much easier, as well as helping make finding bugs faster. Further, commenting is very important when writing functions that other people will use. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Adding comments to the late policy code flow for better readability. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Two flash messages were removed which were conveying what went wrong. &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The flash messages were good enough and helped convey what went wrong. Without them, it could be difficult for a user to figure out their mistakes and make it harder for them to make corrections. Retaining them will make our system more user-friendly. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that all correct error messages are flashed to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 3: 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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' 1. Add test file for late_policies_controller_spec.rb with appropriate test cases.&lt;br /&gt;
&lt;br /&gt;
2. Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 4: Have a test to check the min penalty as well rather than just the cap and make sure all checks pass &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' Currently we do not have a test that can also check the min penalty. Though it does not break anything, it will be a good to have check in the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Add new test cases wherever required in the code and increase the test coverage and also ensure all existing test cases are passing and functionality&lt;br /&gt;
is working as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141106</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141106"/>
		<updated>2021-11-07T15:06:36Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
&lt;br /&gt;
This Project will be a continuation of the previous work done at #[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies E1978]&lt;br /&gt;
&lt;br /&gt;
Following problems were fixed in the previous work:&lt;br /&gt;
&lt;br /&gt;
* 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;
* Late policies cannot be created without raising an error.&lt;br /&gt;
* After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
While reviewing these changes, Expertiza developers raised the following issues/comments :&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1''' - Code is missing comments.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Two flash messages were removed that were conveying what went wrong.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - late_policy.rb and late_policies_controller.rb doesn't have any tests.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - have a test to check the min penalty as well rather than just the cap.&lt;br /&gt;
&lt;br /&gt;
These issues have made it difficult for the team to merge changes into the live code and thus our goal is to fix these issues and make the code ready for deployment.&lt;br /&gt;
&lt;br /&gt;
==Problem description, Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 1: Code is missing comments.&amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' These changes were part of an already extensive implementation and thus the lack of comments makes it hard to follow the code. Proper use of commenting can make code maintenance much easier, as well as helping make finding bugs faster. Further, commenting is very important when writing functions that other people will use. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Adding comments to the late policy code flow for better readability. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 2: Two flash messages were removed which were conveying what went wrong. &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' The flash messages were good enough and helped convey what went wrong. Without them, it could be difficult for a user to figure out their mistakes and make it harder for them to make corrections. Retaining them will make our system more user-friendly. &lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Ensure that all correct error messages are flashed to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 3: 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;
'''Problem Description: ''' The purpose of a test case is to determine if different features within a system are performing as expected and to confirm that the system satisfies all related standards, guidelines, and customer requirements. The process of writing a test case can also help reveal errors or defects within the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' 1. Add test file for late_policies_controller_spec.rb with appropriate test cases.&lt;br /&gt;
&lt;br /&gt;
2. Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt; Issue 4: Have a test to check the min penalty as well rather than just the cap and make sure all checks pass &amp;lt;/h3&amp;gt;&lt;br /&gt;
'''Problem Description: ''' Currently we do not have a test that can also check the min penalty. Though it does not break anything, it will be a good to have check in the system.&lt;br /&gt;
&lt;br /&gt;
'''Fix:''' Add new test cases wherever required in the code and increase the test coverage and also ensure all existing test cases are passing and functionality&lt;br /&gt;
is working as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141105</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141105"/>
		<updated>2021-11-07T14:51:17Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Issues with the Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
&lt;br /&gt;
This Project will be a continuation of the previous work done at #[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies E1978]&lt;br /&gt;
&lt;br /&gt;
Following problems were fixed in the previous work:&lt;br /&gt;
&lt;br /&gt;
* 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;
* Late policies cannot be created without raising an error.&lt;br /&gt;
* After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
While reviewing these changes, Expertiza developers raised the following issues/comments :&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1''' - Code is missing comments.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Two flash messages were removed that were conveying what went wrong.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - late_policy.rb and late_policies_controller.rb doesn't have any tests.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - have a test to check the min penalty as well rather than just the cap.&lt;br /&gt;
&lt;br /&gt;
These issues have made it difficult for the team to merge changes into the live code and thus our goal is to fix these issues and make the code ready for deployment.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 1: Code is missing comments.&amp;lt;/h4&amp;gt;&lt;br /&gt;
Adding comments to the late policy code flow for better readability. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 2: Two flash messages were removed which were conveying what went wrong. &amp;lt;/h4&amp;gt;&lt;br /&gt;
Ensure that all correct error messages are flashed to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 3: 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;/h4&amp;gt;&lt;br /&gt;
Add test file for late_policies_controller_spec.rb with appropriate test cases&lt;br /&gt;
Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 4: have a test to check the min penalty as well rather than just the cap and make sure all checks pass &amp;lt;/h4&amp;gt;&lt;br /&gt;
Add new test cases wherever required in the code and increase the test coverage and also ensure all existing test cases are passing and functionality&lt;br /&gt;
is working as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141104</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=141104"/>
		<updated>2021-11-07T14:51:04Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
&lt;br /&gt;
This Project will be a continuation of the previous work done at #[https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1978._Fix_issues_related_to_deadlines_and_late_policies E1978]&lt;br /&gt;
&lt;br /&gt;
Following problems were fixed in the previous work:&lt;br /&gt;
&lt;br /&gt;
* 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;
* Late policies cannot be created without raising an error.&lt;br /&gt;
* After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* 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.&lt;br /&gt;
&lt;br /&gt;
While reviewing these changes, Expertiza developers raised the following issues/comments :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 1''' - Code is missing comments.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Two flash messages were removed that were conveying what went wrong.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 3''' - late_policy.rb and late_policies_controller.rb doesn't have any tests.&lt;br /&gt;
&lt;br /&gt;
* '''Issue 4''' - have a test to check the min penalty as well rather than just the cap.&lt;br /&gt;
&lt;br /&gt;
These issues have made it difficult for the team to merge changes into the live code and thus our goal is to fix these issues and make the code ready for deployment.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 1: Code is missing comments.&amp;lt;/h4&amp;gt;&lt;br /&gt;
Adding comments to the late policy code flow for better readability. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 2: Two flash messages were removed which were conveying what went wrong. &amp;lt;/h4&amp;gt;&lt;br /&gt;
Ensure that all correct error messages are flashed to the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 3: 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;/h4&amp;gt;&lt;br /&gt;
Add test file for late_policies_controller_spec.rb with appropriate test cases&lt;br /&gt;
Add test file for late_policies_spec.rb with appropriate test cases&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt; Issue 4: have a test to check the min penalty as well rather than just the cap and make sure all checks pass &amp;lt;/h4&amp;gt;&lt;br /&gt;
Add new test cases wherever required in the code and increase the test coverage and also ensure all existing test cases are passing and functionality&lt;br /&gt;
is working as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Expected Results==&lt;br /&gt;
We expect the new code changes should not break existing functionality and the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
'''Automated Testing Using Capybara'''&lt;br /&gt;
&lt;br /&gt;
We plan to create UI test framework using Capybara with Cucumber that automates the manual testing path and saves time and repetitive effort. These tests will be written prior to code and define the expected behavior of policy controller.&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''11/03''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/wshubham/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/2127 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140324</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140324"/>
		<updated>2021-11-01T17:20:40Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Expected Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To avoid confusion, use “late policy” exclusively.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
    &lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that on click of the back button, the user is taken back to the assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
We expect the following results upon completion:&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Issue 5''' - The code coverage will 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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140323</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140323"/>
		<updated>2021-11-01T17:17:09Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To avoid confusion, use “late policy” exclusively.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
    &lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that on click of the back button, the user is taken back to the assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140322</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140322"/>
		<updated>2021-11-01T17:16:44Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* What needs to be done */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To avoid confusion, use “late policy” exclusively.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
    &lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that on click of the back button, the user is taken back to the assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140321</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140321"/>
		<updated>2021-11-01T17:16:34Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;To avoid confusion, use “late policy” exclusively.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.0&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;
    &lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Ensure that on click of the back button, the user is taken back to the assignment page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h4&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;/h4&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for late_policies_controller_spec.rb with appropriate test cases&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add test file for 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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140320</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140320"/>
		<updated>2021-11-01T17:08:32Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Issues with the Current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&lt;br /&gt;
The following issues have been raised in the current implementation:&lt;br /&gt;
* '''Issue 1''' - In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140319</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140319"/>
		<updated>2021-11-01T17:06:27Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The team found some issues in the current implementation which either cause errors are completely not functional. The goal of this project is to eliminate these issues by making necessary changes and adding new test cases which cover all scenarios. &lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Issue 2''' - Late policies cannot be created without raising an error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140318</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140318"/>
		<updated>2021-11-01T17:03:46Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* E2157 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The current implementation of this feature has issues&lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140317</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140317"/>
		<updated>2021-11-01T17:03:04Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The current implementation of this feature has issues&lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140316</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140316"/>
		<updated>2021-11-01T17:02:56Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Problem Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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). The current implementation of this feature has issues&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Issues with the Current Implementation====&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140315</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140315"/>
		<updated>2021-11-01T16:54:25Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140314</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140314"/>
		<updated>2021-11-01T16:54:16Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Project Mentors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140313</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140313"/>
		<updated>2021-11-01T16:54:06Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Useful Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
===E2157===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140312</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140312"/>
		<updated>2021-11-01T16:53:50Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140311</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140311"/>
		<updated>2021-11-01T16:53:39Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Milestones */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&lt;br /&gt;
'''10/25''' – Project Selection&lt;br /&gt;
&lt;br /&gt;
'''10/26''' – Develop Project Design Document&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Project Mentors==&lt;br /&gt;
*Tirth Patel&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;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140310</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140310"/>
		<updated>2021-11-01T16:45:02Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Expected Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
&lt;br /&gt;
==Milestones==&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;
*Tirth Patel&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;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140309</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140309"/>
		<updated>2021-11-01T16:44:47Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Approach &amp;amp; Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
'''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;
*Tirth Patel&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;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140308</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140308"/>
		<updated>2021-11-01T16:43:50Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue1.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue2.png|650px]]&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;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue31.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Qissue32.png|650px]]&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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue41.png|650px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Issue42.png|650px]]&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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|650px]]&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|650px]]&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|650px]]&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|650px]]&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|650px]]&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;
'''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;
*Tirth Patel&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;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140260</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140260"/>
		<updated>2021-10-31T15:50:30Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Problem Description==&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;
&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”.&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;
&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;
&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.&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;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
==Approach &amp;amp; Fix==&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;h4&amp;gt;Issue 1: Renaming penalty policy to late policy&amp;lt;/h4&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;h4&amp;gt;Issue 2: Late policies cannot be created without raising an error&amp;lt;/h4&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;h4&amp;gt;Issue 3: After creating a late policy, the “back” link does not take the user back to editing the assignment.&amp;lt;/h4&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;h4&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;/h4&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;h4&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;/h4&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;
Each Issue is described with the predicted fix and a screenshot showing the issue fixed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;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;
'''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;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Team Members==&lt;br /&gt;
----&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Useful Links==&lt;br /&gt;
----&lt;br /&gt;
===E1978===&lt;br /&gt;
#[https://github.com/Natansh21/expertiza/tree/beta GitHub forked repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/compare/beta...Natansh21:beta?expand=1 Pull Request]&lt;br /&gt;
#[http://152.46.16.30:8080 Deployed Expertiza Environment]&lt;br /&gt;
#[https://youtu.be/HLK_XaW_6dA Screencast video on YouTube]&lt;br /&gt;
&lt;br /&gt;
===Expertiza===&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ Live Expertiza website]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140259</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140259"/>
		<updated>2021-10-31T15:34:26Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Anmol Lunavat&lt;br /&gt;
* Shubham Waghe&lt;br /&gt;
* Vishal Sharma&lt;br /&gt;
&lt;br /&gt;
== Video walk through ==&lt;br /&gt;
A link to the video on completion of the project will be added here&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&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;
[[File:Late_policy.PNG]]&lt;br /&gt;
&lt;br /&gt;
There are a few bugs in the current implementation and a few checks missing. The aim of this project is to resolve known bugs and ensure seamless functionality.&lt;br /&gt;
== The Plan ==&lt;br /&gt;
The project mainly deals with fixing known bugs in the functionality and UI. At the end of the project, the following should be resolved:&lt;br /&gt;
* In the UI, the policy is sometimes called a “late policy” and sometimes a “penalty policy”. &lt;br /&gt;
* Late policies cannot be created without raising an error.&lt;br /&gt;
* After creating a late policy, the “back” link does not take the user back to editing the assignment.&lt;br /&gt;
* The &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons for Show/Hide Date Updater do not work.&lt;br /&gt;
* Missing test cases for late_policy.rb and late_policies_controller.rb.&lt;br /&gt;
=== What needs to be done ===&lt;br /&gt;
We will resolve each of these issues in the following manner:&lt;br /&gt;
* To avoid confusion, use “late policy” exclusively.&lt;br /&gt;
* Ensure that all errors being raised are fixed. This will be achieved by modifying existing code and bringing new checks as and when required.&lt;br /&gt;
* Ensure that on click of the back button, the user is taken back to the assignment page.&lt;br /&gt;
* Expertiza has a way to adjust the dates on assignments. This is especially helpful when an assignment is copied from another and the dates get copied too. We need to ensure the &amp;quot;+&amp;quot; and &amp;quot;-&amp;quot; buttons update the dates accordingly.&lt;br /&gt;
* Add test cases for late_policy.rb and late_policies_controller.rb. This will further be discussed in the Test Plan section of the page.&lt;br /&gt;
&lt;br /&gt;
== Workflow Diagram ==&lt;br /&gt;
The main workflow of the mentor management for assignments without topics is outline below.  &lt;br /&gt;
[[File:Mentor management.png|thumb|center|border|520px|]]&lt;br /&gt;
&lt;br /&gt;
== Logic Design ==&lt;br /&gt;
The following main logic components are described below. Each block of logic is to be independent from one another, in order to avoid DRY and de-couple code responsibility.&lt;br /&gt;
===='''selectMentor()'''====&lt;br /&gt;
In order to assign a mentor to a group, we must first choose a mentor wisely in the system. The requirements document suggests &amp;quot;Mentors should be evenly assigned to teams, so a good strategy is to assign the mentor who has the fewest teams to mentor so far.&amp;quot; This can be implemented using a min-heap-based priority queue, where a mentor's priority is the count of the number of teams to which they're assigned.&lt;br /&gt;
&lt;br /&gt;
===='''updateMentorStates()'''====&lt;br /&gt;
The responsibility of this function will be to check if the team satisfy the conditions for the auto assign of mentor. This method will utilize the selectMentor() if the conditions are met. It will use the existing methods in the Team.rb that coded by expertiza team to add the mentor.&lt;br /&gt;
===='''notifyTeam()'''====&lt;br /&gt;
This is going to be a simple function that takes care of sending an email to a) the mentor, and b) the project teammates to:&lt;br /&gt;
# Notify the team they have been assigned a mentor and pass along their contact information&lt;br /&gt;
# Pass along the contact information for the team members to the mentor&lt;br /&gt;
&lt;br /&gt;
== UI Design ==&lt;br /&gt;
A simplistic UI design approach is to be implemented. Below is a mock rendering of the new information that will appear on the &amp;lt;code&amp;gt;student_teams/view?student_id=&amp;lt;/code&amp;gt; expertiza page. The value will be only present if the mentor has been automatically assigned.&lt;br /&gt;
[[File:Team student view.png|thumb|center|520px|]]&lt;br /&gt;
&lt;br /&gt;
The instructor view will also need to have visibility of what mentors the teams have. Below is a mock rendering of the new information that will appear on the &amp;lt;code&amp;gt;/teams/list?type=Course&amp;amp;id=&amp;lt;/code&amp;gt; expertiza page. The role column will be added.&lt;br /&gt;
[[File:Team admin view.png|thumb|center|520px|]]&lt;br /&gt;
&lt;br /&gt;
== Code Modifications ==&lt;br /&gt;
=== Controllers ===&lt;br /&gt;
==== Files ====&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-88d9bf9a58c1b9896848beeb69f9eb362428ad6f8f5999ca3dd78e2b2f7bb28e app/controllers/teams_users_controller.rb]&lt;br /&gt;
==== Code Snippets ====&lt;br /&gt;
[[File:teams_user_controller.png|thumb|center|520px|]]&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
This code will Kick off the Mentor Management workflow from the perspective of the instructor when adding members. This is not supported for CourseTeams which is why the other half of this if block does not include the same code. This code can be further enhanced by consolidating where members get added to a single place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Models ===&lt;br /&gt;
==== Files and Code Snippets ====&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-45779566bc2430be219713f18b2aad5dfea8b24708eeab7d8436787ec2e422a8 app/models/participant.rb] [[File:participate.png|thumb|center|520px|]]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-f75b174cbda975a5b5b98509b36d2ee7619ce19ea5b9b2f439f4ef159cc46c1a app/models/mentor_management.rb] [[File:part1.png|thumb|center|520px|]] [[File:part2.png|thumb|center|520px|]]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-dfe026d6f5d01abbea59eaf5f3935355410368e3522f27ca9092ad626675d04b app/models/assignment_form.rb] [[File:assignment_form.png|thumb|center|520px|]]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-c899291de1875b0c2483c0f132ed4503e6c33be63148d6e5d1f4235bfeb1c331 app/models/invitation.rb] [[File:invitation.png|thumb|center|520px|]]&lt;br /&gt;
&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
===== participant.rb =====&lt;br /&gt;
A string constant called DUTY_MENTOR was added to the Participant model, since the duty column of the participants table was used to hold this title. The constant name is prefixed with DUTY_ in the event that other duty titles are added in the future.&lt;br /&gt;
&lt;br /&gt;
===== mentor_management.rb =====&lt;br /&gt;
Lastly the mentor management class is the main logic for the feature. This class essentially implements the Singleton pattern, but rather than using the &amp;lt;code&amp;gt;Singleton&amp;lt;/code&amp;gt; module it is just a set of class methods. &lt;br /&gt;
&lt;br /&gt;
====== #select_mentor ======&lt;br /&gt;
The select mentor method selects a mentor using the following algorithm:&lt;br /&gt;
# Find all assignment participants for the assignment with id [assignment_id] whose duty is the same as [Particpant#DUTY_MENTOR].&lt;br /&gt;
# Count the number of teams those participants are a part of, acting as a proxy for the number of teams they mentor.&lt;br /&gt;
# Return the mentor with the fewest number of teams they're currently mentoring.,This method's runtime is O(n lg n) due to the call to, Hash sort_by. This assertion assumes that the database management system is capable of fetching the required rows at least as quickly.&lt;br /&gt;
&lt;br /&gt;
====== #assign_mentor ======&lt;br /&gt;
The auto_assign_mentor method is the main entrypoint in to the mentor management workflow. &lt;br /&gt;
&lt;br /&gt;
In Expertiza, team members can be added in two ways:&lt;br /&gt;
# A user accepts an invitation to join a team&lt;br /&gt;
# A user with high enough privileges (e.g. an instructor) manually adds a user to a team&lt;br /&gt;
&lt;br /&gt;
These two events happen in two different places in the code: invitation.rb and teams_controller.rb respectively. In both cases, assign_mentor is called.&lt;br /&gt;
&lt;br /&gt;
The following preconditions must be met for a mentor to be added to a team:&lt;br /&gt;
* The assignment must have the auto_assign_mentor flag enabled (i.e. set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Neither the assignment nor the team can have topics assigned to them&lt;br /&gt;
* The newly added team member must increase the team size to strictly greater than 50% of the maximum team capacity for the assignment&lt;br /&gt;
* The team cannot already have a mentor assigned to the team&lt;br /&gt;
&lt;br /&gt;
If these conditions are met, assign_mentor calls #select_mentor to choose a mentor from the pool of mentors, and then assigns them to the team. If this is successful then a notification email is sent out to all current team members, and the new mentor at the same time so everyone knows how to contact everyone else.&lt;br /&gt;
&lt;br /&gt;
===== assignment_form.rb =====&lt;br /&gt;
The assignment form needed a new :auto_assign_mentor flag added to its model. This will allow for the auto assign mentor feature to be disabled if the instructor does not want the work flow executed for the assignment.&lt;br /&gt;
&lt;br /&gt;
===== invitation.rb =====&lt;br /&gt;
One trigger had to be added to invitation.rb so when users accept invitations to join a team the mentor management logic can execute.&lt;br /&gt;
&lt;br /&gt;
=== Views ===&lt;br /&gt;
==== Files and Code Snippets ====&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-25229b4f0807107f2f4289bcbfff7bfe4028fb0aada5896dd147e9f703f52758 app/views/assignments/edit/_general.html.erb] [[File:general.png|thumb|center|520px|]]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-4ba1a3986521a5504ac067e8200851895115a0b30f4d8a31514d2221d4c0d8b2 app/views/student_teams/view.html.erb] [[File:view_html.png|thumb|center|520px|]]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-03c8e92504f472a4b2e3775e571fb395a4cebf408f130d21a619a83b7183d873 app/models/teams_user.rb] [[File:team_user.png|thumb|center|520px|]]&lt;br /&gt;
&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
Two views were updated in the Expertiza application to allow the user to see who the mentor is on their team. The Expertiza application makes use of plenty of view partials to compose the UI. We tried to find the least intrusive place among the pile of view partials where we could add a new column for displaying the duty title for mentors. This also had to be done in two places, since the instructor view of a team is different than the student's view of the same team. For the former, teams_user.rb was updated to append &amp;lt;code&amp;gt;(Mentor)&amp;lt;/code&amp;gt; to a user's name in the view.&lt;br /&gt;
&lt;br /&gt;
=== Database ===&lt;br /&gt;
==== Files ====&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-20561383413b93d6001df218448415d212cb5161253bbfc8f172da6bbf12d4b8 db/migrate/20210422185445_add_auto_assign_mentor_column.rb]&lt;br /&gt;
# [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D=#diff-cbf8b25d6d853acf58fa9057841f407d29ffe90649c75cf9e3f51b2d6e3aa1d3 db/schema.rb]&lt;br /&gt;
==== Code Snippets ====&lt;br /&gt;
[[File:add_auto_assign_mentor.png|thumb|center|520px|]]&lt;br /&gt;
==== Explanation ====&lt;br /&gt;
Our team tried to avoid any database changes, but in order to add a flag for disabling the mentor management functionality we added a new boolean column to the assignments table called auto_assign_mentor.&lt;br /&gt;
&lt;br /&gt;
=== Test Files ===&lt;br /&gt;
==== Files ====&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D= spec/factories/factories.rb] &lt;br /&gt;
: Update the assignment factory to include a default value for the new auto_assign_mentor flag for testing.&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D= spec/models/invitation_spec.rb]&lt;br /&gt;
: Update invitation_spec.rb to resolve failing tests after the addition of code to trigger mentor management in invitation.rb.&lt;br /&gt;
* [https://github.com/expertiza/expertiza/pull/1957/files?file-filters%5B%5D= spec/models/mentor_management_spec.rb]&lt;br /&gt;
: Implement tests for the &amp;lt;code&amp;gt;MentorManagement&amp;lt;/code&amp;gt; class.&lt;br /&gt;
&lt;br /&gt;
== Manual Testing instruction ==&lt;br /&gt;
# Login as instructor6, using 'password' as password and find the '''Rock on Assignment'''&lt;br /&gt;
# Check the paticipants for this assignment, make sure there are some students attempting this assignment.&lt;br /&gt;
#* You can add your own students to the assignment if you want.&lt;br /&gt;
# Impersonate the student account you found.If there is no team, create one by inviting other student to your team, or create a team using the admin control.&lt;br /&gt;
# By toggling the '''Auto assign mentors when team hits &amp;gt; 50% capacity?''' in the assignment configuration page you will be able to:&lt;br /&gt;
#* Enable the functionarities and logics that our team implemented.&lt;br /&gt;
#* Disable the functionarities and logics that our team implemented to allow an admin to assign mentor manully.&lt;br /&gt;
&lt;br /&gt;
==== Two Observations (Trigger Enabled) ====&lt;br /&gt;
# Add team members to any team under the '''Rock on Assignment''' using any following way:&lt;br /&gt;
#* Invitate/Accept the team invitation using impersonated student accounts.&lt;br /&gt;
#* Add student to team by using the admin control.&lt;br /&gt;
# Observe that when the member size passing the capacity (3 for this Rock on assignment), a mentor called '''Student6801''' will be added to the assignment team.&lt;br /&gt;
# Remove the mentor and the added students of the assignment team using the admin control.&lt;br /&gt;
# Observe that when the member size below the capacity (e.g. the second team member added), a mentor will not be added to the assignment team.&lt;br /&gt;
# You should also be able to see that mentor is showing on the team list.&lt;br /&gt;
&lt;br /&gt;
==== Two Observations (Trigger Disabled) ====&lt;br /&gt;
# By doing similar step as we mentioned above, you should not see any of the following:&lt;br /&gt;
#* A mentor is added to the team after the team size changed.&lt;br /&gt;
#* A mentor is displaying on the team list unless this mentor account: '''Student6801''' is manually added or invited.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Based on the the workflow diagram we propose, we should be including a minimum of 5 tests: 1 for &amp;lt;code&amp;gt;addMentor&amp;lt;/code&amp;gt;, 1 for &amp;lt;code&amp;gt;removeMentor&amp;lt;/code&amp;gt;, 1 for &amp;lt;code&amp;gt;selectMentor&amp;lt;/code&amp;gt;, and 2 more to exercise the paths through our workflow diagram.&lt;br /&gt;
&lt;br /&gt;
# A team will have a mentor after &amp;lt;code&amp;gt;addMentor&amp;lt;/code&amp;gt; is called.&lt;br /&gt;
# A team will have a mentor removed after &amp;lt;code&amp;gt;removeMentor&amp;lt;/code&amp;gt; is called.&lt;br /&gt;
# The mentor with lowest number of team assigned will be return after &amp;lt;code&amp;gt;selectMentor&amp;lt;/code&amp;gt; is called.&lt;br /&gt;
# The &amp;lt;code&amp;gt;selectMentor&amp;lt;/code&amp;gt; except not to receive any message if a team already has a mentor.&lt;br /&gt;
# The &amp;lt;code&amp;gt;selectMentor&amp;lt;/code&amp;gt; except not to receive any message if a team has size &amp;lt; 50% of the maximum size.&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Late_policy.PNG&amp;diff=140258</id>
		<title>File:Late policy.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Late_policy.PNG&amp;diff=140258"/>
		<updated>2021-10-31T15:20:49Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140257</id>
		<title>E2157. Fix issues related to deadlines and late policies</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2157._Fix_issues_related_to_deadlines_and_late_policies&amp;diff=140257"/>
		<updated>2021-10-31T15:15:41Z</updated>

		<summary type="html">&lt;p&gt;Alunava: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139954</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139954"/>
		<updated>2021-10-24T15:39:45Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This has contributions from Anmol Lunavat, Shubham Waghe and Vishal Sharma''&lt;br /&gt;
&lt;br /&gt;
This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
&lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep a track of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color for each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
Since our code changes were mostly linear, we can rely on existing test cases to cover all edge cases. The key check for us was to ensure a new entry to the Review Status Map is created as soon as a review has been requested. &lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
Since we did not add new controllers and are relying on existing implementation to help us update the status of the review, we have not added any other tests. A video of testing has been uploaded and one can follow Manual Testing steps to review/verify the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps for manual testing:&lt;br /&gt;
*Login using id: instructor6 password: password.&lt;br /&gt;
*Navigate to the Assignments tab under Manage.&lt;br /&gt;
*Create a new Assignment and assign to the following student ids : student2150, student2151, student2152.&lt;br /&gt;
*Navigate to Impersonate User under Manage.&lt;br /&gt;
*Impersonate as one of the users at a time and make a dummy submission.&lt;br /&gt;
*Once that is done and the stage of the assignment has changed to Review, go to Other's work tab and Request a new submission.&lt;br /&gt;
*A new review gets added to page and you should see the color as Red.&lt;br /&gt;
*Now click on Begin. Once satisfied click Save and hit back.&lt;br /&gt;
*Now you should see the highlighted color change to Orange.&lt;br /&gt;
*Once satisfied click View/Edit review and submit it.&lt;br /&gt;
*Now you should see the highlighted color change to Brown.&lt;br /&gt;
&lt;br /&gt;
''Please set the deadlines correctly and you should be good. Our code does not control the stages or deadlines and thus you will have to be careful in order to test everything.''&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139953</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139953"/>
		<updated>2021-10-24T15:37:19Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This has contributions from Anmol Lunavat, Shubham Waghe and Vishal Sharma''&lt;br /&gt;
&lt;br /&gt;
This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
&lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep a track of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color for each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
Since we did not add new controllers and are relying on existing implementation to help us update the status of the review, we have not added any other tests. A video of testing has been uploaded and one can follow Manual Testing steps to review/verify the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps for manual testing:&lt;br /&gt;
*Login using id: instructor6 password: password.&lt;br /&gt;
*Navigate to the Assignments tab under Manage.&lt;br /&gt;
*Create a new Assignment and assign to the following student ids : student2150, student2151, student2152.&lt;br /&gt;
*Navigate to Impersonate User under Manage.&lt;br /&gt;
*Impersonate as one of the users at a time and make a dummy submission.&lt;br /&gt;
*Once that is done and the stage of the assignment has changed to Review, go to Other's work tab and Request a new submission.&lt;br /&gt;
*A new review gets added to page and you should see the color as Red.&lt;br /&gt;
*Now click on Begin. Once satisfied click Save and hit back.&lt;br /&gt;
*Now you should see the highlighted color change to Orange.&lt;br /&gt;
*Once satisfied click View/Edit review and submit it.&lt;br /&gt;
*Now you should see the highlighted color change to Brown.&lt;br /&gt;
&lt;br /&gt;
''Please set the deadlines correctly and you should be good. Our code does not control the stages or deadlines and thus you will have to be careful in order to test everything.''&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139952</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139952"/>
		<updated>2021-10-24T15:34:25Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This has contributions from Anmol Lunavat, Shubham Waghe and Vishal Sharma''&lt;br /&gt;
&lt;br /&gt;
This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
&lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color to each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
Since we did not add new controllers and are relying on existing implementation to help us update the status of the review, we have not added any other tests. A video of testing has been uploaded and one can follow Manual Testing steps to review/verify the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''Manual Testing'''&lt;br /&gt;
&lt;br /&gt;
Please follow the below steps for manual testing:&lt;br /&gt;
*Login using id: instructor6 password: password.&lt;br /&gt;
*Navigate to the Assignments tab under Manage.&lt;br /&gt;
*Create a new Assignment and assign to the following student ids : student2150, student2151, student2152.&lt;br /&gt;
*Navigate to Impersonate User under Manage.&lt;br /&gt;
*Impersonate as one of the users at a time and make a dummy submission.&lt;br /&gt;
*Once that is done and the stage of the assignment has changed to Review, go to Other's work tab and Request a new submission.&lt;br /&gt;
*A new review gets added to page and you should see the color as Red.&lt;br /&gt;
*Now click on Begin. Once satisfied click Save and hit back.&lt;br /&gt;
*Now you should see the highlighted color change to Orange.&lt;br /&gt;
*Once satisfied click View/Edit review and submit it.&lt;br /&gt;
*Now you should see the highlighted color change to Brown.&lt;br /&gt;
&lt;br /&gt;
''Please set the deadlines correctly and you should be good. Our code does not control the stages or deadlines and thus you will have to be careful in order to test everything.''&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139939</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139939"/>
		<updated>2021-10-24T01:28:32Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This has contributions from Anmol Lunavat, Shubham Waghe and Vishal Sharma''&lt;br /&gt;
&lt;br /&gt;
This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color to each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139938</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139938"/>
		<updated>2021-10-24T01:26:08Z</updated>

		<summary type="html">&lt;p&gt;Alunava: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''This has contributions from Anmol Lunavat, Shubham Waghe and Vishal Sharma''&lt;br /&gt;
This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color to each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=139582</id>
		<title>CSC/ECE 517 Fall 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021&amp;diff=139582"/>
		<updated>2021-10-20T23:09:41Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* OSS Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - {$num}. {$desc.title}]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2128. Refactor student_quizzes_controller.rb &amp;amp; late_policies_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2132. Add tests cases for review mapping helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2134. Write unit tests for admin_controller.rb and institution_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2138. Auto-generate submission directory names based on assignment]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2142. Improve e-mail notifications]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2133. Write tests for popup_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2120. Refactor reputation_web_service_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2139. Remove multiple topics at a time]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2131. Improve assessment360_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2121. Refactor suggestion_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2122. Refactor impersonate_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2126. Refactor account_request_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2124. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2125. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2127. Refactor teams_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2130. Refactor submitted_content_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2141. OSS project Finklestein: Instructors &amp;amp; Institutions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2147. Role-based reviewing]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige]]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139581</id>
		<title>CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2145._OSS_Project_Beige&amp;diff=139581"/>
		<updated>2021-10-20T23:09:02Z</updated>

		<summary type="html">&lt;p&gt;Alunava: CSC/ECE 517 Fall 2021 - E2145. OSS Project Beige&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color to each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E2145._OSS_Project_Beige&amp;diff=139146</id>
		<title>E2145. OSS Project Beige</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E2145._OSS_Project_Beige&amp;diff=139146"/>
		<updated>2021-10-19T02:05:23Z</updated>

		<summary type="html">&lt;p&gt;Alunava: /* Rspec */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page provides description of changes made under E2145 OSS assignment for Fall 2021, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
==Problem Statement==&lt;br /&gt;
When a participant updates the submission after the reading the review comments, the reviewer will have to review it again when the second review cycle starts. However, since the reviewer may have multiple submissions to review, some of which are updated, and some that are not, it becomes difficult for the reviewer to identify the updated submissions that need attention. Currently there is no way of identifying the difference between updated and stale submissions.&lt;br /&gt;
&lt;br /&gt;
==Proposed Solution==&lt;br /&gt;
For identifying the submission status of the project in next review cycle, the reviewer should be able to quickly identify the submissions that need attention. This can be done in the UI of the reviewer’s page. The submissions can be color-coded using a scheme like the one used in the “Review Report” page.&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Red&amp;lt;/span&amp;gt; – If the review has not been started&lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:orange&amp;quot;&amp;gt;Orange&amp;lt;/span&amp;gt; – If the review was started, but not completed &lt;br /&gt;
* &amp;lt;span style=&amp;quot;color:brown&amp;quot;&amp;gt;Brown&amp;lt;/span&amp;gt; – Submission has been reviewed &lt;br /&gt;
&lt;br /&gt;
This solution will allows reviewers to identify and prioritize their work without having to dig deep into individual submissions.&lt;br /&gt;
&lt;br /&gt;
[[File:Workflow-Diagram.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
The following diagram illustrates how the control would flow. As the user acts on a review, the status of the review changes.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
The following would be the key tasks:&lt;br /&gt;
* Add a new model to track the status of a review&lt;br /&gt;
* Upon change of review stage, update the data in the database.&lt;br /&gt;
* Change color in the UI based on the status of the review.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
===List of Changes===&lt;br /&gt;
We came up with the following model to capture the status of a review. &lt;br /&gt;
[[File:Review Status Map.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
We will keep of the stage a review is in. The following would be the three stages of a review:&lt;br /&gt;
*Ready : As soon as a student requests for a new review.&lt;br /&gt;
*Started : Once a student has started the review.&lt;br /&gt;
*Completed : Once a review has been submitted.&lt;br /&gt;
&lt;br /&gt;
This will allow us to designate a unique color to each stage and update accordingly.&lt;br /&gt;
&lt;br /&gt;
[[File:Ready.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''As soon as a review is assigned to a user, create a new entry in the Review Status table with the status of &amp;quot;Ready&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Started.PNG|1000px]]&lt;br /&gt;
[[File:Started1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a student starts doing the review, we fetch the record from Review Status table and update the status to &amp;quot;Started&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
[[File:Completed.PNG|1000px]]&lt;br /&gt;
[[File:Completed1.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
'''Once a review is submitted from student's end we mark the status of the review to be &amp;quot;Completed&amp;quot;.'''&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
===Rspec===&lt;br /&gt;
 [[File:Test_Ready.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
This basic test checks that a review gets status as &amp;quot;Ready&amp;quot; when the user requests for a new review.&lt;br /&gt;
&lt;br /&gt;
===UI Testing===&lt;br /&gt;
WIP&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/WintersLt/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza project documentation wiki]&lt;br /&gt;
#[https://relishapp.com/rspec Rspec Documentation]&lt;/div&gt;</summary>
		<author><name>Alunava</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_Ready.PNG&amp;diff=139144</id>
		<title>File:Test Ready.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Test_Ready.PNG&amp;diff=139144"/>
		<updated>2021-10-19T02:04:01Z</updated>

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