CSC/ECE 517 Fall 2019 - E1960. Create new late policy successfully and fixing "Back" link: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
=== About Expertiza ===
== About Expertiza ==


Expertiza is an open-source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages
Expertiza is an open-source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages


=== Peer Review Information ===
== Peer Review Information ==


For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:
For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:
Line 22: Line 22:
6. Create/test new Late Policy !
6. Create/test new Late Policy !


=== Problem Statement ===
== Problem Statement ==
'''E1960. Create new late policy successfully and fixing "Back" link'''  
'''E1960. Create new late policy successfully and fixing "Back" link'''  


Line 36: Line 36:
If an instructor, while creating a policy, clicks on "Back" link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).
If an instructor, while creating a policy, clicks on "Back" link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).


=== Current Implementation ===
== Current Implementation ==
'''Functionality:'''
'''Functionality:'''
An Instructor has the option to create new late policies to be applied to the assignments.
An Instructor has the option to create new late policies to be applied to the assignments.
Line 42: Line 42:




=== Problems in Current Implementation ===
== Problems in Current Implementation ==
'''Problem 1: Failure to create a new policy'''
'''Problem 1: Failure to create a new policy'''
The create button on the new page of late_policy is not working.  
The create button on the new page of late_policy is not working.  
Line 53: Line 53:




=== Solutions to Problems in Current Implementation ===
== Solutions to Problems in Current Implementation ==


'''Problem 1: Failure to create a new policy'''
'''Problem 1: Failure to create a new policy'''
Line 108: Line 108:
3. Added RSPEC test cases for testing changes done in late_policies Controller.
3. Added RSPEC test cases for testing changes done in late_policies Controller.


=== Team Information: ===
== Team Information: ==


Devarsh Shah
Devarsh Shah
Line 116: Line 116:
Ritesh Ghorse
Ritesh Ghorse


=== References ===
== References ==


1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]
1.[https://github.com/expertiza/expertiza/ Expertiza on GitHub]

Revision as of 20:52, 1 November 2019

About Expertiza

Expertiza is an open-source project based on Ruby on Rails framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages

Peer Review Information

For users intending to view the deployed Expertiza associated with this assignment, the credentials are below: Instructor Login: username -> instructor6, password -> password

Navigation to test via UI:

1. Login to expertiza using the above credentials.

2. Click on Assignments under Manage Notifications.

3. Click on Edit icon under any of the Assignments.

4. Navigate to Due Dates Tab.

5. Scroll Down and click on "New Late Policy".

6. Create/test new Late Policy !

Problem Statement

E1960. Create new late policy successfully and fixing "Back" link

Mentor: Yashad Trivedi (ytrived@ncsu.edu)

Background: An instructor can create late policies for any assignment, wherein the instructor can specify the points per unit and the maximum penalty that can be applied for any assignment submission.

Issue 1: If an instructor while creating a policy, clicks on “Create” (Step 5), following error message is displayed on the top of the page “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.

Issue 2: If an instructor, while creating a policy, clicks on "Back" link (Step 6) and wants to go back to the previous page, (s)he is directed to the list of policies instead of “Due Date” tab of assignment edit page (Step 2 above).

Current Implementation

Functionality: An Instructor has the option to create new late policies to be applied to the assignments. An Instructor can choose to go back to the previous page from the create new policy page.


Problems in Current Implementation

Problem 1: Failure to create a new policy The create button on the new page of late_policy is not working. Whenever the data for the form is filled and submitted by clicking on the Create button, an error message is shown saying “The following error occurred while saving the penalty policy:” and the policy is not created and added to the list of policies.


Problem 2: Back link redirects to the wrong page An instructor can choose to go back to the previous page from the create new policy page. When the Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the index page of late policies.


Solutions to Problems in Current Implementation

Problem 1: Failure to create a new policy

   Solution:
   There was no provision to handle the validations of the form in the new late_policy page.


Problem 2: Back link redirects to the wrong page An instructor can choose to go back to the previous page from the create new policy page. When Back button on the create new late policy is clicked, it should be redirected to the Due Date tab of the assignment it came from but it is redirected to the list of late policies page

   Solution: 
   We tried to store the assignment id of the page from where the create new policy was clicked. This way when we have to redirect after the back button, 
   we can send it to this particular assignment with the help of assignment id.


app/views/late_policies/new.html.erb

   <%= f.hidden_field :assign_id, value: params[:id] %>
   <%= link_to 'Back', :controller => 'assignments', :action => 'edit', :id => params[:id], :anchor => "tabs-5" %>


app/controllers/late_policies_controller.rb

   redirect_to action: 'index', id: params[:late_policy][:assign_id]

app/views/late_policies/index.html.erb

   <%= link_to 'New late policy', :action => 'new', :id => params[:id]%>


Back Case - 1

   Step 1: Click Back on Create New Policy page

   Step 2: Redirected to the Due Dates tab of the assignment page it came from


Back Case - 2

   Step 1: On Index Page of Late Policies. Click Create New Policy

   Step 2: Click Back

   Step 3: Redirected to the due dates tab of assignment page it came from

Test Plan abs

Tasks Accomplished: Following tasks were accomplished in this project: 1. Corrected the code for the late_policies controller and new late_policy page. 2. Improved the code for the Back button inside the new late_policy page. 3. Added RSPEC test cases for testing changes done in late_policies Controller.

Team Information:

Devarsh Shah

Jay Jagtap

Ritesh Ghorse

References

1.Expertiza on GitHub

2.GitHub Project Repository Fork

3.Live Expertiza website

4.Demo Link

5.Expertiza project documentation wiki

6.Rspec Documentation

7.Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin