CSC/ECE 517 Fall 2018 - E1825: Add past-due assignments to task list

From Expertiza_Wiki
Jump to navigation Jump to search

About Expertiza

Expertiza is a web application where students can submit and peer-review learning objects (articles, code, websites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. -- Expertiza project

Overview:-

The E1825 project is a course project for CSC 517 - Object Oriented Development and Design for Fall 2018. It involves adding some enhancements to the existing system. The primary goal of this project is to differentiate past due assignments from current assignments. The tasks to be completed are as follows:-

  • Add past due assignments to the student’s task list (on Student View).
  • Color code assignments by closeness to due date (on Student View).
  • Check for correction in due dates of assignments (when an assignment’s due date is edited, it should be appropriately moved from the “Past assignments” list to the “Current Assignments” list if needed)
  • On Student Task page, separate the list of 'teamed with' students from the current tasks box.
  • Write the required tests before implementing/refactoring the methods in the above-mentioned classes.

Files Changed

student_task_controller.erb
app/views/student_task/list.html.erb
student_task_helper.rb
Airbrake_exception_errors_feature_tests_spec.rb

New Files Added

will_paginate_array_fix.rb
student_task_controller_spec.rb

Add past-due assignments to the student’s task list

The existing system contains the view where all the assignments of a student are displayed as a single list regardless of their due date. Now we have created a separate table for assignments that are overdue by the student. The displayed list is such that the most recent due assignment is shown at the top.
To accomplish this task we have modified student_task_controller.rb and list.html.erb file (in student_task). A helper function was also added to format a string into multiple lines. In student_task_controller a new instance variable was created to capture all the student tasks that are overdue in ascending order of dueness. The existing instance variable was used to capture all the tasks that are currently due.
In the view file i.e list.html.erb, a new table is created to contain a list of past assignments.

Color code assignments by closeness to due-date

The current task-table on the homepage contains all the assignments displayed in white background. So to alert the user of approaching deadlines, we color code the background of each assignment title as red, orange, yellow or green depending on the proximity to its deadline.
To accomplish the above-mentioned task, we added a helper method for student_task_controller that receives a due_date and calculates the days remaining for that date and then using this value it returns a string which denotes what should be the background of the row.

Separate the list of 'teamed with' students from the current tasks box

Currently, the current task lists and the student you have teamed up with are being shown in the same box. We need to separate these two. To achieve this we create an additional box, by adding a new "taskbox" div tag in list.html.erb. So the task list and the teammates are shown in different boxes.

You can find the snapshot of the changes here:

Separating past assignments with the present

list.html.erb

Test Plan

Our project involves mostly changing the view based on certain conditions. The testing of our project is based on simply checking whether the elements on the view change after a certain condition is satisfied, like changing of the background color for tasks as we approach the deadline. For example, if the due date is within a day, then the background color should be red or if it's more than 10 days it should be green.