Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
58543bd8
Commit
58543bd8
authored
12 years ago
by
Victor Shnayder
Browse files
Options
Downloads
Patches
Plain Diff
definition and metadata no longer lazy-loaded
* get rid of dump to json * formatting
parent
119ab639
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/xmodule_modifiers.py
+5
-6
5 additions, 6 deletions
common/djangoapps/xmodule_modifiers.py
with
5 additions
and
6 deletions
common/djangoapps/xmodule_modifiers.py
+
5
−
6
View file @
58543bd8
...
...
@@ -76,8 +76,9 @@ def add_histogram(get_html, module):
histogram
=
grade_histogram
(
module_id
)
render_histogram
=
len
(
histogram
)
>
0
# TODO: fixme - no filename in module.xml in general (this code block for edx4edx)
# the following if block is for summer 2012 edX course development; it will change when the CMS comes online
# TODO: fixme - no filename in module.xml in general (this code block
# for edx4edx) the following if block is for summer 2012 edX course
# development; it will change when the CMS comes online
if
settings
.
MITX_FEATURES
.
get
(
'
DISPLAY_EDIT_LINK
'
)
and
settings
.
DEBUG
and
module_xml
.
get
(
'
filename
'
)
is
not
None
:
coursename
=
multicourse_settings
.
get_coursename_from_request
(
request
)
github_url
=
multicourse_settings
.
get_course_github_url
(
coursename
)
...
...
@@ -88,10 +89,8 @@ def add_histogram(get_html, module):
else
:
edit_link
=
False
# Cast module.definition and module.metadata to dicts so that json can dump them
# even though they are lazily loaded
staff_context
=
{
'
definition
'
:
json
.
dumps
(
dict
(
module
.
definition
),
indent
=
4
),
'
metadata
'
:
json
.
dumps
(
dict
(
module
.
metadata
),
indent
=
4
),
staff_context
=
{
'
definition
'
:
dict
(
module
.
definition
),
'
metadata
'
:
dict
(
module
.
metadata
),
'
element_id
'
:
module
.
location
.
html_id
(),
'
edit_link
'
:
edit_link
,
'
histogram
'
:
json
.
dumps
(
histogram
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment