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
264ca656
Commit
264ca656
authored
Mar 25, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some comments
parent
884019b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
common/lib/xmodule/xmodule/course_module.py
+5
-6
No files found.
common/lib/xmodule/xmodule/course_module.py
View file @
264ca656
import
logging
from
cStringIO
import
StringIO
from
math
import
exp
,
erf
from
math
import
exp
from
lxml
import
etree
from
path
import
path
# NOTE (THK): Only used for detecting presence of syllabus
import
requests
...
...
@@ -24,9 +24,8 @@ log = logging.getLogger(__name__)
class
StringOrDate
(
Date
):
def
from_json
(
self
,
value
):
"""
Parse an optional metadata key containing a time: if present, complain
if it doesn't parse.
Return None if not present or invalid.
Parse an optional metadata key containing a time or a string:
if present, assume it's a string if it doesn't parse.
"""
try
:
result
=
super
(
StringOrDate
,
self
)
.
from_json
(
value
)
...
...
@@ -39,7 +38,7 @@ class StringOrDate(Date):
def
to_json
(
self
,
value
):
"""
Convert a time struct
to a string
Convert a time struct
or string to a string.
"""
try
:
result
=
super
(
StringOrDate
,
self
)
.
to_json
(
value
)
...
...
@@ -176,7 +175,7 @@ class CourseFields(object):
allow_anonymous_to_peers
=
Boolean
(
scope
=
Scope
.
settings
,
default
=
False
)
advanced_modules
=
List
(
help
=
"Beta modules used in your course"
,
scope
=
Scope
.
settings
)
has_children
=
True
checklists
=
List
(
scope
=
Scope
.
settings
)
checklists
=
List
(
scope
=
Scope
.
settings
)
info_sidebar_name
=
String
(
scope
=
Scope
.
settings
,
default
=
'Course Handouts'
)
# An extra property is used rather than the wiki_slug/number because
...
...
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