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
e10577d6
Commit
e10577d6
authored
Sep 05, 2013
by
Alexander Kryklia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass user_id and course_id to runtime in cms (dev) and tests.
parent
f6d9c077
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
cms/djangoapps/contentstore/views/preview.py
+2
-2
common/lib/xmodule/xmodule/tests/__init__.py
+3
-2
lms/djangoapps/courseware/tests/__init__.py
+1
-1
No files found.
cms/djangoapps/contentstore/views/preview.py
View file @
e10577d6
...
...
@@ -81,7 +81,6 @@ def preview_component(request, location):
component
,
'xmodule_edit.html'
)
return
render_to_response
(
'component.html'
,
{
'preview'
:
get_preview_html
(
request
,
component
,
0
),
'editor'
:
component
.
runtime
.
render
(
component
,
None
,
'studio_view'
)
.
content
,
...
...
@@ -104,7 +103,6 @@ def preview_module_system(request, preview_id, descriptor):
return
lms_field_data
(
descriptor
.
_field_data
,
student_data
)
course_id
=
get_course_for_item
(
descriptor
.
location
)
.
location
.
course_id
return
ModuleSystem
(
ajax_url
=
reverse
(
'preview_dispatch'
,
args
=
[
preview_id
,
descriptor
.
location
.
url
(),
''
])
.
rstrip
(
'/'
),
# TODO (cpennington): Do we want to track how instructors are using the preview problems?
...
...
@@ -118,6 +116,8 @@ def preview_module_system(request, preview_id, descriptor):
xblock_field_data
=
preview_field_data
,
can_execute_unsafe_code
=
(
lambda
:
can_execute_unsafe_code
(
course_id
)),
mixins
=
settings
.
XBLOCK_MIXINS
,
course_id
=
course_id
,
anonymous_student_id
=
'student'
)
...
...
common/lib/xmodule/xmodule/tests/__init__.py
View file @
e10577d6
...
...
@@ -40,7 +40,7 @@ open_ended_grading_interface = {
}
def
get_test_system
():
def
get_test_system
(
course_id
=
''
):
"""
Construct a test ModuleSystem instance.
...
...
@@ -66,7 +66,8 @@ def get_test_system():
node_path
=
os
.
environ
.
get
(
"NODE_PATH"
,
"/usr/local/lib/node_modules"
),
xblock_field_data
=
lambda
descriptor
:
descriptor
.
_field_data
,
anonymous_student_id
=
'student'
,
open_ended_grading_interface
=
open_ended_grading_interface
open_ended_grading_interface
=
open_ended_grading_interface
,
course_id
=
course_id
)
...
...
lms/djangoapps/courseware/tests/__init__.py
View file @
e10577d6
...
...
@@ -86,7 +86,7 @@ class BaseTestXmodule(ModuleStoreTestCase):
data
=
self
.
DATA
)
self
.
runtime
=
get_test_system
()
self
.
runtime
=
get_test_system
(
course_id
=
'MITx/999/Robot_Super_Course'
)
# Allow us to assert that the template was called in the same way from
# different code paths while maintaining the type returned by render_template
self
.
runtime
.
render_template
=
lambda
template
,
context
:
u'{!r}, {!r}'
.
format
(
template
,
sorted
(
context
.
items
()))
...
...
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