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
324a1da6
Commit
324a1da6
authored
Oct 06, 2014
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5474 from edx/openedx-jira-reference
Reformat seq_module.py
parents
b9cfd7b6
6f47e5d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
common/lib/xmodule/xmodule/seq_module.py
+18
-13
No files found.
common/lib/xmodule/xmodule/seq_module.py
View file @
324a1da6
...
@@ -49,28 +49,31 @@ class SequenceFields(object):
...
@@ -49,28 +49,31 @@ class SequenceFields(object):
class
SequenceModule
(
SequenceFields
,
XModule
):
class
SequenceModule
(
SequenceFields
,
XModule
):
''' Layout module which lays out content in a temporal sequence
''' Layout module which lays out content in a temporal sequence
'''
'''
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
js
=
{
'js/src/sequence/display.coffee'
)],
'coffee'
:
[
resource_string
(
__name__
,
'js/src/sequence/display.coffee'
)],
'js'
:
[
resource_string
(
__name__
,
'js/src/sequence/display/jquery.sequence.js'
)]}
'js'
:
[
resource_string
(
__name__
,
'js/src/sequence/display/jquery.sequence.js'
)],
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/sequence/display.scss'
)]}
}
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/sequence/display.scss'
)],
}
js_module_name
=
"Sequence"
js_module_name
=
"Sequence"
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
SequenceModule
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
super
(
SequenceModule
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
# If position is specified in system, then use that instead
# If position is specified in system, then use that instead.
# This code was made robust to avoid issues like LMS-2799 in
# Jira. We do not know whether this issue is still present,
# but regardless, we'd like to follow:
# http://en.wikipedia.org/wiki/Robustness_principle
position
=
getattr
(
self
.
system
,
'position'
,
None
)
position
=
getattr
(
self
.
system
,
'position'
,
None
)
if
position
is
not
None
:
if
position
is
not
None
:
try
:
try
:
self
.
position
=
int
(
self
.
system
.
position
)
self
.
position
=
int
(
self
.
system
.
position
)
except
(
ValueError
,
TypeError
):
except
(
ValueError
,
TypeError
):
warnings
.
warn
(
"Sequential position is an invalid type."
,
RuntimeWarning
)
# Check for https://openedx.atlassian.net/browse/LMS-6496
warnings
.
warn
(
"Sequential position cannot be converted to an integer: {pos!r}"
.
format
(
pos
=
self
.
system
.
position
,
),
RuntimeWarning
,
)
def
get_progress
(
self
):
def
get_progress
(
self
):
''' Return the total progress, adding total done and total available.
''' Return the total progress, adding total done and total available.
...
@@ -145,7 +148,9 @@ class SequenceDescriptor(SequenceFields, MakoModuleDescriptor, XmlDescriptor):
...
@@ -145,7 +148,9 @@ class SequenceDescriptor(SequenceFields, MakoModuleDescriptor, XmlDescriptor):
mako_template
=
'widgets/sequence-edit.html'
mako_template
=
'widgets/sequence-edit.html'
module_class
=
SequenceModule
module_class
=
SequenceModule
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/sequence/edit.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/sequence/edit.coffee'
)],
}
js_module_name
=
"SequenceDescriptor"
js_module_name
=
"SequenceDescriptor"
@classmethod
@classmethod
...
...
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