Merged root URL prefix from Ike. Errors should be attributed to pmitros.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</li>
|
||||
<li><a href="/s/help.html">Help</a></li>
|
||||
% if user.is_authenticated():
|
||||
<li><a href="/logout">Log out</a></li>
|
||||
<li><a href="${ settings.MITX_ROOT_URL }/logout">Log out</a></li>
|
||||
% endif
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
<header>
|
||||
<hgroup>
|
||||
<h1><em>MITx</em></h1>
|
||||
<h2><a href="/courseware">Circuits and Electronics</a></h2>
|
||||
<h2><a href="${ MITX_ROOT_URL }/courseware/">${ settings.COURSE_TITLE }</a></h2>
|
||||
</hgroup>
|
||||
|
||||
<nav class="${active_page}">
|
||||
<ul class="coursenav">
|
||||
<li class="courseware"><a href="/courseware">Courseware</a></li>
|
||||
<li class="info"><a href="/info">Course Info</a></li>
|
||||
<li class="courseware"><a href="${ MITX_ROOT_URL }/courseware/">Courseware</a></li>
|
||||
<li class="info"><a href="${ MITX_ROOT_URL }/info">Course Info</a></li>
|
||||
% if user.is_authenticated():
|
||||
<li class="book"><a href="/book">Textbook</a></li>
|
||||
<li class="discussion"><a href="/discussion/questions">Discussion</a></li>
|
||||
<li class="book"><a href="${ MITX_ROOT_URL }/book">Textbook</a></li>
|
||||
<li class="discussion"><a href="${ MITX_ROOT_URL }/discussion/questions/">Discussion</a></li>
|
||||
% endif
|
||||
<li class="wiki"><a href="/wiki/view">Wiki</a></li>
|
||||
<li class="wiki"><a href="${ MITX_ROOT_URL }/wiki/view/">Wiki</a></li>
|
||||
% if user.is_authenticated():
|
||||
<li class="profile"><a href="/profile">Profile</a></li>
|
||||
<li class="profile"><a href="${ MITX_ROOT_URL }/profile">Profile</a></li>
|
||||
% endif
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
@@ -8,7 +8,7 @@ function ${ id }_content_updated() {
|
||||
$.each($("[id^=input_${ id }_]"), function(index,value){
|
||||
submit_data[value.id]=value.value;
|
||||
});
|
||||
postJSON('/modx/problem/${ id }/problem_check',
|
||||
postJSON('${ MITX_ROOT_URL }/modx/problem/${ id }/problem_check',
|
||||
submit_data,
|
||||
function(json) {
|
||||
switch(json.success) {
|
||||
@@ -30,7 +30,7 @@ function ${ id }_content_updated() {
|
||||
submit_data[value.id]=value.value;
|
||||
});
|
||||
|
||||
postJSON('/modx/problem/${ id }/problem_reset', {'id':'${ id }'}, function(html_as_json) {
|
||||
postJSON('${ MITX_ROOT_URL }/modx/problem/${ id }/problem_reset', {'id':'${ id }'}, function(html_as_json) {
|
||||
$('#main_${ id }').html(html_as_json);
|
||||
${ id }_content_updated();
|
||||
});
|
||||
@@ -38,7 +38,7 @@ function ${ id }_content_updated() {
|
||||
});
|
||||
|
||||
$('#show_${ id }').unbind('click').click(function() {
|
||||
postJSON('/modx/problem/${ id }/problem_show', {}, function(data) {
|
||||
postJSON('${ MITX_ROOT_URL }/modx/problem/${ id }/problem_show', {}, function(data) {
|
||||
for (var key in data) {
|
||||
$("#answer_"+key).text(data[key]);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ function ${ id }_content_updated() {
|
||||
$.each($("[id^=input_${ id }_]"), function(index,value) {
|
||||
submit_data[value.id]=value.value;
|
||||
});
|
||||
postJSON('/modx/problem/${ id }/problem_save',
|
||||
postJSON('${ MITX_ROOT_URL }/modx/problem/${ id }/problem_save',
|
||||
submit_data,
|
||||
function(data) {
|
||||
if(data.success) {
|
||||
|
||||
@@ -53,7 +53,7 @@ function disablePrev() {
|
||||
function ${ id }goto(i) {
|
||||
log_event("seq_goto", {'old':${id}loc, 'new':i,'id':'${id}'});
|
||||
|
||||
postJSON('/modx/sequential/${ id }/goto_position',
|
||||
postJSON('${ MITX_ROOT_URL }/modx/sequential/${ id }/goto_position',
|
||||
{'position' : i });
|
||||
|
||||
if (${ id }loc!=-1)
|
||||
|
||||
Reference in New Issue
Block a user