-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement Ticket Cooldowns and Daily Ticket Limits #649
base: main
Are you sure you want to change the base?
Conversation
) | ||
|
||
# Check if tickets exceed maximum in 24hrs. | ||
days_cutoff = datetime.now() + timedelta(days=-1) |
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.
question: Is there a way to do this on a standard day rather than past 24 hours? Maybe basing the cutoff on the first OH event of the current day?
|
||
if num_tickets_in_last_day >= course_entity.max_tickets_per_day: | ||
raise CoursePermissionException( | ||
f"You have created the maximum number of tickets you can for this course in 24 hours. Please come back later." |
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.
nit: More information in this exception could be useful.
error: (_) => { | ||
this.snackBar.open(`Could not create a ticket at this time.`, '', { | ||
error: (err) => { | ||
this.snackBar.open(`${err.error.message}`, '', { |
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.
issue: It might be better if ticket creation is completely disabled for the user before they even attempt to create it and send a request to the backend. Both to reduce the number of unnecessary requests and to avoid situations where a user unknowingly creates a ticket before the cooldown/limit is over, writes a whole description, and then loses it. This will obviously require more work and refactoring though, so could be relegated to a future ticket.
This pull request adds the ability for instructors to set a ticket cooldown (minimum time between tickets for the same person) and daily ticket limits (for each user) to better manage office hours and to encourage self exploration and problem solving, as well as to lessen the burden on TAs and decrease the chance that TAs complete assignments for students.
Backend Changes
course_site
table that for ticket cooldowns and daily ticket limits.0
minutes.100
.Migrations are likely required here.
Frontend Changes
Other Notes
I would like to pair this with #631 if possible. Can we get this reviewed @KrisJordan / @jadekeegan?
Limitations