Commit 2f578429 by Xavier Antoviaque

Fix variable name formatting in JS files

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