Mercurial > hg > webaudioevaluationtool
changeset 3024:9cdcde1dafd8
Merge branch 'master' into vnext
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Tue, 12 Sep 2017 19:23:56 +0100 |
parents | e2e189785bfa (current diff) 5d7e33fd00d8 (diff) |
children | c93687862a79 cacc7f1cf062 |
files | js/core.js |
diffstat | 1 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/js/core.js Tue Sep 12 19:06:21 2017 +0100 +++ b/js/core.js Tue Sep 12 19:23:56 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; }