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

From Expertiza_Wiki
Revision as of 00:58, 28 October 2017 by Uagrawa (talk | contribs)
Jump to navigation Jump to search

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.

The assignments which student is a part of but they have not been submitted and are past the deadline are not present in the task list of the user. Currently only those tasks which are not yet started are added in the task list.

  • Next due date.

Currently it is difficult to distinguish between the assignments which have the next immediate due date.

Drawbacks and solutions

  • Problem1: If a student has an assignment which he has not submitted and the deadline has passed it does not show in his task list.


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.
      <%= @pastdueassignments.size.to_s %> Past Due Assignments

<% @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)  %>   » <%= student_task.assignment.name + " " + student_task.current_stage %> (<%= student_task.relative_deadline %> Past Deadline )
<% 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.
     student_task controller.rb
         @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.


Testing from UI

TODO: Get proper steps with user name and password Following are a few testcases with respect to our code changes that can be tried from UI: 1. Log in as instructor 1 and create a new rubric.

2. Log in as another instructor. Go to [ Edit] page for the rubric and try to edit the questions.

3. Re log in as a student. Go to [ Edit] page for the rubric and try to edit the questions.

3. Re log in as instructor 1. Go to [ Edit] page for the rubric and try to edit the questions.

4. Re log in as a super administrator / admininstrator. Go to [ Edit] page for the rubric and try to edit the questions.

5. TODO: Add steps for import/export reuse