Commit 405b266f by Jonathan Piacenti

Addressed notes.

parent a6ae44a0
......@@ -44,8 +44,8 @@ def path_to_location(modulestore, usage_key):
If no path exists, return None.
If a path exists, return it as a list with target location first, and
the starting location last.
If a path exists, return it as a tuple with root location first, and
the target location last.
'''
# Standard DFS
......
......@@ -1138,7 +1138,7 @@ class TestIndexView(ModuleStoreTestCase):
@XBlock.register_temp_plugin(ViewCheckerBlock, 'view_checker')
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_student_state(self, default_store, ):
def test_student_state(self, default_store):
"""
Verify that saved student state is loaded for xblocks rendered in the index view.
"""
......@@ -1206,6 +1206,7 @@ class TestIndexView(ModuleStoreTestCase):
response = views.index(request, unicode(course.id), chapter=chapter.url_name, section=section.url_name)
self.assertIn("Activate Block ID: test_block_id", response.content)
class TestRenderXBlock(RenderXBlockTestMixin, ModuleStoreTestCase):
"""
Tests for the courseware.render_xblock endpoint.
......
"""
Module to define url helpers functions
"""
from urllib import urlencode
from xmodule.modulestore.search import path_to_location, navigation_index
from xmodule.modulestore.django import modulestore
from django.core.urlresolvers import reverse
......@@ -47,7 +48,6 @@ def get_redirect_url(course_key, usage_key):
args=(unicode(course_key), chapter, section, navigation_index(position))
)
if final_target_id:
redirect_url += "?activate_block_id={final_target_id}".format(final_target_id=final_target_id)
redirect_url += "?{}".format(urlencode({'activate_block_id': unicode(final_target_id)}))
return redirect_url
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment