diff --git a/plugins/jspsych-survey-likert.js b/plugins/jspsych-survey-likert.js index bfdb42b8e5..b0eda0f708 100644 --- a/plugins/jspsych-survey-likert.js +++ b/plugins/jspsych-survey-likert.js @@ -42,19 +42,19 @@ for (var i = 0; i < trial.questions.length; i++) { // create div display_element.append($('
', { - "id": 'survey-likert-' + i, - "class": 'survey-likert-question' + "id": 'jspsych-survey-likert-' + i, + "class": 'jspsych-survey-likert-question' })); // add question text - $("#survey-likert-" + i).append('

' + trial.questions[i] + '

'); + $("#jspsych-survey-likert-" + i).append('

' + trial.questions[i] + '

'); // create slider - $("#survey-likert-" + i).append($('
', { - "id": 'survey-likert-slider-' + i, - "class": 'survey-likert-slider survey-likert' + $("#jspsych-survey-likert-" + i).append($('
', { + "id": 'jspsych-survey-likert-slider-' + i, + "class": 'jspsych-survey-likert-slider jspsych-survey-likert' })); - $("#survey-likert-slider-" + i).slider({ + $("#jspsych-survey-likert-slider-" + i).slider({ value: Math.ceil(trial.intervals[i] / 2), min: 1, max: trial.intervals[i], @@ -63,18 +63,18 @@ // show tick marks if (trial.show_ticks) { - $("#survey-likert-" + i).append($('
', { - "id": 'survey-likert-sliderticks' + i, - "class": 'survey-likert-sliderticks survey-likert', + $("#jspsych-survey-likert-" + i).append($('
', { + "id": 'jspsych-survey-likert-sliderticks' + i, + "class": 'jspsych-survey-likert-sliderticks jspsych-survey-likert', "css": { "position": 'relative' } })); for (var j = 1; j < trial.intervals[i] - 1; j++) { - $('#survey-likert-slider-' + i).append('
'); + $('#jspsych-survey-likert-slider-' + i).append('
'); } - $('#survey-likert-slider-' + i + ' .survey-likert-slidertickmark').each(function(index) { + $('#jspsych-survey-likert-slider-' + i + ' .jspsych-survey-likert-slidertickmark').each(function(index) { var left = (index + 1) * (100 / (trial.intervals[i] - 1)); $(this).css({ 'position': 'absolute', @@ -87,9 +87,9 @@ } // create labels for slider - $("#survey-likert-" + i).append($('
    ', { - "id": "survey-likert-sliderlabels" + i, - "class": 'survey-likert-sliderlabels survey-likert', + $("#jspsych-survey-likert-" + i).append($('
      ', { + "id": "jspsych-survey-likert-sliderlabels-" + i, + "class": 'jspsych-survey-likert-sliderlabels survey-likert', "css": { "width": "100%", "margin": "10px 0px 0px 0px", @@ -100,16 +100,16 @@ })); for (var j = 0; j < trial.labels[i].length; j++) { - $("#survey-likert-sliderlabels-" + i).append('
    • ' + trial.labels[i][j] + '
    • '); + $("#jspsych-survey-likert-sliderlabels-" + i).append('
    • ' + trial.labels[i][j] + '
    • '); } // position labels to match slider intervals - var slider_width = $("#survey-likert-slider-" + i).width(); + var slider_width = $("#jspsych-survey-likert-slider-" + i).width(); var num_items = trial.labels[i].length; var item_width = slider_width / num_items; var spacing_interval = slider_width / (num_items - 1); - $("#survey-likert-sliderlabels-" + i + " li").each(function(index) { + $("#jspsych-survey-likert-sliderlabels-" + i + " li").each(function(index) { $(this).css({ 'display': 'inline-block', 'width': item_width + 'px', @@ -124,18 +124,18 @@ // add submit button display_element.append($('