Skip to content
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

Adding TA Timers #322

Merged
merged 11 commits into from
Oct 27, 2024
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.3 on 2024-10-11 21:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("ohq", "0020_auto_20240326_0226"),
]

operations = [
migrations.AddField(
model_name="queue",
name="question_timer_enabled",
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name="queue",
name="question_timer_start_time",
field=models.IntegerField(blank=True, null=True),
),
]
4 changes: 4 additions & 0 deletions backend/ohq/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Course(models.Model):
invite_only = models.BooleanField(default=False)
members = models.ManyToManyField(User, through="Membership", through_fields=("course", "user"))


# MAX_NUMBER_COURSE_USERS = 1000

class Meta:
Expand Down Expand Up @@ -215,6 +216,9 @@ class Queue(models.Model):
rate_limit_questions = models.IntegerField(blank=True, null=True)
rate_limit_minutes = models.IntegerField(blank=True, null=True)

question_timer_enabled = models.BooleanField(default=False)
question_timer_start_time = models.IntegerField(blank=True, null=True)

video_chat_setting = models.CharField(
max_length=8, choices=VIDEO_CHOICES, default=VIDEO_OPTIONAL
)
Expand Down
2 changes: 2 additions & 0 deletions backend/ohq/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ class Meta:
"rate_limit_length",
"rate_limit_questions",
"rate_limit_minutes",
"question_timer_enabled",
"question_timer_start_time",
"video_chat_setting",
"pin",
"pin_enabled",
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/Course/CourseWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ const CourseWrapper = ({ render, ...props }: CourseProps) => {
useEffect(() => setSupportsNotifs(browserSupportsNotifications()), []);

const toggleNotifs = () => {
setNotifs(!notifs);
localStorage.setItem("notifs", !notifs ? "true" : "false");
const newNotifs = !notifs;
setNotifs(newNotifs);
localStorage.setItem("notifs", newNotifs ? "true" : "false");
document.body.focus();
};

Expand Down

This file was deleted.

Loading
Loading