CSC/ECE 517 Fall 2017/E1748 Add past-due assignments to task list

From Expertiza_Wiki
Jump to navigation Jump to search

E1748. Adding past due assignments to the task list

This page provides a description of the Expertiza based OSS project for Fall 2017.


About Expertiza

Expertiza is an open source project. It is based on Ruby on Rails framework. The expertiza project is supported by National Science Foundation. Expertiza is a web application which allows instructors to create new assignments, list of topics which students can sign up for. It allows students to submit and peer-review learning object like articles, code, web sites etc. Students can also form teams for various assignments and projects. It is used in select courses by professors at NC State and various other universities.

Problem Statement

The following tasks were required to be completed in this project:

  • Issue #80: Add past-due assignments to task list.
  • Highlight with specific colors current and next due dates.

Current Implementation

Functionality

  • Past Due assignments are not present in the task list.

If a student is a participant of an assignment and has not submitted the assignment before the assignment due date/deadline, then the assignment is considered as a past due/overdue assignment for that student. These past due assignments are not present in the task list and we have added this functionality to the existing system.

  • Highlighting next due dates.

Different To do tasks in the task list with different due dates are highlighted with different shades of red color. An assignment that has to be submitted earlier has a redder color than assignments that have later due dates.

New Implementation

  • The function overdue_tasks? is added in the model student_task.rb file to fetch those tasks with current stage set as finished and which were not started by the student.
   def overdue_task?
       current_stage == 'Finished' && !started?
   end
  • In the list.html.erb file we used the tasks not started section as a template to construct the past due assignments section.


   <strong>  <span class="tasknum"> <%= @pastdueassignments.size.to_s %> </span> Past Due Assignments <br></strong><br>
   <% @pastdueassignments.each do |student_task|
     	participant = student_task.participant
     	stage = student_task.current_stage
     	topic_id = SignedUpTeam.topic_id(participant.parent_id, participant.user_id)
     	duedate = participant.assignment.stage_deadline(topic_id)
     	%>
       <span>  » <%= student_task.assignment.name + " " + student_task.current_stage %> (<%= student_task.relative_deadline %> Past Deadline )
       </span><br/>
 <% end %>

  • The past due assignments variable from the controller contains the list of past due assignments as its contents which are looped through with a do each loop. The participant, stage and topic_id are used to obtain the due date of the assignment. Then the assignment name and its deadline are displayed.
    @pastdueassignments = @student_tasks.select(&:overdue_tasks?)
  • To highlight with specific colors current and next due dates we made several changes to the currently existing list.html.erb file.
   <% r=255 %>
   <% if @tasknotstarted.size > 0 %>
     <% step = (255/ @tasknotstarted.size).floor %>
   <%end %>
     <%= link_to student_task.assignment.name + " " + student_task.current_stage, {:controller => controller, :action => action, :id => participant.id},
        {:style=> "color: rgb(" + r.to_s + ",0,0);" } %>
        (<%= student_task.relative_deadline %> left)
       <% r= r-step %>

The rgb() style color attribute is used to set the color of a html tag. A variable r is used to set the red color parameter in rgb function. Initially it is set to 255 which is the Darkest shade of red that is possible. Then a variable step is used to determine by what value the r variable must decrease to lessen the intensity of the red color. The size of the task list is used to initialize the step value. An if condition is used to make sure that step is initialized only when there are tasks to be completed.


Results

The task list before and after the changes are shown below.

Before Changes


After Changes


The student in the example above is a participant in 6 current assignments that are displayed in the task not yet started section of the task list. Each of those is highlighted with colours as described.

The student has failed to submit 6 other assignments before their respective due dates and they appear in the past-due assignments section of the task list.

Testing from UI

TODO: Get proper steps with username and password. (Example Logins (username/password) : student5000/password and instructor6/password). The testing has to be done manually.

Following are a few test cases with respect to our code changes that can be tried from UI:

1. Login as student and check if past due assignments section is present on the task list.

2. If no such section is present, the student does not have any past due assignments.

3. Log in as an instructor and create a new assignment.

4. Set the deadline for the assignment to a date and time few minutes from the current date and time.

5. Assign the student being tested as a participant to the created assignment.

6. Login as the student and check the task list after the due date for the assignment has passed.

7. The new assignment will be in the Past Due assignment section.

To check if the Tasks not yet started section has assignments highlighted with colours:

1. Login as a student and check if there are any assignments in tasks not started section.

2. If no assignments are present, the student is not involved with any current assignments.

3. Log in as an instructor and add the student as a participant to few assignments.

4. Log in as the student and now see that the assignments in tasks not yet started section are highlighted with colours as described in the wiki.

Edge Cases

The edge case for when there are no past due assignments for a student has been handled. In this case, no past due assignments are displayed.

The edge case for when there is only one assignment in the tasks not yet started section has been handled. In this case, the assignment is highlighted with a dark red colour.

References

  1. The live Expertiza website
  2. The Ruby on Rails website