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
258d3227
Commit
258d3227
authored
Dec 13, 2013
by
Christina Roberts
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1938 from edx/christina/common-location
Create explicit Locations.
parents
e326fd13
df09e99a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
9 deletions
+11
-9
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
+3
-3
lms/djangoapps/courseware/tests/test_module_render.py
+1
-1
lms/djangoapps/courseware/views.py
+1
-1
lms/djangoapps/django_comment_client/utils.py
+2
-1
lms/djangoapps/open_ended_grading/views.py
+3
-2
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
258d3227
...
...
@@ -724,7 +724,7 @@ class MongoModuleStore(ModuleStoreWriteBase):
# @hack! We need to find the course location however, we don't
# know the 'name' parameter in this context, so we have
# to assume there's only one item in this query even though we are not specifying a name
course_search_location
=
[
'i4x'
,
location
.
org
,
location
.
course
,
'course'
,
None
]
course_search_location
=
Location
(
'i4x'
,
location
.
org
,
location
.
course
,
'course'
,
None
)
courses
=
self
.
get_items
(
course_search_location
,
depth
=
depth
)
# make sure we found exactly one match on this above course search
...
...
common/lib/xmodule/xmodule/modulestore/tests/test_mixed_modulestore.py
View file @
258d3227
...
...
@@ -182,15 +182,15 @@ class TestMixedModuleStore(object):
)
def
test_get_items
(
self
):
modules
=
self
.
store
.
get_items
(
[
'i4x'
,
None
,
None
,
'course'
,
None
]
,
IMPORT_COURSEID
)
modules
=
self
.
store
.
get_items
(
Location
(
'i4x'
,
None
,
None
,
'course'
,
None
)
,
IMPORT_COURSEID
)
assert_equals
(
len
(
modules
),
1
)
assert_equals
(
modules
[
0
]
.
location
.
course
,
self
.
import_course
)
modules
=
self
.
store
.
get_items
(
[
'i4x'
,
None
,
None
,
'course'
,
None
]
,
XML_COURSEID1
)
modules
=
self
.
store
.
get_items
(
Location
(
'i4x'
,
None
,
None
,
'course'
,
None
)
,
XML_COURSEID1
)
assert_equals
(
len
(
modules
),
1
)
assert_equals
(
modules
[
0
]
.
location
.
course
,
'toy'
)
modules
=
self
.
store
.
get_items
(
[
'i4x'
,
None
,
None
,
'course'
,
None
]
,
XML_COURSEID2
)
modules
=
self
.
store
.
get_items
(
Location
(
'i4x'
,
None
,
None
,
'course'
,
None
)
,
XML_COURSEID2
)
assert_equals
(
len
(
modules
),
1
)
assert_equals
(
modules
[
0
]
.
location
.
course
,
'simple'
)
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
258d3227
...
...
@@ -79,7 +79,7 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
module
=
render
.
get_module
(
self
.
mock_user
,
mock_request
,
[
'i4x'
,
'edX'
,
'toy'
,
'html'
,
'toyjumpto'
]
,
Location
(
'i4x'
,
'edX'
,
'toy'
,
'html'
,
'toyjumpto'
)
,
field_data_cache
,
self
.
course_id
)
...
...
lms/djangoapps/courseware/views.py
View file @
258d3227
...
...
@@ -388,7 +388,7 @@ def jump_to_id(request, course_id, module_id):
course_location
=
CourseDescriptor
.
id_to_location
(
course_id
)
items
=
modulestore
()
.
get_items
(
[
'i4x'
,
course_location
.
org
,
course_location
.
course
,
None
,
module_id
]
,
Location
(
'i4x'
,
course_location
.
org
,
course_location
.
course
,
None
,
module_id
)
,
course_id
=
course_id
)
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
258d3227
...
...
@@ -16,6 +16,7 @@ import edxmako
import
pystache_custom
as
pystache
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
Location
from
django.utils.timezone
import
UTC
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -56,7 +57,7 @@ def has_forum_access(uname, course_id, rolename):
def
_get_discussion_modules
(
course
):
all_modules
=
modulestore
()
.
get_items
(
[
'i4x'
,
course
.
location
.
org
,
course
.
location
.
course
,
'discussion'
,
None
]
,
Location
(
'i4x'
,
course
.
location
.
org
,
course
.
location
.
course
,
'discussion'
,
None
)
,
course_id
=
course
.
id
)
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
258d3227
...
...
@@ -16,7 +16,8 @@ import open_ended_notifications
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore
import
search
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
,
NoPathToItem
from
xmodule.modulestore
import
Location
from
xmodule.modulestore.exceptions
import
NoPathToItem
from
django.http
import
HttpResponse
,
Http404
,
HttpResponseRedirect
from
edxmako.shortcuts
import
render_to_string
...
...
@@ -92,7 +93,7 @@ def find_peer_grading_module(course):
# Get the course id and split it.
course_id_parts
=
course
.
id
.
split
(
"/"
)
# Get the peer grading modules currently in the course. Explicitly specify the course id to avoid issues with different runs.
items
=
modulestore
()
.
get_items
(
[
'i4x'
,
course_id_parts
[
0
],
course_id_parts
[
1
],
'peergrading'
,
None
]
,
items
=
modulestore
()
.
get_items
(
Location
(
'i4x'
,
course_id_parts
[
0
],
course_id_parts
[
1
],
'peergrading'
,
None
)
,
course_id
=
course
.
id
)
#See if any of the modules are centralized modules (ie display info from multiple problems)
items
=
[
i
for
i
in
items
if
not
getattr
(
i
,
"use_for_single_location"
,
True
)]
...
...
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