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
d7e44108
Commit
d7e44108
authored
Sep 17, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust parameters to construct_xblock_from_class to match XBlock repo.
parent
e73bc906
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
20 deletions
+17
-20
common/lib/xmodule/xmodule/error_module.py
+2
-2
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+3
-4
common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py
+1
-1
common/lib/xmodule/xmodule/modulestore/xml.py
+1
-1
common/lib/xmodule/xmodule/tests/test_editing_module.py
+1
-1
common/lib/xmodule/xmodule/tests/test_video.py
+1
-1
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
+2
-2
common/lib/xmodule/xmodule/tests/test_xml_module.py
+1
-1
common/lib/xmodule/xmodule/video_module.py
+2
-3
common/lib/xmodule/xmodule/x_module.py
+1
-1
common/lib/xmodule/xmodule/xml_module.py
+2
-3
No files found.
common/lib/xmodule/xmodule/error_module.py
View file @
d7e44108
...
...
@@ -105,10 +105,10 @@ class ErrorDescriptor(ErrorFields, XModuleDescriptor):
})
return
system
.
construct_xblock_from_class
(
cls
,
field_data
,
# The error module doesn't use scoped data, and thus doesn't need
# real scope keys
ScopeIds
(
'error'
,
None
,
location
,
location
)
ScopeIds
(
'error'
,
None
,
location
,
location
),
field_data
,
)
def
get_context
(
self
):
...
...
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
d7e44108
...
...
@@ -193,7 +193,7 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
field_data
=
DbModel
(
kvs
)
scope_ids
=
ScopeIds
(
None
,
category
,
location
,
location
)
module
=
self
.
construct_xblock_from_class
(
class_
,
field_data
,
scope_ids
)
module
=
self
.
construct_xblock_from_class
(
class_
,
scope_ids
,
field_data
)
if
self
.
cached_metadata
is
not
None
:
# parent container pointers don't differentiate between draft and non-draft
# so when we do the lookup, we should do so with a non-draft location
...
...
@@ -621,12 +621,11 @@ class MongoModuleStore(ModuleStoreBase):
dbmodel
=
self
.
_create_new_field_data
(
location
.
category
,
location
,
definition_data
,
metadata
)
xmodule
=
system
.
construct_xblock_from_class
(
xblock_class
,
dbmodel
,
# We're loading a descriptor, so student_id is meaningless
# We also don't have separate notions of definition and usage ids yet,
# so we use the location for both.
ScopeIds
(
None
,
location
.
category
,
location
,
location
)
ScopeIds
(
None
,
location
.
category
,
location
,
location
),
dbmodel
,
)
# decache any pending field settings from init
xmodule
.
save
()
...
...
common/lib/xmodule/xmodule/modulestore/split_mongo/caching_descriptor_system.py
View file @
d7e44108
...
...
@@ -111,8 +111,8 @@ class CachingDescriptorSystem(MakoDescriptorSystem):
try
:
module
=
self
.
construct_xblock_from_class
(
class_
,
ScopeIds
(
None
,
json_data
.
get
(
'category'
),
definition_id
,
block_locator
),
field_data
,
ScopeIds
(
None
,
json_data
.
get
(
'category'
),
definition_id
,
block_locator
)
)
except
Exception
:
log
.
warning
(
"Failed to load descriptor"
,
exc_info
=
True
)
...
...
common/lib/xmodule/xmodule/modulestore/xml.py
View file @
d7e44108
...
...
@@ -477,11 +477,11 @@ class XMLModuleStore(ModuleStoreBase):
loc
=
Location
(
'i4x'
,
course_descriptor
.
location
.
org
,
course_descriptor
.
location
.
course
,
category
,
slug
)
module
=
system
.
construct_xblock_from_class
(
HtmlDescriptor
,
DictFieldData
({
'data'
:
html
,
'location'
:
loc
,
'category'
:
category
}),
# We're loading a descriptor, so student_id is meaningless
# We also don't have separate notions of definition and usage ids yet,
# so we use the location for both
ScopeIds
(
None
,
category
,
loc
,
loc
),
DictFieldData
({
'data'
:
html
,
'location'
:
loc
,
'category'
:
category
}),
)
# VS[compat]:
# Hack because we need to pull in the 'display_name' for static tabs (because we need to edit them)
...
...
common/lib/xmodule/xmodule/tests/test_editing_module.py
View file @
d7e44108
...
...
@@ -46,8 +46,8 @@ class TabsEditingDescriptorTestCase(unittest.TestCase):
TabsEditingDescriptor
.
tabs
=
self
.
tabs
self
.
descriptor
=
system
.
construct_xblock_from_class
(
TabsEditingDescriptor
,
field_data
=
DictFieldData
({}),
scope_ids
=
ScopeIds
(
None
,
None
,
None
,
None
),
field_data
=
DictFieldData
({}),
)
def
test_get_css
(
self
):
...
...
common/lib/xmodule/xmodule/tests/test_video.py
View file @
d7e44108
...
...
@@ -133,8 +133,8 @@ class VideoDescriptorTest(unittest.TestCase):
system
=
get_test_descriptor_system
()
self
.
descriptor
=
system
.
construct_xblock_from_class
(
VideoDescriptor
,
field_data
=
DictFieldData
({}),
scope_ids
=
ScopeIds
(
None
,
None
,
None
,
None
),
field_data
=
DictFieldData
({}),
)
def
test_get_context
(
self
):
...
...
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
View file @
d7e44108
...
...
@@ -87,8 +87,8 @@ class TestXBlockWrapper(object):
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u'{!r}, {!r}'
.
format
(
args
,
kwargs
)
return
runtime
.
construct_xblock_from_class
(
descriptor_cls
,
ScopeIds
(
None
,
descriptor_cls
.
__name__
,
location
,
location
),
DictFieldData
({}),
ScopeIds
(
None
,
descriptor_cls
.
__name__
,
location
,
location
)
)
def
leaf_module
(
self
,
descriptor_cls
):
...
...
@@ -109,10 +109,10 @@ class TestXBlockWrapper(object):
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u'{!r}, {!r}'
.
format
(
args
,
kwargs
)
return
runtime
.
construct_xblock_from_class
(
descriptor_cls
,
ScopeIds
(
None
,
descriptor_cls
.
__name__
,
location
,
location
),
DictFieldData
({
'children'
:
range
(
3
)
}),
ScopeIds
(
None
,
descriptor_cls
.
__name__
,
location
,
location
)
)
def
container_module
(
self
,
descriptor_cls
,
depth
):
...
...
common/lib/xmodule/xmodule/tests/test_xml_module.py
View file @
d7e44108
...
...
@@ -166,8 +166,8 @@ class EditableMetadataFieldsTest(unittest.TestCase):
runtime
=
get_test_descriptor_system
()
return
runtime
.
construct_xblock_from_class
(
XmlDescriptor
,
scope_ids
=
Mock
(),
field_data
=
field_data
,
scope_ids
=
Mock
()
)
.
editable_metadata_fields
def
get_descriptor
(
self
,
field_data
):
...
...
common/lib/xmodule/xmodule/video_module.py
View file @
d7e44108
...
...
@@ -247,12 +247,11 @@ class VideoDescriptor(VideoFields, TabsEditingDescriptor, EmptyDataRawDescriptor
field_data
=
DbModel
(
kvs
)
video
=
system
.
construct_xblock_from_class
(
cls
,
field_data
,
# We're loading a descriptor, so student_id is meaningless
# We also don't have separate notions of definition and usage ids yet,
# so we use the location for both
ScopeIds
(
None
,
location
.
category
,
location
,
location
)
ScopeIds
(
None
,
location
.
category
,
location
,
location
),
field_data
,
)
return
video
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
d7e44108
...
...
@@ -502,8 +502,8 @@ class XModuleDescriptor(XModuleMixin, HTMLSnippet, ResourceTemplates, XBlock):
module
=
system
.
construct_xblock_from_class
(
self
.
module_class
,
descriptor
=
self
,
field_data
=
system
.
xmodule_field_data
(
self
),
scope_ids
=
self
.
scope_ids
,
field_data
=
system
.
xmodule_field_data
(
self
),
)
module
.
save
()
return
module
...
...
common/lib/xmodule/xmodule/xml_module.py
View file @
d7e44108
...
...
@@ -339,12 +339,11 @@ class XmlDescriptor(XModuleDescriptor):
return
system
.
construct_xblock_from_class
(
cls
,
field_data
,
# We're loading a descriptor, so student_id is meaningless
# We also don't have separate notions of definition and usage ids yet,
# so we use the location for both
ScopeIds
(
None
,
location
.
category
,
location
,
location
)
ScopeIds
(
None
,
location
.
category
,
location
,
location
),
field_data
,
)
@classmethod
...
...
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