-
Notifications
You must be signed in to change notification settings - Fork 3
added column to display late-days if they exist in Gradesheet #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,14 @@ def sanity_check | |
| end | ||
| end | ||
|
|
||
| def late_days_remaining(u) | ||
| assns = @course.assignments.where("available <= ?", DateTime.current) | ||
| total_latedays = u.used_submissions_for(assns).to_a.reduce(0) do |acc, s| | ||
| acc + s.submission.days_late | ||
| end | ||
| return @course.total_late_days - total_latedays | ||
| end | ||
|
|
||
| def create_exams(sheet) | ||
| labels, weight = create_name_columns(sheet) | ||
|
|
||
|
|
@@ -253,6 +261,9 @@ def create_name_columns(sheet) | |
| course_section_types.each do |type| | ||
| sheet.columns.push(Col.new("#{type.humanize} section", "Number")) | ||
| end | ||
| if @course.total_late_days | ||
| sheet.columns.push(Col.new("Late Days Remaining", "String")) | ||
|
grobalex marked this conversation as resolved.
Outdated
|
||
| end | ||
| sheet.columns.push(Col.new("Withdrawn?", "DateTime"), Col.new(""), Col.new("")) | ||
| labels = sheet.push_header_row(nil, ["", "", "", "", "", "", "", "", ""].push(*course_section_types.count.times.map{|| ""})) | ||
| weight = sheet.push_header_row(nil, ["", "", "", "", "", "", "", "", ""].push(*course_section_types.count.times.map{|| ""})) | ||
|
|
@@ -270,6 +281,9 @@ def create_name_columns(sheet) | |
| section = reg[Section::types[type]]&.fetch(:section) | ||
| row.push(section&.crn || "<no CRN>") | ||
| end | ||
| if @course.total_late_days | ||
| row.push(late_days_remaining(u) || "") | ||
| end | ||
| row.push(lecture&.dig(:dropped_date) || "", "", "") | ||
| sheet.push_row(nil, row) | ||
| end | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
There was a problem hiding this comment.
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 buildminutes_late,hours_late, anddays_lateetc on top of that:Then lateness policies can use whichever one is most appropriate, and our lateness reporting can use
friendly_latenessto summarize the magnitude of the problemUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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