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
83fdeea2
Commit
83fdeea2
authored
Jul 06, 2012
by
Matthew Mongeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hookup the CourseDescriptor stuff by fixing a fewt push -f dorm issues.
parent
51092533
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
common/lib/xmodule/xmodule/modulestore/xml.py
+3
-4
common/lib/xmodule/xmodule/x_module.py
+3
-3
No files found.
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
83fdeea2
...
@@ -42,7 +42,7 @@ class XMLModuleStore(ModuleStore):
...
@@ -42,7 +42,7 @@ class XMLModuleStore(ModuleStore):
self
.
default_class
=
class_
self
.
default_class
=
class_
for
course_dir
in
os
.
listdir
(
self
.
data_dir
):
for
course_dir
in
os
.
listdir
(
self
.
data_dir
):
if
not
os
.
path
.
isdir
(
course_dir
):
if
not
os
.
path
.
exists
(
self
.
data_dir
+
"/"
+
course_dir
+
"/course.xml"
):
continue
continue
self
.
load_course
(
course_dir
)
self
.
load_course
(
course_dir
)
...
@@ -50,7 +50,6 @@ class XMLModuleStore(ModuleStore):
...
@@ -50,7 +50,6 @@ class XMLModuleStore(ModuleStore):
def
load_course
(
self
,
course_dir
):
def
load_course
(
self
,
course_dir
):
"""
"""
Load a course into this module store
Load a course into this module store
course_path: Course directory name
course_path: Course directory name
"""
"""
...
@@ -91,14 +90,14 @@ class XMLModuleStore(ModuleStore):
...
@@ -91,14 +90,14 @@ class XMLModuleStore(ModuleStore):
module
=
XModuleDescriptor
.
load_from_xml
(
etree
.
tostring
(
xml_data
),
self
,
org
,
course
,
modulestore
.
default_class
)
module
=
XModuleDescriptor
.
load_from_xml
(
etree
.
tostring
(
xml_data
),
self
,
org
,
course
,
modulestore
.
default_class
)
modulestore
.
modules
[
module
.
location
]
=
module
modulestore
.
modules
[
module
.
location
]
=
module
if
self
.
eager
:
if
modulestore
.
eager
:
module
.
get_children
()
module
.
get_children
()
return
module
return
module
system_kwargs
=
dict
(
system_kwargs
=
dict
(
render_template
=
lambda
:
''
,
render_template
=
lambda
:
''
,
load_item
=
modulestore
.
get_item
,
load_item
=
modulestore
.
get_item
,
resources_fs
=
OSFS
(
self
.
data_dir
/
course_dir
),
resources_fs
=
OSFS
(
modulestore
.
data_dir
/
course_dir
),
process_xml
=
process_xml
process_xml
=
process_xml
)
)
MakoDescriptorSystem
.
__init__
(
self
,
**
system_kwargs
)
MakoDescriptorSystem
.
__init__
(
self
,
**
system_kwargs
)
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
83fdeea2
...
@@ -249,11 +249,11 @@ class XModuleDescriptor(Plugin):
...
@@ -249,11 +249,11 @@ class XModuleDescriptor(Plugin):
rerandomize (string): When to generate a newly randomized instance of the module data
rerandomize (string): When to generate a newly randomized instance of the module data
"""
"""
self
.
system
=
system
self
.
system
=
system
self
.
metadata
=
kwargs
.
get
(
'metadata'
,
{})
self
.
definition
=
definition
if
definition
is
not
None
else
{}
self
.
definition
=
definition
if
definition
is
not
None
else
{}
self
.
name
=
Location
(
kwargs
.
get
(
'location'
))
.
name
self
.
category
=
Location
(
kwargs
.
get
(
'location'
))
.
category
self
.
location
=
Location
(
kwargs
.
get
(
'location'
))
self
.
location
=
Location
(
kwargs
.
get
(
'location'
))
self
.
metadata
=
kwargs
.
get
(
'metadata'
,
{})
self
.
name
=
self
.
location
.
name
self
.
category
=
self
.
location
.
category
self
.
shared_state_key
=
kwargs
.
get
(
'shared_state_key'
)
self
.
shared_state_key
=
kwargs
.
get
(
'shared_state_key'
)
self
.
_child_instances
=
None
self
.
_child_instances
=
None
...
...
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