Skip to content

Commit

Permalink
Delete weight in assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
hanqidS2023 committed Apr 13, 2024
1 parent 234f424 commit 3b5b784
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
17 changes: 17 additions & 0 deletions app/gamification/migrations/0012_remove_assignment_weight.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 3.2 on 2024-04-13 00:28

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('gamification', '0011_alter_artifactreview_status'),
]

operations = [
migrations.RemoveField(
model_name='assignment',
name='weight',
),
]
2 changes: 0 additions & 2 deletions app/gamification/models/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class ReviewerAssignPolicy(models.TextChoices):

total_score = models.FloatField(null=True, blank=True)

weight = models.FloatField(null=True, blank=True)

date_released = models.DateTimeField(_("date released"), null=True, blank=True)

date_due = models.DateTimeField(_("date due"), null=True, blank=True)
Expand Down
1 change: 0 additions & 1 deletion app/gamification/serializers/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Meta:
"assignment_type",
"submission_type",
"total_score",
"weight",
"date_released",
"date_due",
"review_assign_policy",
Expand Down
6 changes: 0 additions & 6 deletions app/gamification/views/api/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ class AssignmentList(generics.ListCreateAPIView):
"assignment_type": openapi.Schema(type=openapi.TYPE_STRING, enum=["Individual", "Team"]),
"submission_type": openapi.Schema(type=openapi.TYPE_STRING, enum=["File", "URL", "Text"]),
"total_score": openapi.Schema(type=openapi.TYPE_NUMBER),
"weight": openapi.Schema(type=openapi.TYPE_NUMBER),
"date_released": openapi.Schema(type=openapi.TYPE_STRING),
"date_due": openapi.Schema(type=openapi.TYPE_STRING),
"user_role": openapi.Schema(type=openapi.TYPE_STRING, enum=["Student", "TA", "Instructor"]),
Expand Down Expand Up @@ -296,7 +295,6 @@ def post(self, request, course_id, *args, **kwargs):
description = request.data.get("description")
submission_type = request.data.get("submission_type")
total_score = request.data.get("total_score")
weight = request.data.get("weight")
min_reviewers = request.data.get("min_reviewers")
review_assign_policy = request.data.get("review_assign_policy")
if user.is_staff:
Expand All @@ -309,7 +307,6 @@ def post(self, request, course_id, *args, **kwargs):
description=description,
submission_type=submission_type,
total_score=total_score,
weight=weight,
review_assign_policy=review_assign_policy,
min_reviewers=min_reviewers,
)
Expand Down Expand Up @@ -340,7 +337,6 @@ class AssignmentDetail(generics.RetrieveUpdateDestroyAPIView):
"assignment_type": openapi.Schema(type=openapi.TYPE_STRING, enum=["Individual", "Team"]),
"submission_type": openapi.Schema(type=openapi.TYPE_STRING, enum=["File", "URL", "Text"]),
"total_score": openapi.Schema(type=openapi.TYPE_NUMBER),
"weight": openapi.Schema(type=openapi.TYPE_NUMBER),
"date_released": openapi.Schema(type=openapi.TYPE_STRING),
"date_due": openapi.Schema(type=openapi.TYPE_STRING),
"user_role": openapi.Schema(type=openapi.TYPE_STRING, enum=["Student", "TA", "Instructor"]),
Expand Down Expand Up @@ -371,7 +367,6 @@ def patch(self, request, course_id, assignment_id, *args, **kwargs):
description = request.data.get("description")
submission_type = request.data.get("submission_type")
total_score = request.data.get("total_score")
weight = request.data.get("weight")
review_assign_policy = request.data.get("review_assign_policy")
if user.is_staff:
try:
Expand All @@ -386,7 +381,6 @@ def patch(self, request, course_id, assignment_id, *args, **kwargs):
assignment.description = description
assignment.submission_type = submission_type
assignment.total_score = total_score
assignment.weight = weight
assignment.review_assign_policy = review_assign_policy
assignment.save()
data = model_to_dict(assignment)
Expand Down

0 comments on commit 3b5b784

Please sign in to comment.