diff --git a/djangoapps/courseware/module_render.py b/djangoapps/courseware/module_render.py index 8273d903d0..0abf14af5f 100644 --- a/djangoapps/courseware/module_render.py +++ b/djangoapps/courseware/module_render.py @@ -78,7 +78,7 @@ def render_x_module(user, request, xml_module, module_object_preload): state = smod.state # Create a new instance - ajax_url = '/modx/'+module_type+'/'+module_id+'/' + ajax_url = settings.MITX_ROOT_URL + '/modx/'+module_type+'/'+module_id+'/' system = I4xSystem(track_function = make_track_function(request), render_function = lambda x: render_module(user, request, x, module_object_preload), ajax_url = ajax_url, @@ -102,6 +102,8 @@ def render_x_module(user, request, xml_module, module_object_preload): content = instance.get_html() init_js = instance.get_init_js() destory_js = instance.get_destroy_js() + + # special extra information about each problem, only for users who are staff if user.is_staff: histogram = grade_histogram(module_id) render_histogram = len(histogram) > 0 diff --git a/djangoapps/courseware/views.py b/djangoapps/courseware/views.py index 7770b6359e..b86409feb6 100644 --- a/djangoapps/courseware/views.py +++ b/djangoapps/courseware/views.py @@ -204,7 +204,7 @@ def modx_dispatch(request, module=None, dispatch=None, id=None): dispatch=dispatch.split('?')[0] - ajax_url = '/modx/'+module+'/'+id+'/' + ajax_url = settings.MITX_ROOT_URL + '/modx/'+module+'/'+id+'/' # Grab the XML corresponding to the request from course.xml xml = content_parser.module_xml(request.user, module, 'id', id) diff --git a/lib/mitxmako/shortcuts.py b/lib/mitxmako/shortcuts.py index ca626b5c85..432acbcba9 100644 --- a/lib/mitxmako/shortcuts.py +++ b/lib/mitxmako/shortcuts.py @@ -27,6 +27,7 @@ def render_to_string(template_name, dictionary, context=None, namespace='main'): # collapse context_instance to a single dictionary for mako context_dictionary = {} context_instance['settings'] = settings + context_instance['MITX_ROOT_URL'] = settings.MITX_ROOT_URL for d in mitxmako.middleware.requestcontext: context_dictionary.update(d) for d in context_instance: diff --git a/settings.py b/settings.py index 6f59f7b27c..ea4e90b4a9 100644 --- a/settings.py +++ b/settings.py @@ -5,6 +5,14 @@ import tempfile import djcelery +MITX_ROOT_URL = '' + +COURSE_NAME = "6.002_Spring_2012" +COURSE_NUMBER = "6.002x" +COURSE_TITLE = "Circuits and Electronics" + +ROOT_URLCONF = 'urls' + # from settings2.askbotsettings import LIVESETTINGS_OPTIONS DEFAULT_GROUPS = [] diff --git a/templates/main.html b/templates/main.html index ddaed79677..014248bcd6 100644 --- a/templates/main.html +++ b/templates/main.html @@ -87,7 +87,7 @@