Add a first_time_user attribute to CourseModule so that we can check for that explicitly, rather than looking for an implicitly created StudentModule

This commit is contained in:
Calen Pennington
2013-01-08 11:51:20 -05:00
parent ce76b64bae
commit e5a6509bb0

View File

@@ -89,8 +89,18 @@ class TextbookList(ModelType):
return json_data
class CourseModule(SequenceModule):
first_time_user = Boolean(help="Whether this is the first time the user has visited this course", scope=Scope.student_state, default=True)
def __init__(self, *args, **kwargs):
super(CourseModule, self).__init__(*args, **kwargs)
if self.first_time_user:
self.first_time_user = False
class CourseDescriptor(SequenceDescriptor):
module_class = SequenceModule
module_class = CourseModule
textbooks = TextbookList(help="List of pairs of (title, url) for textbooks used in this course", default=[], scope=Scope.content)
wiki_slug = String(help="Slug that points to the wiki for this course", scope=Scope.content)