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
658810a9
Commit
658810a9
authored
Oct 04, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use xblock render shortcuts
parent
d785b1e2
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
75 additions
and
72 deletions
+75
-72
cms/djangoapps/contentstore/views/preview.py
+2
-2
common/lib/xmodule/xmodule/conditional_module.py
+1
-1
common/lib/xmodule/xmodule/crowdsource_hinter.py
+1
-1
common/lib/xmodule/xmodule/randomize_module.py
+1
-1
common/lib/xmodule/xmodule/seq_module.py
+1
-1
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
+27
-27
common/lib/xmodule/xmodule/tests/test_conditional.py
+5
-2
common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py
+3
-3
common/lib/xmodule/xmodule/tests/test_error_module.py
+4
-4
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
+4
-4
common/lib/xmodule/xmodule/timelimit_module.py
+1
-1
common/lib/xmodule/xmodule/vertical_module.py
+1
-1
common/lib/xmodule/xmodule/x_module.py
+3
-3
lms/djangoapps/courseware/courses.py
+2
-2
lms/djangoapps/courseware/tabs.py
+1
-1
lms/djangoapps/courseware/tests/test_lti.py
+1
-1
lms/djangoapps/courseware/tests/test_module_render.py
+8
-8
lms/djangoapps/courseware/tests/test_timelimit_module.py
+2
-2
lms/djangoapps/courseware/tests/test_video_mongo.py
+2
-2
lms/djangoapps/courseware/tests/test_video_xml.py
+1
-1
lms/djangoapps/courseware/tests/test_word_cloud.py
+1
-1
lms/djangoapps/courseware/views.py
+1
-1
lms/djangoapps/instructor/views/legacy.py
+1
-1
requirements/edx/github.txt
+1
-1
No files found.
cms/djangoapps/contentstore/views/preview.py
View file @
658810a9
...
@@ -81,7 +81,7 @@ def preview_component(request, location):
...
@@ -81,7 +81,7 @@ def preview_component(request, location):
return
render_to_response
(
'component.html'
,
{
return
render_to_response
(
'component.html'
,
{
'preview'
:
get_preview_html
(
request
,
component
,
0
),
'preview'
:
get_preview_html
(
request
,
component
,
0
),
'editor'
:
component
.
r
untime
.
render
(
component
,
None
,
'studio_view'
)
.
content
,
'editor'
:
component
.
r
ender
(
'studio_view'
)
.
content
,
})
})
...
@@ -157,4 +157,4 @@ def get_preview_html(request, descriptor, idx):
...
@@ -157,4 +157,4 @@ def get_preview_html(request, descriptor, idx):
specified by the descriptor and idx.
specified by the descriptor and idx.
"""
"""
module
=
load_preview_module
(
request
,
str
(
idx
),
descriptor
)
module
=
load_preview_module
(
request
,
str
(
idx
),
descriptor
)
return
module
.
r
untime
.
render
(
module
,
None
,
"student_view"
)
.
content
return
module
.
r
ender
(
"student_view"
)
.
content
common/lib/xmodule/xmodule/conditional_module.py
View file @
658810a9
...
@@ -149,7 +149,7 @@ class ConditionalModule(ConditionalFields, XModule):
...
@@ -149,7 +149,7 @@ class ConditionalModule(ConditionalFields, XModule):
context
)
context
)
return
json
.
dumps
({
'html'
:
[
html
],
'message'
:
bool
(
message
)})
return
json
.
dumps
({
'html'
:
[
html
],
'message'
:
bool
(
message
)})
html
=
[
self
.
runtime
.
render_child
(
child
,
None
,
'student_view'
)
.
content
for
child
in
self
.
get_display_items
()]
html
=
[
child
.
render
(
'student_view'
)
.
content
for
child
in
self
.
get_display_items
()]
return
json
.
dumps
({
'html'
:
html
})
return
json
.
dumps
({
'html'
:
html
})
...
...
common/lib/xmodule/xmodule/crowdsource_hinter.py
View file @
658810a9
...
@@ -113,7 +113,7 @@ class CrowdsourceHinterModule(CrowdsourceHinterFields, XModule):
...
@@ -113,7 +113,7 @@ class CrowdsourceHinterModule(CrowdsourceHinterFields, XModule):
try
:
try
:
child
=
self
.
get_display_items
()[
0
]
child
=
self
.
get_display_items
()[
0
]
out
=
self
.
runtime
.
render_child
(
child
,
None
,
'student_view'
)
.
content
out
=
child
.
render
(
'student_view'
)
.
content
# The event listener uses the ajax url to find the child.
# The event listener uses the ajax url to find the child.
child_id
=
child
.
id
child_id
=
child
.
id
except
IndexError
:
except
IndexError
:
...
...
common/lib/xmodule/xmodule/randomize_module.py
View file @
658810a9
...
@@ -82,7 +82,7 @@ class RandomizeModule(RandomizeFields, XModule):
...
@@ -82,7 +82,7 @@ class RandomizeModule(RandomizeFields, XModule):
# raise error instead? In fact, could complain on descriptor load...
# raise error instead? In fact, could complain on descriptor load...
return
u"<div>Nothing to randomize between</div>"
return
u"<div>Nothing to randomize between</div>"
return
self
.
runtime
.
render_child
(
self
.
child
,
None
,
'student_view'
)
.
content
return
self
.
child
.
render
(
'student_view'
)
.
content
def
get_icon_class
(
self
):
def
get_icon_class
(
self
):
return
self
.
child
.
get_icon_class
()
if
self
.
child
else
'other'
return
self
.
child
.
get_icon_class
()
if
self
.
child
else
'other'
...
...
common/lib/xmodule/xmodule/seq_module.py
View file @
658810a9
...
@@ -79,7 +79,7 @@ class SequenceModule(SequenceFields, XModule):
...
@@ -79,7 +79,7 @@ class SequenceModule(SequenceFields, XModule):
for
child
in
self
.
get_display_items
():
for
child
in
self
.
get_display_items
():
progress
=
child
.
get_progress
()
progress
=
child
.
get_progress
()
childinfo
=
{
childinfo
=
{
'content'
:
self
.
runtime
.
render_child
(
child
,
None
,
'student_view'
)
.
content
,
'content'
:
child
.
render
(
'student_view'
)
.
content
,
'title'
:
"
\n
"
.
join
(
'title'
:
"
\n
"
.
join
(
grand_child
.
display_name
grand_child
.
display_name
for
grand_child
in
child
.
get_children
()
for
grand_child
in
child
.
get_children
()
...
...
common/lib/xmodule/xmodule/tests/test_combined_open_ended.py
View file @
658810a9
...
@@ -519,7 +519,7 @@ class CombinedOpenEndedModuleTest(unittest.TestCase):
...
@@ -519,7 +519,7 @@ class CombinedOpenEndedModuleTest(unittest.TestCase):
"""
"""
See if we can get the max score from the actual xmodule
See if we can get the max score from the actual xmodule
"""
"""
#The progress view requires that this function be exposed
#
The progress view requires that this function be exposed
max_score
=
self
.
combinedoe_container
.
max_score
()
max_score
=
self
.
combinedoe_container
.
max_score
()
self
.
assertEqual
(
max_score
,
None
)
self
.
assertEqual
(
max_score
,
None
)
...
@@ -751,7 +751,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -751,7 +751,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
assessment
=
[
0
,
1
]
assessment
=
[
0
,
1
]
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
#Simulate a student saving an answer
#
Simulate a student saving an answer
html
=
module
.
handle_ajax
(
"get_html"
,
{})
html
=
module
.
handle_ajax
(
"get_html"
,
{})
module
.
save
()
module
.
save
()
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
...
@@ -759,7 +759,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -759,7 +759,7 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
html
=
module
.
handle_ajax
(
"get_html"
,
{})
html
=
module
.
handle_ajax
(
"get_html"
,
{})
module
.
save
()
module
.
save
()
#Mock a student submitting an assessment
#
Mock a student submitting an assessment
assessment_dict
=
MockQueryDict
()
assessment_dict
=
MockQueryDict
()
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
...
@@ -769,12 +769,12 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -769,12 +769,12 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
save
()
module
.
save
()
#Move to the next step in the problem
#
Move to the next step in the problem
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
save
()
module
.
save
()
self
.
assertEqual
(
module
.
current_task_number
,
0
)
self
.
assertEqual
(
module
.
current_task_number
,
0
)
html
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
.
content
html
=
module
.
r
ender
(
'student_view'
)
.
content
self
.
assertIsInstance
(
html
,
basestring
)
self
.
assertIsInstance
(
html
,
basestring
)
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
...
@@ -792,17 +792,17 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -792,17 +792,17 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
@return:
@return:
"""
"""
assessment
=
[
1
,
1
]
assessment
=
[
1
,
1
]
#Load the module
#
Load the module
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
#Simulate a student saving an answer
#
Simulate a student saving an answer
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
module
.
save
()
module
.
save
()
status
=
module
.
handle_ajax
(
"get_status"
,
{})
status
=
module
.
handle_ajax
(
"get_status"
,
{})
module
.
save
()
module
.
save
()
self
.
assertIsInstance
(
status
,
basestring
)
self
.
assertIsInstance
(
status
,
basestring
)
#Mock a student submitting an assessment
#
Mock a student submitting an assessment
assessment_dict
=
MockQueryDict
()
assessment_dict
=
MockQueryDict
()
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
...
@@ -810,25 +810,25 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -810,25 +810,25 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
self
.
assertEqual
(
json
.
loads
(
task_one_json
[
'child_history'
][
0
][
'post_assessment'
]),
assessment
)
self
.
assertEqual
(
json
.
loads
(
task_one_json
[
'child_history'
][
0
][
'post_assessment'
]),
assessment
)
#Move to the next step in the problem
#
Move to the next step in the problem
try
:
try
:
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
save
()
module
.
save
()
except
GradingServiceError
:
except
GradingServiceError
:
#This error is okay. We don't have a grading service to connect to!
#
This error is okay. We don't have a grading service to connect to!
pass
pass
self
.
assertEqual
(
module
.
current_task_number
,
1
)
self
.
assertEqual
(
module
.
current_task_number
,
1
)
try
:
try
:
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
module
.
r
ender
(
'student_view'
)
except
GradingServiceError
:
except
GradingServiceError
:
#This error is okay. We don't have a grading service to connect to!
#
This error is okay. We don't have a grading service to connect to!
pass
pass
#Try to get the rubric from the module
#
Try to get the rubric from the module
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
save
()
module
.
save
()
#Make a fake reply from the queue
#
Make a fake reply from the queue
queue_reply
=
{
queue_reply
=
{
'queuekey'
:
""
,
'queuekey'
:
""
,
'xqueue_body'
:
json
.
dumps
({
'xqueue_body'
:
json
.
dumps
({
...
@@ -847,23 +847,23 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
...
@@ -847,23 +847,23 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
module
.
handle_ajax
(
"check_for_score"
,
{})
module
.
handle_ajax
(
"check_for_score"
,
{})
module
.
save
()
module
.
save
()
#Update the module with the fake queue reply
#
Update the module with the fake queue reply
module
.
handle_ajax
(
"score_update"
,
queue_reply
)
module
.
handle_ajax
(
"score_update"
,
queue_reply
)
module
.
save
()
module
.
save
()
self
.
assertFalse
(
module
.
ready_to_reset
)
self
.
assertFalse
(
module
.
ready_to_reset
)
self
.
assertEqual
(
module
.
current_task_number
,
1
)
self
.
assertEqual
(
module
.
current_task_number
,
1
)
#Get html and other data client will request
#
Get html and other data client will request
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
module
.
r
ender
(
'student_view'
)
module
.
handle_ajax
(
"skip_post_assessment"
,
{})
module
.
handle_ajax
(
"skip_post_assessment"
,
{})
module
.
save
()
module
.
save
()
#Get all results
#
Get all results
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
save
()
module
.
save
()
#reset the problem
#
reset the problem
module
.
handle_ajax
(
"reset"
,
{})
module
.
handle_ajax
(
"reset"
,
{})
module
.
save
()
module
.
save
()
self
.
assertEqual
(
module
.
state
,
"initial"
)
self
.
assertEqual
(
module
.
state
,
"initial"
)
...
@@ -896,11 +896,11 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore):
...
@@ -896,11 +896,11 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore):
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
.
save
()
module
.
save
()
#Simulate a student saving an answer
#
Simulate a student saving an answer
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer
})
module
.
save
()
module
.
save
()
#Mock a student submitting an assessment
#
Mock a student submitting an assessment
assessment_dict
=
MockQueryDict
()
assessment_dict
=
MockQueryDict
()
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
assessment_dict
.
update
({
'assessment'
:
sum
(
assessment
),
'score_list[]'
:
assessment
})
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
module
.
handle_ajax
(
"save_assessment"
,
assessment_dict
)
...
@@ -908,21 +908,21 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore):
...
@@ -908,21 +908,21 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore):
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
task_one_json
=
json
.
loads
(
module
.
task_states
[
0
])
self
.
assertEqual
(
json
.
loads
(
task_one_json
[
'child_history'
][
0
][
'post_assessment'
]),
assessment
)
self
.
assertEqual
(
json
.
loads
(
task_one_json
[
'child_history'
][
0
][
'post_assessment'
]),
assessment
)
#Move to the next step in the problem
#
Move to the next step in the problem
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
handle_ajax
(
"next_problem"
,
{})
module
.
save
()
module
.
save
()
self
.
assertEqual
(
module
.
current_task_number
,
0
)
self
.
assertEqual
(
module
.
current_task_number
,
0
)
html
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
.
content
html
=
module
.
r
ender
(
'student_view'
)
.
content
self
.
assertIsInstance
(
html
,
basestring
)
self
.
assertIsInstance
(
html
,
basestring
)
#Module should now be done
#
Module should now be done
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
rubric
=
module
.
handle_ajax
(
"get_combined_rubric"
,
{})
module
.
save
()
module
.
save
()
self
.
assertIsInstance
(
rubric
,
basestring
)
self
.
assertIsInstance
(
rubric
,
basestring
)
self
.
assertEqual
(
module
.
state
,
"done"
)
self
.
assertEqual
(
module
.
state
,
"done"
)
#Try to reset, should fail because only 1 attempt is allowed
#
Try to reset, should fail because only 1 attempt is allowed
reset_data
=
json
.
loads
(
module
.
handle_ajax
(
"reset"
,
{}))
reset_data
=
json
.
loads
(
module
.
handle_ajax
(
"reset"
,
{}))
module
.
save
()
module
.
save
()
self
.
assertEqual
(
reset_data
[
'success'
],
False
)
self
.
assertEqual
(
reset_data
[
'success'
],
False
)
...
@@ -953,7 +953,7 @@ class OpenEndedModuleXmlImageUploadTest(unittest.TestCase, DummyModulestore):
...
@@ -953,7 +953,7 @@ class OpenEndedModuleXmlImageUploadTest(unittest.TestCase, DummyModulestore):
"""
"""
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
#Simulate a student saving an answer
#
Simulate a student saving an answer
response
=
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer_text
})
response
=
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer_text
})
response
=
json
.
loads
(
response
)
response
=
json
.
loads
(
response
)
self
.
assertFalse
(
response
[
'success'
])
self
.
assertFalse
(
response
[
'success'
])
...
@@ -973,7 +973,7 @@ class OpenEndedModuleXmlImageUploadTest(unittest.TestCase, DummyModulestore):
...
@@ -973,7 +973,7 @@ class OpenEndedModuleXmlImageUploadTest(unittest.TestCase, DummyModulestore):
"""
"""
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
module
=
self
.
get_module_from_location
(
self
.
problem_location
,
COURSE
)
#Simulate a student saving an answer with a file
#
Simulate a student saving an answer with a file
response
=
module
.
handle_ajax
(
"save_answer"
,
{
response
=
module
.
handle_ajax
(
"save_answer"
,
{
"student_answer"
:
self
.
answer_text
,
"student_answer"
:
self
.
answer_text
,
"valid_files_attached"
:
True
,
"valid_files_attached"
:
True
,
...
...
common/lib/xmodule/xmodule/tests/test_conditional.py
View file @
658810a9
...
@@ -70,13 +70,16 @@ class ConditionalFactory(object):
...
@@ -70,13 +70,16 @@ class ConditionalFactory(object):
source_descriptor
.
location
=
source_location
source_descriptor
.
location
=
source_location
source_descriptor
.
runtime
=
descriptor_system
source_descriptor
.
runtime
=
descriptor_system
source_descriptor
.
render
=
lambda
view
,
context
=
None
:
descriptor_system
.
render
(
source_descriptor
,
view
,
context
)
# construct other descriptors:
# construct other descriptors:
child_descriptor
=
Mock
()
child_descriptor
=
Mock
()
child_descriptor
.
_xmodule
.
student_view
.
return_value
.
content
=
u'<p>This is a secret</p>'
child_descriptor
.
_xmodule
.
student_view
.
return_value
.
content
=
u'<p>This is a secret</p>'
child_descriptor
.
student_view
=
child_descriptor
.
_xmodule
.
student_view
child_descriptor
.
displayable_items
.
return_value
=
[
child_descriptor
]
child_descriptor
.
displayable_items
.
return_value
=
[
child_descriptor
]
child_descriptor
.
runtime
=
descriptor_system
child_descriptor
.
runtime
=
descriptor_system
child_descriptor
.
xmodule_runtime
=
get_test_system
()
child_descriptor
.
xmodule_runtime
=
get_test_system
()
child_descriptor
.
render
=
lambda
view
,
context
=
None
:
descriptor_system
.
render
(
child_descriptor
,
view
,
context
)
descriptor_system
.
load_item
=
{
'child'
:
child_descriptor
,
'source'
:
source_descriptor
}
.
get
descriptor_system
.
load_item
=
{
'child'
:
child_descriptor
,
'source'
:
source_descriptor
}
.
get
...
@@ -125,7 +128,7 @@ class ConditionalModuleBasicTest(unittest.TestCase):
...
@@ -125,7 +128,7 @@ class ConditionalModuleBasicTest(unittest.TestCase):
modules
=
ConditionalFactory
.
create
(
self
.
test_system
)
modules
=
ConditionalFactory
.
create
(
self
.
test_system
)
# because get_test_system returns the repr of the context dict passed to render_template,
# because get_test_system returns the repr of the context dict passed to render_template,
# we reverse it here
# we reverse it here
html
=
modules
[
'cond_module'
]
.
r
untime
.
render
(
modules
[
'cond_module'
],
None
,
'student_view'
)
.
content
html
=
modules
[
'cond_module'
]
.
r
ender
(
'student_view'
)
.
content
expected
=
modules
[
'cond_module'
]
.
xmodule_runtime
.
render_template
(
'conditional_ajax.html'
,
{
expected
=
modules
[
'cond_module'
]
.
xmodule_runtime
.
render_template
(
'conditional_ajax.html'
,
{
'ajax_url'
:
modules
[
'cond_module'
]
.
xmodule_runtime
.
ajax_url
,
'ajax_url'
:
modules
[
'cond_module'
]
.
xmodule_runtime
.
ajax_url
,
'element_id'
:
'i4x-edX-conditional_test-conditional-SampleConditional'
,
'element_id'
:
'i4x-edX-conditional_test-conditional-SampleConditional'
,
...
@@ -216,7 +219,7 @@ class ConditionalModuleXmlTest(unittest.TestCase):
...
@@ -216,7 +219,7 @@ class ConditionalModuleXmlTest(unittest.TestCase):
print
"module children: "
,
module
.
get_children
()
print
"module children: "
,
module
.
get_children
()
print
"module display items (children): "
,
module
.
get_display_items
()
print
"module display items (children): "
,
module
.
get_display_items
()
html
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
.
content
html
=
module
.
r
ender
(
'student_view'
)
.
content
print
"html type: "
,
type
(
html
)
print
"html type: "
,
type
(
html
)
print
"html: "
,
html
print
"html: "
,
html
html_expect
=
module
.
xmodule_runtime
.
render_template
(
html_expect
=
module
.
xmodule_runtime
.
render_template
(
...
...
common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py
View file @
658810a9
...
@@ -243,7 +243,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
...
@@ -243,7 +243,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
"""
"""
return
[
FakeChild
()]
return
[
FakeChild
()]
mock_module
.
get_display_items
=
fake_get_display_items
mock_module
.
get_display_items
=
fake_get_display_items
out_html
=
mock_module
.
r
untime
.
render
(
mock_module
,
None
,
'student_view'
)
.
content
out_html
=
mock_module
.
r
ender
(
'student_view'
)
.
content
self
.
assertTrue
(
'This is supposed to be test html.'
in
out_html
)
self
.
assertTrue
(
'This is supposed to be test html.'
in
out_html
)
self
.
assertTrue
(
'i4x://this/is/a/fake/id'
in
out_html
)
self
.
assertTrue
(
'i4x://this/is/a/fake/id'
in
out_html
)
...
@@ -260,7 +260,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
...
@@ -260,7 +260,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
"""
"""
return
[]
return
[]
mock_module
.
get_display_items
=
fake_get_display_items
mock_module
.
get_display_items
=
fake_get_display_items
out_html
=
mock_module
.
r
untime
.
render
(
mock_module
,
None
,
'student_view'
)
.
content
out_html
=
mock_module
.
r
ender
(
'student_view'
)
.
content
self
.
assertTrue
(
'Error in loading crowdsourced hinter'
in
out_html
)
self
.
assertTrue
(
'Error in loading crowdsourced hinter'
in
out_html
)
@unittest.skip
(
"Needs to be finished."
)
@unittest.skip
(
"Needs to be finished."
)
...
@@ -271,7 +271,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
...
@@ -271,7 +271,7 @@ class CrowdsourceHinterTest(unittest.TestCase):
NOT WORKING RIGHT NOW
NOT WORKING RIGHT NOW
"""
"""
mock_module
=
VerticalWithModulesFactory
.
create
()
mock_module
=
VerticalWithModulesFactory
.
create
()
out_html
=
mock_module
.
r
untime
.
render
(
mock_module
,
None
,
'student_view'
)
.
content
out_html
=
mock_module
.
r
ender
(
'student_view'
)
.
content
self
.
assertTrue
(
'Test numerical problem.'
in
out_html
)
self
.
assertTrue
(
'Test numerical problem.'
in
out_html
)
self
.
assertTrue
(
'Another test numerical problem.'
in
out_html
)
self
.
assertTrue
(
'Another test numerical problem.'
in
out_html
)
...
...
common/lib/xmodule/xmodule/tests/test_error_module.py
View file @
658810a9
...
@@ -31,7 +31,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
...
@@ -31,7 +31,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
,
self
.
error_msg
)
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
,
self
.
error_msg
)
self
.
assertIsInstance
(
descriptor
,
error_module
.
ErrorDescriptor
)
self
.
assertIsInstance
(
descriptor
,
error_module
.
ErrorDescriptor
)
descriptor
.
xmodule_runtime
=
self
.
system
descriptor
.
xmodule_runtime
=
self
.
system
context_repr
=
self
.
system
.
render
(
descriptor
,
None
,
'student_view'
)
.
content
context_repr
=
self
.
system
.
render
(
descriptor
,
'student_view'
)
.
content
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
self
.
assertIn
(
repr
(
self
.
valid_xml
),
context_repr
)
self
.
assertIn
(
repr
(
self
.
valid_xml
),
context_repr
)
...
@@ -45,7 +45,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
...
@@ -45,7 +45,7 @@ class TestErrorModule(unittest.TestCase, SetupTestErrorModules):
descriptor
,
self
.
error_msg
)
descriptor
,
self
.
error_msg
)
self
.
assertIsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
self
.
assertIsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
error_descriptor
.
xmodule_runtime
=
self
.
system
error_descriptor
.
xmodule_runtime
=
self
.
system
context_repr
=
self
.
system
.
render
(
error_descriptor
,
None
,
'student_view'
)
.
content
context_repr
=
self
.
system
.
render
(
error_descriptor
,
'student_view'
)
.
content
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
self
.
assertIn
(
self
.
error_msg
,
context_repr
)
self
.
assertIn
(
repr
(
descriptor
),
context_repr
)
self
.
assertIn
(
repr
(
descriptor
),
context_repr
)
...
@@ -66,7 +66,7 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
...
@@ -66,7 +66,7 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
descriptor
=
error_module
.
NonStaffErrorDescriptor
.
from_xml
(
descriptor
=
error_module
.
NonStaffErrorDescriptor
.
from_xml
(
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
)
self
.
valid_xml
,
self
.
system
,
self
.
org
,
self
.
course
)
descriptor
.
xmodule_runtime
=
self
.
system
descriptor
.
xmodule_runtime
=
self
.
system
context_repr
=
self
.
system
.
render
(
descriptor
,
None
,
'student_view'
)
.
content
context_repr
=
self
.
system
.
render
(
descriptor
,
'student_view'
)
.
content
self
.
assertNotIn
(
self
.
error_msg
,
context_repr
)
self
.
assertNotIn
(
self
.
error_msg
,
context_repr
)
self
.
assertNotIn
(
repr
(
self
.
valid_xml
),
context_repr
)
self
.
assertNotIn
(
repr
(
self
.
valid_xml
),
context_repr
)
...
@@ -80,6 +80,6 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
...
@@ -80,6 +80,6 @@ class TestNonStaffErrorModule(unittest.TestCase, SetupTestErrorModules):
descriptor
,
self
.
error_msg
)
descriptor
,
self
.
error_msg
)
self
.
assertIsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
self
.
assertIsInstance
(
error_descriptor
,
error_module
.
ErrorDescriptor
)
error_descriptor
.
xmodule_runtime
=
self
.
system
error_descriptor
.
xmodule_runtime
=
self
.
system
context_repr
=
self
.
system
.
render
(
error_descriptor
,
None
,
'student_view'
)
.
content
context_repr
=
self
.
system
.
render
(
error_descriptor
,
'student_view'
)
.
content
self
.
assertNotIn
(
self
.
error_msg
,
context_repr
)
self
.
assertNotIn
(
self
.
error_msg
,
context_repr
)
self
.
assertNotIn
(
str
(
descriptor
),
context_repr
)
self
.
assertNotIn
(
str
(
descriptor
),
context_repr
)
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
View file @
658810a9
...
@@ -146,7 +146,7 @@ class TestStudentView(TestXBlockWrapper):
...
@@ -146,7 +146,7 @@ class TestStudentView(TestXBlockWrapper):
descriptor
=
self
.
leaf_module
(
descriptor_cls
)
descriptor
=
self
.
leaf_module
(
descriptor_cls
)
assert_equal
(
assert_equal
(
descriptor
.
_xmodule
.
get_html
(),
descriptor
.
_xmodule
.
get_html
(),
descriptor
.
r
untime
.
render
(
descriptor
,
None
,
'student_view'
)
.
content
descriptor
.
r
ender
(
'student_view'
)
.
content
)
)
# Test that for all container XModule Descriptors,
# Test that for all container XModule Descriptors,
...
@@ -168,7 +168,7 @@ class TestStudentView(TestXBlockWrapper):
...
@@ -168,7 +168,7 @@ class TestStudentView(TestXBlockWrapper):
descriptor
=
self
.
container_module
(
descriptor_cls
,
2
)
descriptor
=
self
.
container_module
(
descriptor_cls
,
2
)
assert_equal
(
assert_equal
(
descriptor
.
_xmodule
.
get_html
(),
descriptor
.
_xmodule
.
get_html
(),
descriptor
.
r
untime
.
render
(
descriptor
,
None
,
'student_view'
)
.
content
descriptor
.
r
ender
(
'student_view'
)
.
content
)
)
# Check that when an xmodule is generated from descriptor_cls
# Check that when an xmodule is generated from descriptor_cls
...
@@ -200,7 +200,7 @@ class TestStudioView(TestXBlockWrapper):
...
@@ -200,7 +200,7 @@ class TestStudioView(TestXBlockWrapper):
raise
SkipTest
(
descriptor_cls
.
__name__
+
"is not editable in studio"
)
raise
SkipTest
(
descriptor_cls
.
__name__
+
"is not editable in studio"
)
descriptor
=
self
.
leaf_descriptor
(
descriptor_cls
)
descriptor
=
self
.
leaf_descriptor
(
descriptor_cls
)
assert_equal
(
descriptor
.
get_html
(),
descriptor
.
r
untime
.
render
(
descriptor
,
None
,
'studio_view'
)
.
content
)
assert_equal
(
descriptor
.
get_html
(),
descriptor
.
r
ender
(
'studio_view'
)
.
content
)
# Test that for all of the Descriptors listed in CONTAINER_XMODULES
# Test that for all of the Descriptors listed in CONTAINER_XMODULES
...
@@ -223,7 +223,7 @@ class TestStudioView(TestXBlockWrapper):
...
@@ -223,7 +223,7 @@ class TestStudioView(TestXBlockWrapper):
raise
SkipTest
(
descriptor_cls
.
__name__
+
"is not editable in studio"
)
raise
SkipTest
(
descriptor_cls
.
__name__
+
"is not editable in studio"
)
descriptor
=
self
.
container_descriptor
(
descriptor_cls
,
2
)
descriptor
=
self
.
container_descriptor
(
descriptor_cls
,
2
)
assert_equal
(
descriptor
.
get_html
(),
descriptor
.
r
untime
.
render
(
descriptor
,
None
,
'studio_view'
)
.
content
)
assert_equal
(
descriptor
.
get_html
(),
descriptor
.
r
ender
(
'studio_view'
)
.
content
)
# Check that when a descriptor is generated from descriptor_cls
# Check that when a descriptor is generated from descriptor_cls
# with mixed xmodule and xblock children, it generates the same html from studio_view
# with mixed xmodule and xblock children, it generates the same html from studio_view
...
...
common/lib/xmodule/xmodule/timelimit_module.py
View file @
658810a9
...
@@ -89,7 +89,7 @@ class TimeLimitModule(TimeLimitFields, XModule):
...
@@ -89,7 +89,7 @@ class TimeLimitModule(TimeLimitFields, XModule):
children
=
self
.
get_display_items
()
children
=
self
.
get_display_items
()
if
children
:
if
children
:
child
=
children
[
0
]
child
=
children
[
0
]
return
self
.
runtime
.
render_child
(
child
,
None
,
'student_view'
)
.
content
return
child
.
render
(
'student_view'
)
.
content
else
:
else
:
return
u""
return
u""
...
...
common/lib/xmodule/xmodule/vertical_module.py
View file @
658810a9
...
@@ -23,7 +23,7 @@ class VerticalModule(VerticalFields, XModule):
...
@@ -23,7 +23,7 @@ class VerticalModule(VerticalFields, XModule):
if
self
.
contents
is
None
:
if
self
.
contents
is
None
:
self
.
contents
=
[{
self
.
contents
=
[{
'id'
:
child
.
id
,
'id'
:
child
.
id
,
'content'
:
self
.
runtime
.
render_child
(
child
,
None
,
'student_view'
)
.
content
'content'
:
child
.
render
(
'student_view'
)
.
content
}
for
child
in
self
.
get_display_items
()]
}
for
child
in
self
.
get_display_items
()]
return
self
.
system
.
render_template
(
'vert_module.html'
,
{
return
self
.
system
.
render_template
(
'vert_module.html'
,
{
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
658810a9
...
@@ -861,12 +861,12 @@ class DescriptorSystem(ConfigurableFragmentWrapper, Runtime): # pylint: disable
...
@@ -861,12 +861,12 @@ class DescriptorSystem(ConfigurableFragmentWrapper, Runtime): # pylint: disable
result
[
'default_value'
]
=
field
.
to_json
(
field
.
default
)
result
[
'default_value'
]
=
field
.
to_json
(
field
.
default
)
return
result
return
result
def
render
(
self
,
block
,
context
,
view_nam
e
):
def
render
(
self
,
block
,
view_name
,
context
=
Non
e
):
if
isinstance
(
block
,
(
XModule
,
XModuleDescriptor
))
and
view_name
==
'student_view'
:
if
isinstance
(
block
,
(
XModule
,
XModuleDescriptor
))
and
view_name
==
'student_view'
:
assert
block
.
xmodule_runtime
is
not
None
assert
block
.
xmodule_runtime
is
not
None
return
block
.
xmodule_runtime
.
render
(
block
.
_xmodule
,
context
,
view_name
)
return
block
.
xmodule_runtime
.
render
(
block
.
_xmodule
,
view_name
,
context
)
else
:
else
:
return
super
(
DescriptorSystem
,
self
)
.
render
(
block
,
context
,
view_name
)
return
super
(
DescriptorSystem
,
self
)
.
render
(
block
,
view_name
,
context
)
class
XMLParsingSystem
(
DescriptorSystem
):
class
XMLParsingSystem
(
DescriptorSystem
):
...
...
lms/djangoapps/courseware/courses.py
View file @
658810a9
...
@@ -164,7 +164,7 @@ def get_course_about_section(course, section_key):
...
@@ -164,7 +164,7 @@ def get_course_about_section(course, section_key):
html
=
''
html
=
''
if
about_module
is
not
None
:
if
about_module
is
not
None
:
html
=
about_module
.
r
untime
.
render
(
about_module
,
None
,
'student_view'
)
.
content
html
=
about_module
.
r
ender
(
'student_view'
)
.
content
return
html
return
html
...
@@ -213,7 +213,7 @@ def get_course_info_section(request, course, section_key):
...
@@ -213,7 +213,7 @@ def get_course_info_section(request, course, section_key):
html
=
''
html
=
''
if
info_module
is
not
None
:
if
info_module
is
not
None
:
html
=
info_module
.
r
untime
.
render
(
info_module
,
None
,
'student_view'
)
.
content
html
=
info_module
.
r
ender
(
'student_view'
)
.
content
return
html
return
html
...
...
lms/djangoapps/courseware/tabs.py
View file @
658810a9
...
@@ -419,6 +419,6 @@ def get_static_tab_contents(request, course, tab):
...
@@ -419,6 +419,6 @@ def get_static_tab_contents(request, course, tab):
html
=
''
html
=
''
if
tab_module
is
not
None
:
if
tab_module
is
not
None
:
html
=
tab_module
.
r
untime
.
render
(
tab_module
,
None
,
'student_view'
)
.
content
html
=
tab_module
.
r
ender
(
'student_view'
)
.
content
return
html
return
html
lms/djangoapps/courseware/tests/test_lti.py
View file @
658810a9
...
@@ -69,7 +69,7 @@ class TestLTI(BaseTestXmodule):
...
@@ -69,7 +69,7 @@ class TestLTI(BaseTestXmodule):
"""
"""
Makes sure that all parameters extracted.
Makes sure that all parameters extracted.
"""
"""
generated_context
=
self
.
item_module
.
r
untime
.
render
(
self
.
item_module
,
None
,
'student_view'
)
.
content
generated_context
=
self
.
item_module
.
r
ender
(
'student_view'
)
.
content
expected_context
=
{
expected_context
=
{
'input_fields'
:
self
.
correct_headers
,
'input_fields'
:
self
.
correct_headers
,
'element_class'
:
self
.
item_module
.
location
.
category
,
'element_class'
:
self
.
item_module
.
location
.
category
,
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
658810a9
...
@@ -74,7 +74,7 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -74,7 +74,7 @@ class ModuleRenderTestCase(ModuleStoreTestCase, LoginEnrollmentTestCase):
)
)
# get the rendered HTML output which should have the rewritten link
# get the rendered HTML output which should have the rewritten link
html
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
.
content
html
=
module
.
r
ender
(
'student_view'
)
.
content
# See if the url got rewritten to the target link
# See if the url got rewritten to the target link
# note if the URL mapping changes then this assertion will break
# note if the URL mapping changes then this assertion will break
...
@@ -297,7 +297,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -297,7 +297,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
course
.
id
,
self
.
course
.
id
,
wrap_xmodule_display
=
True
,
wrap_xmodule_display
=
True
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
'section class="xmodule_display xmodule_HtmlModule"'
,
result_fragment
.
content
)
self
.
assertIn
(
'section class="xmodule_display xmodule_HtmlModule"'
,
result_fragment
.
content
)
...
@@ -310,7 +310,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -310,7 +310,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
course
.
id
,
self
.
course
.
id
,
wrap_xmodule_display
=
False
,
wrap_xmodule_display
=
False
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertNotIn
(
'section class="xmodule_display xmodule_HtmlModule"'
,
result_fragment
.
content
)
self
.
assertNotIn
(
'section class="xmodule_display xmodule_HtmlModule"'
,
result_fragment
.
content
)
...
@@ -322,7 +322,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -322,7 +322,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
field_data_cache
,
self
.
field_data_cache
,
self
.
course
.
id
,
self
.
course
.
id
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
self
.
assertIn
(
'/c4x/{org}/{course}/asset/foo_content'
.
format
(
'/c4x/{org}/{course}/asset/foo_content'
.
format
(
...
@@ -340,7 +340,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -340,7 +340,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
field_data_cache
,
self
.
field_data_cache
,
self
.
course
.
id
,
self
.
course
.
id
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
self
.
assertIn
(
'/c4x/{org}/{course}/asset/_file.jpg'
.
format
(
'/c4x/{org}/{course}/asset/_file.jpg'
.
format
(
...
@@ -364,7 +364,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -364,7 +364,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
course
.
id
,
self
.
course
.
id
,
static_asset_path
=
"toy_course_dir"
,
static_asset_path
=
"toy_course_dir"
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
'href="/static/toy_course_dir'
,
result_fragment
.
content
)
self
.
assertIn
(
'href="/static/toy_course_dir'
,
result_fragment
.
content
)
def
test_course_image
(
self
):
def
test_course_image
(
self
):
...
@@ -390,7 +390,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -390,7 +390,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
field_data_cache
,
self
.
field_data_cache
,
self
.
course
.
id
,
self
.
course
.
id
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
self
.
assertIn
(
'/courses/{course_id}/bar/content'
.
format
(
'/courses/{course_id}/bar/content'
.
format
(
...
@@ -408,7 +408,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
...
@@ -408,7 +408,7 @@ class TestHtmlModifiers(ModuleStoreTestCase):
self
.
field_data_cache
,
self
.
field_data_cache
,
self
.
course
.
id
,
self
.
course
.
id
,
)
)
result_fragment
=
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
result_fragment
=
module
.
r
ender
(
'student_view'
)
self
.
assertIn
(
self
.
assertIn
(
'Staff Debug'
,
'Staff Debug'
,
...
...
lms/djangoapps/courseware/tests/test_timelimit_module.py
View file @
658810a9
...
@@ -20,10 +20,10 @@ class TestTimeLimitModuleRendering(XModuleRenderingTestBase):
...
@@ -20,10 +20,10 @@ class TestTimeLimitModuleRendering(XModuleRenderingTestBase):
block
.
xmodule_runtime
=
self
.
new_module_runtime
()
block
.
xmodule_runtime
=
self
.
new_module_runtime
()
ItemFactory
.
create
(
category
=
'html'
,
data
=
'<html>This is just text</html>'
,
parent
=
block
)
ItemFactory
.
create
(
category
=
'html'
,
data
=
'<html>This is just text</html>'
,
parent
=
block
)
assert_student_view
(
block
,
self
.
runtime
.
render
(
block
,
None
,
'student_view'
))
assert_student_view
(
block
,
block
.
render
(
'student_view'
))
def
test_without_children
(
self
):
def
test_without_children
(
self
):
block
=
ItemFactory
.
create
(
category
=
'timelimit'
)
block
=
ItemFactory
.
create
(
category
=
'timelimit'
)
block
.
xmodule_runtime
=
self
.
new_module_runtime
()
block
.
xmodule_runtime
=
self
.
new_module_runtime
()
assert_student_view
(
block
,
self
.
runtime
.
render
(
block
,
None
,
'student_view'
))
assert_student_view
(
block
,
block
.
render
(
'student_view'
))
lms/djangoapps/courseware/tests/test_video_mongo.py
View file @
658810a9
...
@@ -32,7 +32,7 @@ class TestVideo(BaseTestXmodule):
...
@@ -32,7 +32,7 @@ class TestVideo(BaseTestXmodule):
def
test_video_constructor
(
self
):
def
test_video_constructor
(
self
):
"""Make sure that all parameters extracted correclty from xml"""
"""Make sure that all parameters extracted correclty from xml"""
context
=
self
.
item_module
.
r
untime
.
render
(
self
.
item_module
,
None
,
'student_view'
)
.
content
context
=
self
.
item_module
.
r
ender
(
'student_view'
)
.
content
sources
=
{
sources
=
{
'main'
:
u'example.mp4'
,
'main'
:
u'example.mp4'
,
...
@@ -93,7 +93,7 @@ class TestVideoNonYouTube(TestVideo):
...
@@ -93,7 +93,7 @@ class TestVideoNonYouTube(TestVideo):
u'ogv'
:
u'example.ogv'
u'ogv'
:
u'example.ogv'
}
}
context
=
self
.
item_module
.
r
untime
.
render
(
self
.
item_module
,
None
,
'student_view'
)
.
content
context
=
self
.
item_module
.
r
ender
(
'student_view'
)
.
content
expected_context
=
{
expected_context
=
{
'data_dir'
:
getattr
(
self
,
'data_dir'
,
None
),
'data_dir'
:
getattr
(
self
,
'data_dir'
,
None
),
...
...
lms/djangoapps/courseware/tests/test_video_xml.py
View file @
658810a9
...
@@ -95,7 +95,7 @@ class VideoModuleUnitTest(unittest.TestCase):
...
@@ -95,7 +95,7 @@ class VideoModuleUnitTest(unittest.TestCase):
}
}
self
.
assertEqual
(
self
.
assertEqual
(
module
.
r
untime
.
render
(
module
,
None
,
'student_view'
)
.
content
,
module
.
r
ender
(
'student_view'
)
.
content
,
module
.
runtime
.
render_template
(
'video.html'
,
expected_context
)
module
.
runtime
.
render_template
(
'video.html'
,
expected_context
)
)
)
...
...
lms/djangoapps/courseware/tests/test_word_cloud.py
View file @
658810a9
...
@@ -242,7 +242,7 @@ class TestWordCloud(BaseTestXmodule):
...
@@ -242,7 +242,7 @@ class TestWordCloud(BaseTestXmodule):
def
test_word_cloud_constructor
(
self
):
def
test_word_cloud_constructor
(
self
):
"""Make sure that all parameters extracted correclty from xml"""
"""Make sure that all parameters extracted correclty from xml"""
fragment
=
self
.
runtime
.
render
(
self
.
item_module
,
None
,
'student_view'
)
fragment
=
self
.
runtime
.
render
(
self
.
item_module
,
'student_view'
)
expected_context
=
{
expected_context
=
{
'ajax_url'
:
self
.
item_module
.
xmodule_runtime
.
ajax_url
,
'ajax_url'
:
self
.
item_module
.
xmodule_runtime
.
ajax_url
,
...
...
lms/djangoapps/courseware/views.py
View file @
658810a9
...
@@ -407,7 +407,7 @@ def index(request, course_id, chapter=None, section=None,
...
@@ -407,7 +407,7 @@ def index(request, course_id, chapter=None, section=None,
# add in the appropriate timer information to the rendering context:
# add in the appropriate timer information to the rendering context:
context
.
update
(
check_for_active_timelimit_module
(
request
,
course_id
,
course
))
context
.
update
(
check_for_active_timelimit_module
(
request
,
course_id
,
course
))
context
[
'content'
]
=
section_module
.
r
untime
.
render
(
section_module
,
None
,
'student_view'
)
.
content
context
[
'content'
]
=
section_module
.
r
ender
(
'student_view'
)
.
content
else
:
else
:
# section is none, so display a message
# section is none, so display a message
prev_section
=
get_current_child
(
chapter_module
)
prev_section
=
get_current_child
(
chapter_module
)
...
...
lms/djangoapps/instructor/views/legacy.py
View file @
658810a9
...
@@ -817,7 +817,7 @@ def instructor_dashboard(request, course_id):
...
@@ -817,7 +817,7 @@ def instructor_dashboard(request, course_id):
# HTML editor for email
# HTML editor for email
if
idash_mode
==
'Email'
and
is_studio_course
:
if
idash_mode
==
'Email'
and
is_studio_course
:
html_module
=
HtmlDescriptor
(
course
.
system
,
DictFieldData
({
'data'
:
html_message
}),
ScopeIds
(
None
,
None
,
None
,
None
))
html_module
=
HtmlDescriptor
(
course
.
system
,
DictFieldData
({
'data'
:
html_message
}),
ScopeIds
(
None
,
None
,
None
,
None
))
fragment
=
course
.
system
.
render
(
html_module
,
None
,
'studio_view'
)
fragment
=
course
.
system
.
render
(
html_module
,
'studio_view'
)
fragment
=
wrap_xmodule
(
'xmodule_edit.html'
,
html_module
,
'studio_view'
,
fragment
,
None
)
fragment
=
wrap_xmodule
(
'xmodule_edit.html'
,
html_module
,
'studio_view'
,
fragment
,
None
)
email_editor
=
fragment
.
content
email_editor
=
fragment
.
content
...
...
requirements/edx/github.txt
View file @
658810a9
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
-e git+https://github.com/eventbrite/zendesk.git@d53fe0e81b623f084e91776bcf6369f8b7b63879#egg=zendesk
-e git+https://github.com/eventbrite/zendesk.git@d53fe0e81b623f084e91776bcf6369f8b7b63879#egg=zendesk
# Our libraries:
# Our libraries:
-e git+https://github.com/edx/XBlock.git@
8a66ca3
#egg=XBlock
-e git+https://github.com/edx/XBlock.git@
cee38a15f
#egg=XBlock
-e git+https://github.com/edx/codejail.git@0a1b468#egg=codejail
-e git+https://github.com/edx/codejail.git@0a1b468#egg=codejail
-e git+https://github.com/edx/diff-cover.git@v0.2.5#egg=diff_cover
-e git+https://github.com/edx/diff-cover.git@v0.2.5#egg=diff_cover
-e git+https://github.com/edx/js-test-tool.git@v0.1.1#egg=js_test_tool
-e git+https://github.com/edx/js-test-tool.git@v0.1.1#egg=js_test_tool
...
...
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