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
2ce67191
Commit
2ce67191
authored
May 19, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'edx/opaque-keys' into opaque-keys-merge-master
parents
8f72394e
1c6a0f0a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
7 deletions
+23
-7
common/lib/xmodule/xmodule/modulestore/mongo/base.py
+5
-1
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
+7
-1
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
+1
-1
common/lib/xmodule/xmodule/split_test_module.py
+1
-1
docs/en_us/developers/requirements.txt
+1
-0
lms/djangoapps/courseware/module_render.py
+1
-1
lms/djangoapps/dashboard/git_import.py
+6
-1
lms/djangoapps/psychometrics/psychoanalyze.py
+1
-1
No files found.
common/lib/xmodule/xmodule/modulestore/mongo/base.py
View file @
2ce67191
...
...
@@ -679,7 +679,11 @@ class MongoModuleStore(ModuleStoreWriteBase):
and rules as kwargs below
content (dict): fields to look for which have content scope. Follows same syntax and
rules as kwargs below.
revision (str): the revision of the items you're looking for.
revision (str): the revision of the items you're looking for. (only 'draft' makes sense for
this modulestore. If you don't provide a revision, it won't retrieve any drafts. If you
say 'draft', it will only return drafts. If you want one of each matching xblock but
preferring draft to published, call this same method on the draft modulestore w/o a
revision qualifier.)
kwargs (key=value): what to look for within the course.
Common qualifiers are ``category`` or any field name. if the target field is a list,
then it searches for the given value in the list not list equivalence.
...
...
common/lib/xmodule/xmodule/modulestore/mongo/draft.py
View file @
2ce67191
...
...
@@ -95,7 +95,7 @@ class DraftModuleStore(MongoModuleStore):
draft_loc
=
as_draft
(
location
)
return
super
(
DraftModuleStore
,
self
)
.
create_xmodule
(
draft_loc
,
definition_data
,
metadata
,
system
,
fields
)
def
get_items
(
self
,
course_key
,
settings
=
None
,
content
=
None
,
**
kwargs
):
def
get_items
(
self
,
course_key
,
settings
=
None
,
content
=
None
,
revision
=
None
,
**
kwargs
):
"""
Returns:
list of XModuleDescriptor instances for the matching items within the course with
...
...
@@ -108,6 +108,9 @@ class DraftModuleStore(MongoModuleStore):
course_key (CourseKey): the course identifier
settings: not used
content: not used
revision (str): the revision of the items you're looking for. Only 'draft' makes sense for
this modulestore. None implies get one of either the draft or published for each
matching xblock preferring the draft if it exists.
kwargs (key=value): what to look for within the course.
Common qualifiers are ``category`` or any field name. if the target field is a list,
then it searches for the given value in the list not list equivalence.
...
...
@@ -118,6 +121,9 @@ class DraftModuleStore(MongoModuleStore):
wrap_draft
(
item
)
for
item
in
super
(
DraftModuleStore
,
self
)
.
get_items
(
course_key
,
revision
=
'draft'
,
**
kwargs
)
]
if
revision
==
'draft'
:
# the user only wants the drafts not everything w/ preference for draft
return
draft_items
draft_items_locations
=
{
item
.
location
for
item
in
draft_items
}
non_draft_items
=
[
item
for
item
in
...
...
common/lib/xmodule/xmodule/modulestore/xml_exporter.py
View file @
2ce67191
...
...
@@ -126,7 +126,7 @@ def export_to_xml(modulestore, contentstore, course_key, root_dir, course_dir, d
# should we change the application, then this assumption will no longer
# be valid
if
draft_modulestore
is
not
None
:
draft_verticals
=
draft_modulestore
.
get_items
(
course_key
,
category
=
'vertical'
)
draft_verticals
=
draft_modulestore
.
get_items
(
course_key
,
category
=
'vertical'
,
revision
=
'draft'
)
if
len
(
draft_verticals
)
>
0
:
draft_course_dir
=
export_fs
.
makeopendir
(
DRAFT_DIR
)
for
draft_vertical
in
draft_verticals
:
...
...
common/lib/xmodule/xmodule/split_test_module.py
View file @
2ce67191
...
...
@@ -159,7 +159,7 @@ class SplitTestModule(SplitTestFields, XModule):
contents
.
append
({
'group_id'
:
group_id
,
'id'
:
child
.
id
,
'id'
:
child
.
location
.
to_deprecated_string
()
,
'content'
:
rendered_child
.
content
})
...
...
docs/en_us/developers/requirements.txt
View file @
2ce67191
...
...
@@ -3,3 +3,4 @@ Django >=1.4,<1.5
pytz
-e git+https://github.com/edx/XBlock.git#egg=XBlock
lxml
sphinxcontrib-napoleon==0.2.6
lms/djangoapps/courseware/module_render.py
View file @
2ce67191
...
...
@@ -503,7 +503,7 @@ def get_module_system_for_user(user, field_data_cache,
if
settings
.
FEATURES
.
get
(
'ENABLE_PSYCHOMETRICS'
):
system
.
set
(
'psychometrics_handler'
,
# set callback for updating PsychometricsData
make_psychometrics_data_update_handler
(
course_id
,
user
,
descriptor
.
location
.
to_deprecated_string
()
)
make_psychometrics_data_update_handler
(
course_id
,
user
,
descriptor
.
location
)
)
system
.
set
(
u'user_is_staff'
,
has_access
(
user
,
u'staff'
,
descriptor
.
location
,
course_id
))
...
...
lms/djangoapps/dashboard/git_import.py
View file @
2ce67191
...
...
@@ -17,7 +17,9 @@ from django.utils.translation import ugettext as _
import
mongoengine
from
dashboard.models
import
CourseImportLog
from
opaque_keys
import
InvalidKeyError
from
xmodule.modulestore.keys
import
CourseKey
from
xmodule.modulestore.locations
import
SlashSeparatedCourseKey
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -230,7 +232,10 @@ def add_repo(repo, rdir_in, branch=None):
match
=
re
.
search
(
r'(?ms)===> IMPORTING course (\S+)'
,
ret_import
)
if
match
:
course_id
=
match
.
group
(
1
)
course_key
=
CourseKey
.
from_string
(
course_id
)
try
:
course_key
=
CourseKey
.
from_string
(
course_id
)
except
InvalidKeyError
:
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_id
)
cdir
=
'{0}/{1}'
.
format
(
GIT_REPO_DIR
,
course_key
.
course
)
log
.
debug
(
'Studio course dir = {0}'
.
format
(
cdir
))
...
...
lms/djangoapps/psychometrics/psychoanalyze.py
View file @
2ce67191
...
...
@@ -307,7 +307,7 @@ def make_psychometrics_data_update_handler(course_id, user, module_state_key):
the PsychometricData instance for the given StudentModule instance.
"""
sm
,
status
=
StudentModule
.
objects
.
get_or_create
(
course_id
=
course_id
.
to_deprecated_string
()
,
course_id
=
course_id
,
student
=
user
,
module_state_key
=
module_state_key
,
defaults
=
{
'state'
:
'{}'
,
'module_type'
:
'problem'
},
...
...
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