diff --git a/plugins/jspsych-survey-multi-choice.js b/plugins/jspsych-survey-multi-choice.js index 859c03d1..972c41c5 100644 --- a/plugins/jspsych-survey-multi-choice.js +++ b/plugins/jspsych-survey-multi-choice.js @@ -88,8 +88,8 @@ $(option_id_selector).append(option_label); // create radio button - var input_id_name = _join(plugin_id_name, 'response', i, j); - $(option_id_selector + " label").prepend(''); + var input_id_name = _join(plugin_id_name, 'response', i); + $(option_id_selector + " label").prepend(''); } } @@ -106,9 +106,9 @@ // create object to hold responses var question_data = {}; - $("div." + plugin_id_name + "-radio").each(function(index) { + $("div." + plugin_id_name + "-question").each(function(index) { var id = "Q" + index; - var val = $(this).find("label input:radio").val(); + var val = $(this).find("input:radio:checked").val(); var obje = {}; obje[id] = val; $.extend(question_data, obje);