Commit 2f578429 by Xavier Antoviaque

Fix variable name formatting in JS files

parent 405b6014
function MentoringBlock(runtime, element) { function MentoringBlock(runtime, element) {
var progress_template = _.template($('#xblock-progress-template').html()); var progressTemplate = _.template($('#xblock-progress-template').html());
function render_progress() { function renderProgress() {
var data = $('.progress', element).data(); var data = $('.progress', element).data();
$('.indicator', element).html(progress_template(data)); $('.indicator', element).html(progressTemplate(data));
} }
function callIfExists(obj, fn) { function callIfExists(obj, fn) {
...@@ -24,7 +24,7 @@ function MentoringBlock(runtime, element) { ...@@ -24,7 +24,7 @@ function MentoringBlock(runtime, element) {
}); });
$('.progress', element).data('completed', results.completed ? 'True' : 'False') $('.progress', element).data('completed', results.completed ? 'True' : 'False')
render_progress(); renderProgress();
} }
$(element).find('.submit').bind('click', function() { $(element).find('.submit').bind('click', function() {
...@@ -40,5 +40,5 @@ function MentoringBlock(runtime, element) { ...@@ -40,5 +40,5 @@ function MentoringBlock(runtime, element) {
$.post(handlerUrl, JSON.stringify(data)).success(handleSubmitResults); $.post(handlerUrl, JSON.stringify(data)).success(handleSubmitResults);
}); });
render_progress(); renderProgress();
} }
function QuizzBlock(runtime, element) { function QuizzBlock(runtime, element) {
return { return {
submit: function() { submit: function() {
var checked_radio = $('input[type=radio]:checked', element); var checkedRadio = $('input[type=radio]:checked', element);
if(checked_radio.length) { if(checkedRadio.length) {
return checked_radio.val(); return checkedRadio.val();
} else { } else {
return null; return null;
} }
}, },
handleSubmit: function(result) { handleSubmit: function(result) {
var tips_dom = $(element).parent().find('.quizz-tips'), var tipsDom = $(element).parent().find('.quizz-tips'),
tip_html = (result || {}).tip || ''; tipHtml = (result || {}).tip || '';
if(tip_html) { if(tipHtml) {
tips_dom.append(tip_html); tipsDom.append(tipHtml);
} }
} }
} }
......
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