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
c2cb3ce6
Commit
c2cb3ce6
authored
Aug 22, 2012
by
Mark L. Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter chaptesr and sections by hide_from_toc flag
parent
9adcdf8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
lms/djangoapps/acceptance_testing/features/courses.py
+6
-2
No files found.
lms/djangoapps/acceptance_testing/features/courses.py
View file @
c2cb3ce6
...
...
@@ -71,6 +71,9 @@ def get_courseware_with_tabs(course_id):
top three levels of navigation. Same as get_courseware() except include
the tabs on the right hand main navigation page.
This hides the appropriate courseware as defined by the XML flag test:
chapter.metadata.get('hide_from_toc','false').lower() == 'true'
Example:
[{
...
...
@@ -122,8 +125,9 @@ def get_courseware_with_tabs(course_id):
"""
course
=
get_course_by_id
(
course_id
)
chapters
=
course
.
get_children
()
courseware
=
[{
'chapter_name'
:
c
.
display_name
,
'sections'
:[{
'section_name'
:
s
.
display_name
,
'clickable_tab_count'
:
len
(
s
.
get_children
())
if
(
type
(
s
)
==
xmodule
.
seq_module
.
SequenceDescriptor
)
else
0
,
'tab_classes'
:[
t
.
__class__
.
__name__
for
t
in
s
.
get_children
()
]}
for
s
in
c
.
get_children
()]}
for
c
in
chapters
]
chapters
=
[
chapter
for
chapter
in
course
.
get_children
()
if
chapter
.
metadata
.
get
(
'hide_from_toc'
,
'false'
)
.
lower
()
!=
'true'
]
courseware
=
[{
'chapter_name'
:
c
.
display_name
,
'sections'
:[{
'section_name'
:
s
.
display_name
,
'clickable_tab_count'
:
len
(
s
.
get_children
())
if
(
type
(
s
)
==
xmodule
.
seq_module
.
SequenceDescriptor
)
else
0
,
'tab_classes'
:[
t
.
__class__
.
__name__
for
t
in
s
.
get_children
()
]}
for
s
in
c
.
get_children
()
if
s
.
metadata
.
get
(
'hide_from_toc'
,
'false'
)
.
lower
()
!=
'true'
]}
for
c
in
chapters
]
return
courseware
## course listing step
...
...
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