fix data recording for non-response

This commit is contained in:
Josh de Leeuw 2017-03-11 21:54:18 -05:00
parent a74e9555a9
commit fe6b321678

View File

@ -151,7 +151,11 @@ jsPsych.plugins['survey-multi-choice'] = (function() {
var matches = display_element.querySelectorAll("div." + plugin_id_name + "-question");
matches.forEach(function(match, index) {
var id = "Q" + index;
var val = match.querySelector("input[type=radio]:checked").value;
if(match.querySelector("input[type=radio]:checked") !== null){
var val = match.querySelector("input[type=radio]:checked").value;
} else {
var val = "";
}
var obje = {};
obje[id] = val;
Object.assign(question_data, obje);