added my part for the Midterm

- added Course model on models.py
- added Course model fields
- added passing_score field
- added Assignment text on views.py
parent beb52321
...@@ -47,9 +47,15 @@ class Assignment(models.Model): ...@@ -47,9 +47,15 @@ class Assignment(models.Model):
name = models.CharField(max_length = 100) name = models.CharField(max_length = 100)
description = models.CharField(max_length = 200) description = models.CharField(max_length = 200)
max_points = models.IntegerField() max_points = models.IntegerField()
passing_score = max_points * .6
def __str__(self): def __str__(self):
return self.name return self.name
def get_absolute_url(self): def get_absolute_url(self):
return reverse('assignment', args=[(self.name)]) return reverse('assignment', args=[(self.name)])
class Course(models.Model):
course_code = models.CharField(max_length = 10)
course_title = models.CharField(max_length = 100)
section = models.CharField(max_length = 3)
...@@ -8,6 +8,13 @@ def assignments(request): ...@@ -8,6 +8,13 @@ def assignments(request):
def announcements(request): def announcements(request):
return HttpResponse('This is the Announcement Board!') return HttpResponse('This is the Announcement Board!')
return HttpResponse('<br>')
return HttpResponse('ASSIGNMENTS: ')
return HttpResponse('Assignment Name: ' <name>)
return HttpResponse('Description: ' <description>)
return HttpResponse('Perfect Score: ' <max_points>)
return HttpResponse('Passing Score: ' <passing_score>)
return HttpResponse('Course/Section: ' <course_code> <course_title> <section>)
def forum(request): def forum(request):
return HttpResponse('Welcome to Widget’s Forum!') return HttpResponse('Welcome to Widget’s Forum!')
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