Commit e5a6509b by Calen Pennington

Add a first_time_user attribute to CourseModule so that we can check for that…

Add a first_time_user attribute to CourseModule so that we can check for that explicitly, rather than looking for an implicitly created StudentModule
parent ce76b64b
...@@ -89,8 +89,18 @@ class TextbookList(ModelType): ...@@ -89,8 +89,18 @@ class TextbookList(ModelType):
return json_data 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): 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) 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) wiki_slug = String(help="Slug that points to the wiki for this course", scope=Scope.content)
......
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