Skip to content

added column to display late-days if they exist in Gradesheet#18

Open
grobalex wants to merge 2 commits intoblerner:masterfrom
grobalex:fix-145
Open

added column to display late-days if they exist in Gradesheet#18
grobalex wants to merge 2 commits intoblerner:masterfrom
grobalex:fix-145

Conversation

@grobalex
Copy link
Copy Markdown

@grobalex grobalex commented Feb 27, 2019

Took at stab at displaying late days in the grading sheet.
Do we want to see which assignments the late days were used on?

Comment thread app/helpers/course_spreadsheet.rb Outdated
end
end

def late_days_remaining(u)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I'm looking at the code for lateness, I worry a bit that we're hardcoding "days" as the unit of measurement. Especially since the lateness_per_hour penalty cares about hours of lateness...

I wonder whether we ought to change LatenessConfig to have a method seconds_late, and then build minutes_late, hours_late, and days_late etc on top of that:

  def time_late(assignment, submission, raw = false)
    return 0 unless raw or late?(assignment, submission)
    due_on = assignment.effective_due_date(submission.user, submission.team)
    sub_on = submission.created_at || DateTime.current
    (sub_on.to_f - due_on.to_f).seconds
  end
  def units_late(assignment, submission, raw = false, unit = :hours)
    unit = :hours unless ActiveSupport::Duration::PARTS.member?(unit)
    (time_late(assignment, submission, raw) / 1.send(unit).to_f).ceil
  end
  def seconds_late(assignment, submission, raw = false)
    units_late(assignment, submission, raw, :seconds)
  end
  def minutes_late(assignment, submission, raw = false)
    units_late(assignment, submission, raw, :minutes)
  end
  def hours_late(assignment, submission, raw = false)
    units_late(assignment, submission, raw, :hours)
  end
  def days_late(assignment, submission, raw = false)
    units_late(assignment, submission, raw, :days)
  end
  def weeks_late(assignment, submission, raw = false)
    units_late(assignment, submission, raw, :weeks)
  end

  def friendly_lateness(assignment, submission, raw = false, unit = :hours)
    lateness = units_late(assignment, submission, raw, unit)
    return "On time" if lateness.to_f == 0
    
    unit = unit.to_s.singularize
    "#{lateness} #{unit.pluralize(lateness)}"
  end

Then lateness policies can use whichever one is most appropriate, and our lateness reporting can use friendly_lateness to summarize the magnitude of the problem

Copy link
Copy Markdown
Author

@grobalex grobalex Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it should be a separate feature / issue

end
row.push(lecture&.dig(:dropped_date) || "", "", "")
sheet.push_row(nil, row)
end
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should add a column for each assignment, splitting the "Lateness" column into "Lateness" and "Lateness penalty"

Copy link
Copy Markdown
Author

@grobalex grobalex Feb 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering that too; It would be great for assignment analytics but is that information that would be used (?) but I see no reason not to have it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants