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
bf392e36
Commit
bf392e36
authored
Oct 11, 2012
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
on import set course metadata to hide the progress tab since we don't yet support grading policies
parent
a521ea23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
common/lib/xmodule/xmodule/modulestore/xml_importer.py
+6
-4
No files found.
common/lib/xmodule/xmodule/modulestore/xml_importer.py
View file @
bf392e36
...
@@ -94,8 +94,8 @@ def import_from_xml(store, data_dir, course_dirs=None,
...
@@ -94,8 +94,8 @@ def import_from_xml(store, data_dir, course_dirs=None,
for
module
in
module_store
.
modules
[
course_id
]
.
itervalues
():
for
module
in
module_store
.
modules
[
course_id
]
.
itervalues
():
if
module
.
category
==
'course'
:
if
module
.
category
==
'course'
:
course_loc
=
module
.
location
# HACK: for now we don't support progress tabs. There's a special metadata configuration setting for this.
course_data_dir
=
module
.
metadata
[
'data_dir'
]
module
.
metadata
[
'hide_progress_tab'
]
=
True
if
'data'
in
module
.
definition
:
if
'data'
in
module
.
definition
:
module_data
=
module
.
definition
[
'data'
]
module_data
=
module
.
definition
[
'data'
]
...
@@ -106,11 +106,13 @@ def import_from_xml(store, data_dir, course_dirs=None,
...
@@ -106,11 +106,13 @@ def import_from_xml(store, data_dir, course_dirs=None,
if
'/static/'
in
module_data
:
if
'/static/'
in
module_data
:
for
subkey
in
remap_dict
.
keys
():
for
subkey
in
remap_dict
.
keys
():
module_data
=
module_data
.
replace
(
'/static/'
+
subkey
,
'xasset:'
+
remap_dict
[
subkey
])
module_data
=
module_data
.
replace
(
'/static/'
+
subkey
,
'xasset:'
+
remap_dict
[
subkey
])
logging
.
debug
(
"was {0} now {1}"
.
format
(
module
.
definition
[
'data'
],
module_data
))
store
.
update_item
(
module
.
location
,
module_data
)
store
.
update_item
(
module
.
location
,
module_data
)
if
'children'
in
module
.
definition
:
if
'children'
in
module
.
definition
:
store
.
update_children
(
module
.
location
,
module
.
definition
[
'children'
])
store
.
update_children
(
module
.
location
,
module
.
definition
[
'children'
])
# NOTE: It's important to use own_metadata here to avoid writing
# NOTE: It's important to use own_metadata here to avoid writing
# inherited metadata everywhere.
# inherited metadata everywhere.
store
.
update_metadata
(
module
.
location
,
dict
(
module
.
own_metadata
))
store
.
update_metadata
(
module
.
location
,
dict
(
module
.
own_metadata
))
...
...
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