Skip to content

Commit 524282d

Browse files
authored
Merge pull request #322 from pennlabs/feature/ta-timer-v2
Adding TA Timers
2 parents 3757d6b + e42a684 commit 524282d

17 files changed

+851
-837
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 5.0.3 on 2024-10-11 21:08
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("ohq", "0020_auto_20240326_0226"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="queue",
15+
name="question_timer_enabled",
16+
field=models.BooleanField(default=False),
17+
),
18+
migrations.AddField(
19+
model_name="queue",
20+
name="question_timer_start_time",
21+
field=models.IntegerField(blank=True, null=True),
22+
),
23+
]

backend/ohq/models.py

+4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class Course(models.Model):
7575
invite_only = models.BooleanField(default=False)
7676
members = models.ManyToManyField(User, through="Membership", through_fields=("course", "user"))
7777

78+
7879
# MAX_NUMBER_COURSE_USERS = 1000
7980

8081
class Meta:
@@ -215,6 +216,9 @@ class Queue(models.Model):
215216
rate_limit_questions = models.IntegerField(blank=True, null=True)
216217
rate_limit_minutes = models.IntegerField(blank=True, null=True)
217218

219+
question_timer_enabled = models.BooleanField(default=False)
220+
question_timer_start_time = models.IntegerField(blank=True, null=True)
221+
218222
video_chat_setting = models.CharField(
219223
max_length=8, choices=VIDEO_CHOICES, default=VIDEO_OPTIONAL
220224
)

backend/ohq/serializers.py

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ class Meta:
157157
"rate_limit_length",
158158
"rate_limit_questions",
159159
"rate_limit_minutes",
160+
"question_timer_enabled",
161+
"question_timer_start_time",
160162
"video_chat_setting",
161163
"pin",
162164
"pin_enabled",

frontend/components/Course/CourseWrapper.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ const CourseWrapper = ({ render, ...props }: CourseProps) => {
4646
useEffect(() => setSupportsNotifs(browserSupportsNotifications()), []);
4747

4848
const toggleNotifs = () => {
49-
setNotifs(!notifs);
50-
localStorage.setItem("notifs", !notifs ? "true" : "false");
49+
const newNotifs = !notifs;
50+
setNotifs(newNotifs);
51+
localStorage.setItem("notifs", newNotifs ? "true" : "false");
5152
document.body.focus();
5253
};
5354

frontend/components/Course/InstructorQueuePage/CreateQueue/CreateQueue.tsx

-334
This file was deleted.

0 commit comments

Comments
 (0)