# HG changeset patch # User Nicholas Jillings # Date 1505240541 -3600 # Node ID 5d7e33fd00d84d4ce090f9792500ae1519a282e8 # Parent 76c06bd88bbe74431e393f4e47064122a2e7c127 Fixed #233 for radios diff -r 76c06bd88bbe -r 5d7e33fd00d8 js/core.js --- a/js/core.js Tue Sep 12 15:23:30 2017 +0100 +++ b/js/core.js Tue Sep 12 19:22:21 2017 +0100 @@ -837,7 +837,8 @@ node.response = null; var i = 0; var inputs = optHold.getElementsByTagName('input'); - while (node.response === null) { + var checked; + while (checked === undefined) { if (i == inputs.length) { if (node.specification.mandatory === true) { interfaceContext.lightbox.post("Error", "Please select one option"); @@ -846,11 +847,18 @@ break; } if (inputs[i].checked === true) { - node.response = node.specification.options[i]; - console.log("Selected: " + node.specification.options[i].name); + checked = inputs[i]; } i++; } + var option = node.specification.options.find(function (a) { + return checked.id == a.name; + }); + if (option === undefined) { + interfaceContext.lightbox.post("Error", "A configuration error has occured, the test cannot be continued"); + throw ("ERROR - Cannot find option"); + } + node.response = option; processConditional.call(this, node, node.response.name); return true; }