added column to display late-days if they exist in Gradesheet#18
added column to display late-days if they exist in Gradesheet#18grobalex wants to merge 2 commits intoblerner:masterfrom
Conversation
| end | ||
| end | ||
|
|
||
| def late_days_remaining(u) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
This feels like it should be a separate feature / issue
| end | ||
| row.push(lecture&.dig(:dropped_date) || "", "", "") | ||
| sheet.push_row(nil, row) | ||
| end |
There was a problem hiding this comment.
I wonder if we should add a column for each assignment, splitting the "Lateness" column into "Lateness" and "Lateness penalty"
There was a problem hiding this comment.
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
Took at stab at displaying late days in the grading sheet.
Do we want to see which assignments the late days were used on?