CSC/ECE 517 Spring 2022 - E2236: Fix issues related to deadlines and late policies

From Expertiza_Wiki
Jump to navigation Jump to search

Problem Description

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.

Issues with the Current Implementation

The following issues have been raised in the current implementation:

  • Issue 1 - When creating a late policy, the “back” link does not take the user back to editing the assignment.


  • Issue 2 - After creating a late policy, the “back” link does not take the user back to editing the assignment.



  • Issue 3 - After checking the "Apply penalty policy" box and clicking the 'save' or 'create' button on the Due dates tab, the box is unchecked on page refresh.




  • Issue 4 - There is also no indication of this penalty policy for students, and no proof it actually works




  • Issue 5 - No Botton navigating to the list of all late policies



  • Issue 6 - When creating/editing an assignment, you can’t see the detail of each late policy

Refactoring and Design Patterns

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:

  • We are only changing what we set out to change when fixing a particular issue.
  • We are not breaking what was working before we deployed our fix.

We believe at the end our changes will increase the quality of Expertiza and improve the experience for users an developers alike.

Project Scope

Files to be refactored

  • Issue 1

Check how to store assignment information into session and fix it.
1. app/views/late_policies/new.html.erb
2. app/views/assignments/edit/_due_dates.html.erb
3. app/controllers/assignments_controller.rb

  • Issue 2

Store assignment information in session through the creation of late policies.
1. app/views/late_policies/new.html.erb
2. app/views/assignments/edit/_due_dates.html.erb
3. app/controllers/assignments_controller.rb

  • Issue 3

Save late policy information of this assignment into database.
1. app/views/assignments/edit/_due_dates.html.erb
2. app/controllers/assignments_controller.rb

  • Issue 4

Show late policy of current assignment on student view page.
1. app/views/student_task/view.html.erb
2. app/controllers/student_task_controller.rb

  • Issue 5

Create buttons link to all late policies on both main page and assigment view page.
1. app/views/assignments/edit/_late_policy.html.erb
2. app/controllers/assignments_controller.rb

  • Issue 6

A button link to all late policies on assignment/new page to show all policies.
1. app/views/assignments/edit/_late_policy.html.erb
2. app/controllers/assignments_controller.rb

Testing

Testing Goals and Test Objects

  1. When logging in as a student:
    1. You can see the late policy details of your assignments
    2. The late policy works correctly if you submit your assignment late
  2. When logging in as an instructor:
    1. There is a button to navigate you to the page showing all the late policies
    2. You can see the details of the late policy when creating or editing an assignment
    3. The "back" button will lead to a correct webpage when creating or editing an assignment
    4. The "Apply penalty policy" box is saved after submitting the form when creating or editing an assignment

RSpec Unit Tests

Test cases provided here, will add RSpec code blocks for the final submission

  • Issue1
Scenario: The instructor wants to go back as he is creating a new late policy
Given: Logged in as an instructor
When: Clicks “Manage…” -> “Assignments” -> “Create new assignment” -> “Due dates” -> “Createlate policy”
And: Clicks “Back”
Then: Redirect to the previous create assignment page.
  • Issue2
Scenario: The instructor have created a new late policy and tries to go back to previous page
Given: Logged in as an instructor
When: An instructor successfully creates a new late policy, being redirected to the “/late_policies” webpage with all information of late policies.
And: The instructor clicks “Back” button
Then: The instructor is redirected to the previous create/edit assignment page.
  • Issue3: After checking the "Apply penalty policy" box and clicking the 'save' or 'create' button on the Due dates tab, the box is unchecked on page refresh.
Scenario: The instructor create a new assignment with a late policy applied
Given: Logged in as an instructor
When: The instructor clicks “Manage…” -> “Assignments” -> “Create new assignment”, enter informations for the new assignment
And: Click “Save” and refresh/redirect to the assignment edit page
Then: The checkbox for the late policy should be in the state of checked.
Scenario: The instructor apply a late policy to an assignment with no late policy applied yet
Given: Logged in as an instructor
When: The instructor clicks “Manage…” -> “Assignments” and goes to an assignment’s edit page
And: The assignment should not has late policy applied before
Then: As the instructor applies late policy to the assignment and refresh/redirect to the assignment edit page, the checkbox for the late policy should be in the state of checked.
  • Issue4: Show indication and proof about late policies at student’s side
Scenario: A student wants to know late policies related to his assignments
Given: Logged in as a student
When: The student clicks “Assignments” from navbar
And: Select an assignment and redirect to the assignment’s detail page (“student_task/view”)
Then: There should be a section parallel with sections like “Signup sheet” and “Your score”, with the name of “Late policy”. As the student clicks on it, the website redirects to the assignment’s late policy detail page.
  • Issue5: Add “Late policies” inside the “Mange…” section from instructors’ navbar
Scenario: An instructor tries to view the list of all the late policies without creating a new assignment
Given: Logged in as an Instructor
When: The instructor hovers his mouse on the “Manage…” section for navbar
And: From the list below, there should be a section called “Late policies”
Then: As the instructor clicks the “Late policies” section, he gets redirected to the /late_policies with all late policies’ details.
  • Issue6: Add “show all late policies” button inside the “new assignment” -> “Due dates” page
Scenario: An instructor tries to create a new assignment and apply a late policy to it
Given: Logged in as an Instructor
When: The instructor clicks “Manage…” -> “Assignments” -> “Create new assignment” -> “Due dates” 
And: Besides the “New late policy” button, there should be a “Show all late policies” button.
Then: As the instructor clicks the “Show all late policies” button, he gets redirected to the /late_policies with all late policies’ details.

Manual Testing

Student's View in Assignment

Admin's View When Creating new Assignment

Project Mentors

  • Nicholas Himes

Team Members

  • Zhiyuan Ma
  • Gaolin Zhang
  • Zhijin Yang
  • Yuyang Jiang

Useful Links

E2236

  1. GitHub Repository

Expertiza

  1. Expertiza on GitHub
  2. Live Expertiza website

Demo Vedio

  1. Demo Vedio Link