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
94e24c16
Commit
94e24c16
authored
Aug 03, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Leftover name->url_name fixes
parent
0b2069c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
16 deletions
+17
-16
common/lib/xmodule/xmodule/modulestore/search.py
+3
-2
lms/djangoapps/courseware/grades.py
+5
-5
lms/djangoapps/courseware/module_render.py
+9
-9
No files found.
common/lib/xmodule/xmodule/modulestore/search.py
View file @
94e24c16
...
...
@@ -87,8 +87,9 @@ def path_to_location(modulestore, location, course_name=None):
n
=
len
(
path
)
course_id
=
CourseDescriptor
.
location_to_id
(
path
[
0
])
chapter
=
path
[
1
]
.
url_name
if
n
>
1
else
None
section
=
path
[
2
]
.
url_name
if
n
>
2
else
None
# pull out the location names
chapter
=
path
[
1
]
.
name
if
n
>
1
else
None
section
=
path
[
2
]
.
name
if
n
>
2
else
None
# TODO (vshnayder): not handling position at all yet...
position
=
None
...
...
lms/djangoapps/courseware/grades.py
View file @
94e24c16
...
...
@@ -74,8 +74,8 @@ def grade_sheet(student, course, grader, student_module_cache):
totaled_scores
[
format
]
=
format_scores
sections
.
append
({
'display_name'
:
s
.
metadata
.
get
(
'display_name'
)
,
'url_name'
:
s
.
metadata
.
get
(
'url_name'
)
,
'display_name'
:
s
.
display_name
,
'url_name'
:
s
.
url_name
,
'scores'
:
scores
,
'section_total'
:
section_total
,
'format'
:
format
,
...
...
@@ -83,9 +83,9 @@ def grade_sheet(student, course, grader, student_module_cache):
'graded'
:
graded
,
})
chapters
.
append
({
'course'
:
course
.
metadata
.
get
(
'display_name'
)
,
'display_name'
:
c
.
metadata
.
get
(
'display_name'
)
,
'url_name'
:
c
.
metadata
.
get
(
'url_name'
)
,
chapters
.
append
({
'course'
:
course
.
display_name
,
'display_name'
:
c
.
display_name
,
'url_name'
:
c
.
url_name
,
'sections'
:
sections
})
grade_summary
=
grader
.
grade
(
totaled_scores
)
...
...
lms/djangoapps/courseware/module_render.py
View file @
94e24c16
...
...
@@ -56,21 +56,21 @@ def toc_for_course(user, request, course, active_chapter, active_section):
sections
=
list
()
for
section
in
chapter
.
get_display_items
():
active
=
(
chapter
.
metadata
.
get
(
'display_name'
)
==
active_chapter
and
section
.
metadata
.
get
(
'display_name'
)
==
active_section
)
active
=
(
chapter
.
display_name
==
active_chapter
and
section
.
display_name
==
active_section
)
hide_from_toc
=
section
.
metadata
.
get
(
'hide_from_toc'
,
'false'
)
.
lower
()
==
'true'
if
not
hide_from_toc
:
sections
.
append
({
'display_name'
:
section
.
metadata
.
get
(
'display_name'
)
,
'url_name'
:
section
.
metadata
.
get
(
'url_name'
)
,
sections
.
append
({
'display_name'
:
section
.
display_name
,
'url_name'
:
section
.
url_name
,
'format'
:
section
.
metadata
.
get
(
'format'
,
''
),
'due'
:
section
.
metadata
.
get
(
'due'
,
''
),
'active'
:
active
})
chapters
.
append
({
'display_name'
:
chapter
.
metadata
.
get
(
'display_name'
)
,
'url_name'
:
chapter
.
metadata
.
get
(
'url_name'
)
,
chapters
.
append
({
'display_name'
:
chapter
.
display_name
,
'url_name'
:
chapter
.
url_name
,
'sections'
:
sections
,
'active'
:
chapter
.
metadata
.
get
(
'display_name'
)
==
active_chapter
})
'active'
:
chapter
.
display_name
==
active_chapter
})
return
chapters
...
...
@@ -89,7 +89,7 @@ def get_section(course_module, chapter, section):
chapter_module
=
None
for
_chapter
in
course_module
.
get_children
():
if
_chapter
.
metadata
.
get
(
'url_name'
)
==
chapter
:
if
_chapter
.
url_name
==
chapter
:
chapter_module
=
_chapter
break
...
...
@@ -98,7 +98,7 @@ def get_section(course_module, chapter, section):
section_module
=
None
for
_section
in
chapter_module
.
get_children
():
if
_section
.
metadata
.
get
(
'url_name'
)
==
section
:
if
_section
.
url_name
==
section
:
section_module
=
_section
break
...
...
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