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
f58339d6
Commit
f58339d6
authored
Aug 21, 2012
by
Mark L. Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return courseware navigation elements
parent
50f4a896
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletions
+36
-1
lms/djangoapps/acceptance_testing/features/courses.py
+25
-1
lms/djangoapps/acceptance_testing/features/courseware.feature
+11
-0
No files found.
lms/djangoapps/acceptance_testing/features/courses.py
View file @
f58339d6
...
...
@@ -25,7 +25,7 @@ from courseware.access import has_access
## end import
from
django.core.urlresolvers
import
reverse
from
courseware.courses
import
course_image_url
,
get_course_about_section
from
courseware.courses
import
course_image_url
,
get_course_about_section
,
get_course_by_id
## support functions
def
get_courses
():
...
...
@@ -41,6 +41,30 @@ def get_courses():
return
courses
def
get_courseware
(
course_id
):
"""
Given a course_id (string), return a courseware array of dictionaries for the
top two levels of navigation. Example:
[
{'chapter_name': 'Overview',
'sections': ['Welcome', 'System Usage Sequence', 'Lab0: Using the tools', 'Circuit Sandbox']
},
{'chapter_name': 'Week 1',
'sections': ['Administrivia and Circuit Elements', 'Basic Circuit Analysis', 'Resistor Divider', 'Week 1 Tutorials']
},
{'chapter_name': 'Midterm Exam',
'sections': ['Midterm Exam']
}
]
"""
course
=
get_course_by_id
(
course_id
)
chapters
=
course
.
get_children
()
courseware
=
[
{
'chapter_name'
:
c
.
display_name
,
'sections'
:[
s
.
display_name
for
s
in
c
.
get_children
()]}
for
c
in
chapters
]
return
courseware
## course listing step
@step
(
u'I should see all courses'
)
def
i_should_see_all_courses
(
step
):
...
...
lms/djangoapps/acceptance_testing/features/courseware.feature
0 → 100644
View file @
f58339d6
Feature
:
I can explore all the courses I am signed up for
In order to learn from the courses I'm signed up for
As a registered user with courses
I want to be able to see all the chapters and all the section in each chapter
for each course
Scenario
:
We can see all the courses
Given I visit "http
:
//localhost
:
8000/dashboard"
I
should see some courses
\ No newline at end of file
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