diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 3b73b6a4d1..2bab5580f6 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -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)