Commit 15ce7920 authored by Vaughn Fajardo's avatar Vaughn Fajardo

feat: passing score automatically added to assignments db

parent 96826a45
...@@ -24,3 +24,7 @@ class Assignment(models.Model): ...@@ -24,3 +24,7 @@ class Assignment(models.Model):
def file(self): def file(self):
value = os.path.basename(self.image.name) value = os.path.basename(self.image.name)
return value return value
def save(self, *args, **kwargs):
self.passing_score = self.max_points*0.6
super(Assignment, self).save(*args, **kwargs)
...@@ -22,7 +22,6 @@ def details(request, assignment_id): ...@@ -22,7 +22,6 @@ def details(request, assignment_id):
raise Http404("Assignment does not exist.") raise Http404("Assignment does not exist.")
score = assignment.max_points score = assignment.max_points
assignment.passing_score = (score*60) // 100
context = { context = {
"assignment" : assignment, "assignment" : assignment,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment