From 231aa4674c29455f9e37a9880adad824b9f30433 Mon Sep 17 00:00:00 2001 From: kimth Date: Tue, 21 Aug 2012 08:39:08 -0400 Subject: [PATCH 1/3] Sequential modx/goto_position hits correct multicourse URL --- common/lib/xmodule/xmodule/js/src/sequence/display.coffee | 7 +++++-- lms/templates/seq_module.html | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/sequence/display.coffee b/common/lib/xmodule/xmodule/js/src/sequence/display.coffee index 832a5ec7eb..4fa26c1770 100644 --- a/common/lib/xmodule/xmodule/js/src/sequence/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/sequence/display.coffee @@ -3,6 +3,8 @@ class @Sequence @el = $(element).find('.sequence') @contents = @$('.seq_contents') @id = @el.data('id') + @modx_url = @$('#course_modx_root').text() + @modx_url = @modx_url.substr(1,@modx_url.length-2) # Remove enclosing quotes @initProgress() @bind() @render parseInt(@el.data('position')) @@ -76,7 +78,8 @@ class @Sequence if @position != new_position if @position != undefined @mark_visited @position - $.postWithPrefix "/modx/#{@id}/goto_position", position: new_position + modx_full_url = @modx_url + '/' + @id + '/goto_position' + $.postWithPrefix modx_full_url, position: new_position @mark_active new_position @$('#seq_content').html @contents.eq(new_position - 1).text() @@ -91,7 +94,7 @@ class @Sequence event.preventDefault() new_position = $(event.target).data('element') Logger.log "seq_goto", old: @position, new: new_position, id: @id - + # On Sequence chage, destroy any existing polling thread # for queued submissions, see ../capa/display.coffee if window.queuePollerID diff --git a/lms/templates/seq_module.html b/lms/templates/seq_module.html index 42953c40c6..aadf2b44a9 100644 --- a/lms/templates/seq_module.html +++ b/lms/templates/seq_module.html @@ -1,4 +1,5 @@
+ % for item in items: -
${item['content'] | h}
+
${item['content'] | h}
% endfor
From 7d1fd538f2d3dbeba6f21f31bb594c312f870bb2 Mon Sep 17 00:00:00 2001 From: kimth Date: Tue, 21 Aug 2012 13:36:49 -0400 Subject: [PATCH 3/3] Use data(...) rather than hidden span --- common/lib/xmodule/xmodule/js/src/sequence/display.coffee | 3 +-- lms/templates/seq_module.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/sequence/display.coffee b/common/lib/xmodule/xmodule/js/src/sequence/display.coffee index 421f55be2a..38291be2ef 100644 --- a/common/lib/xmodule/xmodule/js/src/sequence/display.coffee +++ b/common/lib/xmodule/xmodule/js/src/sequence/display.coffee @@ -3,8 +3,7 @@ class @Sequence @el = $(element).find('.sequence') @contents = @$('.seq_contents') @id = @el.data('id') - @modx_url = @$('#course_modx_root').text() - @modx_url = @modx_url.substr(1,@modx_url.length-2) # Remove enclosing quotes + @modx_url = @el.data('course_modx_root') @initProgress() @bind() @render parseInt(@el.data('position')) diff --git a/lms/templates/seq_module.html b/lms/templates/seq_module.html index dac4823f37..be0f4902d4 100644 --- a/lms/templates/seq_module.html +++ b/lms/templates/seq_module.html @@ -1,5 +1,4 @@ -
- +