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
1fcc0257
Commit
1fcc0257
authored
Jul 09, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass a course to get_section
parent
51c65e21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
lms/djangoapps/courseware/module_render.py
+1
-6
lms/djangoapps/courseware/views.py
+2
-1
No files found.
lms/djangoapps/courseware/module_render.py
View file @
1fcc0257
...
...
@@ -141,7 +141,7 @@ def toc_for_course(user, request, course, active_chapter, active_section):
return
chapters
def
get_section
(
course
,
chapter
,
section
):
def
get_section
(
course
_module
,
chapter
,
section
):
"""
Returns the xmodule descriptor for the name course > chapter > section,
or None if this doesn't specify a valid section
...
...
@@ -150,11 +150,6 @@ def get_section(course, chapter, section):
chapter: Chapter name
section: Section name
"""
try
:
course_module
=
modulestore
()
.
get_item
(
course
)
except
:
log
.
exception
(
"Unable to load course_module"
)
return
None
if
course_module
is
None
:
return
...
...
lms/djangoapps/courseware/views.py
View file @
1fcc0257
...
...
@@ -190,7 +190,8 @@ def index(request, course_id=None, chapter=None, section=None,
look_for_module
=
chapter
is
not
None
and
section
is
not
None
if
look_for_module
:
# TODO (cpennington): Pass the right course in here
section
=
get_section
(
course_location
,
chapter
,
section
)
section
=
get_section
(
course
,
chapter
,
section
)
student_module_cache
=
StudentModuleCache
(
request
.
user
,
section
)
module
,
_
,
_
,
_
=
get_module
(
request
.
user
,
request
,
section
.
location
,
student_module_cache
)
context
[
'content'
]
=
module
.
get_html
()
...
...
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