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

feat: passing score automatically added to assignments db

parent 96826a45
......@@ -23,4 +23,8 @@ class Assignment(models.Model):
def file(self):
value = os.path.basename(self.image.name)
return value
\ No newline at end of file
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):
raise Http404("Assignment does not exist.")
score = assignment.max_points
assignment.passing_score = (score*60) // 100
context = {
"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