-
Notifications
You must be signed in to change notification settings - Fork 83
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
Slip Calculator Jobs for Assignment and Course #1148
base: master
Are you sure you want to change the base?
Conversation
Haven't looked at the code but going off the screenshot. I think the slip days an action from the course dashboard - not from the assignments I'm not so sure about the wording of "Calcuate Slips" - Late Submission Report or Even just saying grace period" |
Sumukh, Thanks for the quick response and feedback! Where on the course dashboard were you thinking? I experimented with putting the slip action in the course dashboard I agree the name |
I agree that "slip days" is misleading. I would expect OK to deal with grade changes in that case. I'm curious how instructors will use this. Will they manually go through all entries in the CSV and give credit to late assignments? |
Data 100 for example just wants calculate slip day usage (Everyone is given X slip days) - CSV is a good workflow since they aren't managing all their grades in OK anyway. |
Other notes:
|
|
||
class AssignSlipCalculatorForm(BaseForm): | ||
timescale = SelectField('Time Scale', default="days", | ||
choices=[(c.lower(), c.title()) for c in TIMESCALES], |
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.
c.lower()
seems redundant here, as the TIMESCALES enum is already lowercase
return abort(404) | ||
|
||
form = forms.AssignSlipCalculatorForm() | ||
timescale = form.timescale.data.title() |
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.
I suggest keeping the timescale lowercase, so it matches up with the TIMESCALES enum. And you won't need the .lower()
on L16 in slips.py
from server.utils import encode_id, local_time, output_csv_iterable | ||
from server.constants import TIMESCALES | ||
|
||
timescales = {'days':86400, 'hours':3600, 'minutes':60} |
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 should go in constants
as TIMESCALES
, so there's not both TIMESCALES
and timescales
that have the same keys
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.
I did this originally, but realized if I would then have to use the dictionary keys to fill in the form options, which wouldn't have a guaranteed ordering.
Now that I've thought about it, I think I'll just use an OrderedDict to preserve the ordering of the keys for display on the form.
timescale = SelectField('Time Scale', default="days", | ||
choices=[(c.lower(), c.title()) for c in TIMESCALES], | ||
description="Time scale for slip calculation.") | ||
show_results = BooleanField('Show Results', default=False) |
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.
Not sure if this is useful as an option. We should either always show the results, or don't
@@ -236,6 +236,16 @@ def chunks(l, n): | |||
prev_index = index | |||
|
|||
|
|||
def output_csv_iterable(header, rows): |
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 is too similar to generate_csv
below to be another function. It has other problems: it uses Windows line endings, and will buffer the whole thing in memory (which isn't really an issue for these jobs, but it defeats the while purpose of using iterables).
Instead, try to use generate_csv
. It would looks something like
csv = generate_csv(subms, header, get_row)
where subms
is the thing you're iterating over, and get_row
is a function that returns a dict of CSV values.
I agree - I was thinking of renaming things "Report Late Submissions" or something similar. If I were to do this, I was thinking of filtering out all non-late submissions and only show late ones. |
@epai Are you still planning on working on this one? |
At the risk of putting this publicly on GitHub: Most courses only penalize for serious over offenders unless they automate things -- but the automation is slightly tricky as it should apply penalties to the lowest scoring assignment first. (Well, I suppose with backups the maximal value isn't necessarily the simple algorithm, but I digress.) |
Slip Calculator Jobs (Resolves #1068)
This helps courses to:
Calculate Course Slips
Calculate Assign Slips