From 290b71a311ad245b996f38bc7da4080a07493958 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 5 Apr 2017 18:50:00 +0530 Subject: Add course_code field allows access only to users with relevant course code string --- yaksh/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 6646615..35375e0 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -112,6 +112,8 @@ class CourseManager(models.Manager): trial_course.enroll(False, user) return trial_course + def get_hidden_courses(self, code): + return self.filter(code=code, hidden=True) ############################################################################### class Course(models.Model): @@ -119,6 +121,8 @@ class Course(models.Model): name = models.CharField(max_length=128) enrollment = models.CharField(max_length=32, choices=enrollment_methods) active = models.BooleanField(default=True) + code = models.CharField(max_length=128, null=True, blank=True) + hidden = models.BooleanField(default=False) creator = models.ForeignKey(User, related_name='creator') students = models.ManyToManyField(User, related_name='students') requests = models.ManyToManyField(User, related_name='requests') -- cgit From ba54ff69f0eb8ff509e4e043c42b933771e205c5 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 27 Apr 2017 17:51:43 +0530 Subject: Rename the Hidden label to Open Course --- yaksh/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 35375e0..5fa828c 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -49,7 +49,7 @@ question_types = ( enrollment_methods = ( ("default", "Enroll Request"), - ("open", "Open Course"), + ("open", "Open Enrollment"), ) test_case_types = ( -- cgit