Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
16990c27
Commit
16990c27
authored
Oct 24, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an end date to courses.
- needed for cert generation (and later lots of other things)
parent
ec5e28fc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
common/lib/xmodule/xmodule/course_module.py
+11
-0
doc/xml-format.md
+1
-0
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
16990c27
...
@@ -87,6 +87,7 @@ class CourseDescriptor(SequenceDescriptor):
...
@@ -87,6 +87,7 @@ class CourseDescriptor(SequenceDescriptor):
self
.
enrollment_start
=
self
.
_try_parse_time
(
"enrollment_start"
)
self
.
enrollment_start
=
self
.
_try_parse_time
(
"enrollment_start"
)
self
.
enrollment_end
=
self
.
_try_parse_time
(
"enrollment_end"
)
self
.
enrollment_end
=
self
.
_try_parse_time
(
"enrollment_end"
)
self
.
end
=
self
.
_try_parse_time
(
"end"
)
# NOTE: relies on the modulestore to call set_grading_policy() right after
# NOTE: relies on the modulestore to call set_grading_policy() right after
# init. (Modulestore is in charge of figuring out where to load the policy from)
# init. (Modulestore is in charge of figuring out where to load the policy from)
...
@@ -127,6 +128,16 @@ class CourseDescriptor(SequenceDescriptor):
...
@@ -127,6 +128,16 @@ class CourseDescriptor(SequenceDescriptor):
return
definition
return
definition
def
has_ended
(
self
):
"""
Returns True if the current time is after the specified course end date.
Returns False if there is no end date specified.
"""
if
self
.
end_date
is
None
:
return
False
return
time
.
gmtime
()
>
self
.
end
def
has_started
(
self
):
def
has_started
(
self
):
return
time
.
gmtime
()
>
self
.
start
return
time
.
gmtime
()
>
self
.
start
...
...
doc/xml-format.md
View file @
16990c27
...
@@ -251,6 +251,7 @@ Supported fields at the course level:
...
@@ -251,6 +251,7 @@ Supported fields at the course level:
* "start" -- specify the start date for the course. Format-by-example: "2012-09-05T12:00".
* "start" -- specify the start date for the course. Format-by-example: "2012-09-05T12:00".
* "enrollment_start", "enrollment_end" -- when can students enroll? (if not specified, can enroll anytime). Same format as "start".
* "enrollment_start", "enrollment_end" -- when can students enroll? (if not specified, can enroll anytime). Same format as "start".
* "end" -- specify the end date for the course. Format-by-example: "2012-11-05T12:00".
* "tabs" -- have custom tabs in the courseware. See below for details on config.
* "tabs" -- have custom tabs in the courseware. See below for details on config.
* TODO: there are others
* TODO: there are others
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment