# HG changeset patch # User Nicholas Jillings # Date 1455105745 0 # Node ID 2cd9f09455a5101c1795a4e28c1b73e65f707854 # Parent 018539fa16c501432de5b6a856f1714474a05fa0 New test creator tool. Still WIP, but much more dynamic. Based on XSD and external lists so far easier to modify. diff -r 018539fa16c5 -r 2cd9f09455a5 core.js --- a/core.js Tue Feb 02 11:03:01 2016 +0000 +++ b/core.js Wed Feb 10 12:02:25 2016 +0000 @@ -117,8 +117,8 @@ // Create the popup interface object popup = new interfacePopup(); - - // Create the specification object + + // Create the specification object specification = new Specification(); // Create the interface object @@ -1224,6 +1224,11 @@ this.audioObjects[i].buffer.buffer = hold; } }; + + this.exportXML = function() + { + + }; } @@ -1823,33 +1828,12 @@ } - this.metrics = { - enabled: [], - decode: function(parent, xml) { - var children = xml.getElementsByTagName('metricenable'); - for (var i in children) { - if (isNaN(Number(i)) == true){break;} - this.enabled.push(children[i].textContent); - } - }, - encode: function(root) { - var node = root.createElement('metric'); - for (var i in this.enabled) - { - if (isNaN(Number(i)) == true){break;} - var child = root.createElement('metricenable'); - child.textContent = this.enabled[i]; - node.appendChild(child); - } - return node; - } - }; + this.metrics = new this.metricNode(); this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]); // Now process the survey node options var survey = setupNode.getElementsByTagName('survey'); - var surveySchema = specification.schema.getAllElementsByName('survey')[0]; for (var i in survey) { if (isNaN(Number(i)) == true){break;} var location = survey[i].getAttribute('location'); @@ -1858,13 +1842,13 @@ if (this.preTest != null){this.errors.push("Already a pre/before test survey defined! Ignoring second!!");} else { this.preTest = new this.surveyNode(); - this.preTest.decode(this,survey[i],surveySchema); + this.preTest.decode(this,survey[i]); } } else if (location == 'post' || location == 'after') { if (this.postTest != null){this.errors.push("Already a post/after test survey defined! Ignoring second!!");} else { this.postTest = new this.surveyNode(); - this.postTest.decode(this,survey[i],surveySchema); + this.postTest.decode(this,survey[i]); } } } @@ -1904,11 +1888,11 @@ this.surveyNode = function() { this.location = null; this.options = []; - this.schema = null; + this.schema = specification.schema.getAllElementsByName('survey')[0]; this.OptionNode = function() { this.type = undefined; - this.schema = undefined; + this.schema = specification.schema.getAllElementsByName('surveyentry')[0]; this.id = undefined; this.mandatory = undefined; this.statement = undefined; @@ -1918,10 +1902,9 @@ this.max = undefined; this.step = undefined; - this.decode = function(parent,child,schema) + this.decode = function(parent,child) { - this.schema = schema; - var attributeMap = schema.getAllElementsByTagName('xs:attribute'); + var attributeMap = this.schema.getAllElementsByTagName('xs:attribute'); for (var i in attributeMap){ if(isNaN(Number(i)) == true){break;} var attributeName = attributeMap[i].getAttribute('name') || attributeMap[i].getAttribute('ref'); @@ -1998,17 +1981,15 @@ return node; }; }; - this.decode = function(parent,xml,schema) { - this.schema = schema; + this.decode = function(parent,xml) { this.location = xml.getAttribute('location'); if (this.location == 'before'){this.location = 'pre';} else if (this.location == 'after'){this.location = 'post';} - var surveyentrySchema = schema.getAllElementsByName('surveyentry')[0]; for (var i in xml.children) { if(isNaN(Number(i))==true){break;} var node = new this.OptionNode(); - node.decode(parent,xml.children[i],surveyentrySchema); + node.decode(parent,xml.children[i]); this.options.push(node); } }; @@ -2029,10 +2010,9 @@ this.name = null; this.options = []; this.scales = []; - this.schema = null; + this.schema = specification.schema.getAllElementsByName('interface')[1]; - this.decode = function(parent,xml,schema) { - this.schema = schema; + this.decode = function(parent,xml) { this.name = xml.getAttribute('name'); var titleNode = xml.getElementsByTagName('title'); if (titleNode.length == 1) @@ -2041,7 +2021,7 @@ } var interfaceOptionNodes = xml.getElementsByTagName('interfaceoption'); // Extract interfaceoption node schema - var interfaceOptionNodeSchema = schema.getAllElementsByName('interfaceoption')[0]; + var interfaceOptionNodeSchema = this.schema.getAllElementsByName('interfaceoption')[0]; var attributeMap = interfaceOptionNodeSchema.getAllElementsByTagName('xs:attribute'); for (var i=0; i + + + + Test Timer + Element Playback Timer + Element Initial Poisition + Element Movement Tracker + Element Listened to Flag + Element Moved Flag + Element Listen Tracker + + + Check all moved + Check all played + Check all fully played (non-loop only) + Check comments entered + Enforce scale usage range + + + Show master volume control + Show test page count + Show playhead + Show Element Comment Boxes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Strongly Disagree + Disagree + Neutral + Agree + Strongly Agree + + + Imperceptible + Perceptible but not annoying + Slightly annoying + Annoying + Very annoying + + + -50 + 0 + 50 + + + Bad + Poor + Fair + Good + Excellent + + + (1) Very Annoying + (2) Annoying + (3) Slightly Annoying + (4) Audible but not Annoying + (5) Inaudible + + + Much Worse + Worse + Slightly Worse + About the same + Slightly Better + Better + Much Better + + + Dislike Extremely + Dislike Very Much + Dislike Moderate + Dislike Slightly + Neither Like nor Dislike + Like Slightly + Like Moderate + Like Very Much + Like Extremely + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 018539fa16c5 -r 2cd9f09455a5 test_create/style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test_create/style.css Wed Feb 10 12:02:25 2016 +0000 @@ -0,0 +1,85 @@ +div#blanket { + z-index: 2; + background-color: rgba(0,0,0,0.5); + width: 100%; + height: 100%; + position: absolute; + left: 0px; + top: 0px; +} + +div#popupHolder { + z-index: 3; + background-color: rgba(255,255,255,1); + width: 730px; + height: 480px; + position: absolute; + border-radius: 10px; + box-shadow: 0px 0px 50px #000; + padding: 10px; +} + +div#popup-title-holder { + width: 100%; + height: 50px; + font-size: 2em; +} + +button#popup-proceed { + width: 60px; + height: 27px; + padding: 5px; + position: absolute; + right: 10px; + bottom: 10px; +} + +div.popup-checkbox { + padding: 5px; +} + +div.popup-checkbox input { + margin: 0px 5px; +} + +div.disabled{ + color: rgb(100,100,100); +} + +div.node { + float: left; + padding: 10px; + border: black 2px solid; + border-radius: 10px; + margin: 25px; + min-width: 92%; +} +div.node-title { + float: left; + width: 100%; + font-size: 2em; + margin: 5px 0px; +} +div.node-attributes { + width: auto; + float: left; + padding: 10px; + border: black 2px dashed; +} +div.attribute { + float: left; + margin-right: 10px; +} +div.node-children { + float: left; +} +div.node-buttons { + float: left; +} +div.attribute input { + max-width: 100px; + margin-right: 10px; +} +div.attribute input[type=number] { + width: 80px; +} \ No newline at end of file diff -r 018539fa16c5 -r 2cd9f09455a5 test_create/test_core.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test_create/test_core.js Wed Feb 10 12:02:25 2016 +0000 @@ -0,0 +1,1524 @@ +var interfaceSpecs; +var xmlHttp; +var popupObject; +var popupStateNodes; +var specification; +var convert; +var attributeText; + +// Firefox does not have an XMLDocument.prototype.getElementsByName +// and there is no searchAll style command, this custom function will +// search all children recusrively for the name. Used for XSD where all +// element nodes must have a name and therefore can pull the schema node +XMLDocument.prototype.getAllElementsByName = function(name) +{ + name = String(name); + var selected = this.documentElement.getAllElementsByName(name); + return selected; +} + +Element.prototype.getAllElementsByName = function(name) +{ + name = String(name); + var selected = []; + var node = this.firstElementChild; + while(node != null) + { + if (node.getAttribute('name') == name) + { + selected.push(node); + } + if (node.childElementCount > 0) + { + selected = selected.concat(node.getAllElementsByName(name)); + } + node = node.nextElementSibling; + } + return selected; +} + +XMLDocument.prototype.getAllElementsByTagName = function(name) +{ + name = String(name); + var selected = this.documentElement.getAllElementsByTagName(name); + return selected; +} + +Element.prototype.getAllElementsByTagName = function(name) +{ + name = String(name); + var selected = []; + var node = this.firstElementChild; + while(node != null) + { + if (node.nodeName == name) + { + selected.push(node); + } + if (node.childElementCount > 0) + { + selected = selected.concat(node.getAllElementsByTagName(name)); + } + node = node.nextElementSibling; + } + return selected; +} + +// Firefox does not have an XMLDocument.prototype.getElementsByName +if (typeof XMLDocument.prototype.getElementsByName != "function") { + XMLDocument.prototype.getElementsByName = function(name) + { + name = String(name); + var node = this.documentElement.firstElementChild; + var selected = []; + while(node != null) + { + if (node.getAttribute('name') == name) + { + selected.push(node); + } + node = node.nextElementSibling; + } + return selected; + } +} + +window.onload = function() +{ + specification = new Specification(); + convert = new SpecificationToHTML(); + xmlHttp = new XMLHttpRequest(); + xmlHttp.open("GET","./interface-specs.xml",true); + xmlHttp.onload = function() + { + var parse = new DOMParser(); + interfaceSpecs = parse.parseFromString(xmlHttp.response,'text/xml'); + buildPage(); + popupObject.postNode(popupStateNodes.state[0]) + } + xmlHttp.send(); + + var xsdGet = new XMLHttpRequest(); + xsdGet.open("GET","../test-schema.xsd",true); + xsdGet.onload = function() + { + var parse = new DOMParser(); + specification.schema = parse.parseFromString(xsdGet.response,'text/xml');; + } + xsdGet.send(); + + var jsonAttribute = new XMLHttpRequest(); + jsonAttribute.open("GET","./attributes.json",true); + jsonAttribute.onload = function() + { + attributeText = JSON.parse(jsonAttribute.response) + } + jsonAttribute.send(); +} + +function buildPage() +{ + popupObject = new function() { + this.object = document.getElementById("popupHolder"); + this.blanket = document.getElementById("blanket"); + + this.popupTitle = document.createElement("div"); + this.popupTitle.id = "popup-title-holder"; + this.popupTitle.align = "center"; + this.titleDOM = document.createElement("span"); + this.titleDOM.id = "popup-title"; + this.popupTitle.appendChild(this.titleDOM); + this.object.appendChild(this.popupTitle); + + this.popupContent = document.createElement("div"); + this.popupContent.id = "popup-content"; + this.object.appendChild(this.popupContent); + + this.proceedButton = document.createElement("button"); + this.proceedButton.id = "popup-proceed"; + this.proceedButton.textContent = "Next"; + this.proceedButton.onclick = function() + { + popupObject.popupContent.innerHTML = null; + popupObject.shownObject.continue(); + }; + this.object.appendChild(this.proceedButton); + + this.shownObject; + + this.resize = function() + { + var w = window.innerWidth; + var h = window.innerHeight; + this.object.style.left = Math.floor((w-750)/2) + 'px'; + this.object.style.top = Math.floor((h-500)/2) + 'px'; + } + + this.show = function() + { + this.object.style.visibility = "visible"; + this.blanket.style.visibility = "visible"; + } + + this.hide = function() + { + this.object.style.visibility = "hidden"; + this.blanket.style.visibility = "hidden"; + } + + this.postNode = function(postObject) + { + this.show(); + //Passed object must have the following: + // Title: text to show in the title + // Content: HTML DOM to show on the page + // On complete this HTML DOM is destroyed so make sure it is referenced elsewhere for processing + this.titleDOM.textContent = postObject.title; + this.popupContent.appendChild(postObject.content); + this.shownObject = postObject; + } + + this.resize(); + this.hide(); + }; + + popupStateNodes = new function() + { + // This defines the several popup states wanted + this.state = []; + this.state[0] = new function() + { + this.title = "Welcome"; + this.content = document.createElement("div"); + this.content.id = "state-0"; + var span = document.createElement("span"); + span.textContent = "Welcome to the WAET test creator tool. This will allow you to create a new test from scratch to suit your testing needs. If you wish to update a test file, please drag and drop the XML document into the area below for processing, otherwise press 'Next' to start a new test. This tool generates files for the WAET 1.2.0 version." + this.content.appendChild(span); + this.dragArea = document.createElement("div"); + this.dragArea.classList = "drag-area"; + this.content.appendChild(this.dragArea); + + this.continue = function() + { + popupObject.postNode(popupStateNodes.state[1]); + } + } + this.state[1] = new function() + { + this.title = "Select your interface"; + this.content = document.createElement("div"); + this.content.id = "state-1"; + var spnH = document.createElement('div'); + var span = document.createElement("span"); + span.textContent = "Please select your interface from the list shown below. This will define the various options which are available. This can later be changed."; + spnH.appendChild(span); + this.content.appendChild(spnH); + this.select = document.createElement("select"); + this.testsXML = interfaceSpecs.getElementsByTagName('tests')[0].children; + for (var i=0; i 0) + { + testNode = this.testXML[0].getAllElementsByName(checkName); + if(testNode.length != 0) {testNode = testNode[0];} + else {testNode = undefined;} + } else { + testNode = undefined; + } + var optH = document.createElement('div'); + optH.className = "popup-checkbox"; + var checkbox = document.createElement('input'); + checkbox.type = "checkbox"; + var text = document.createElement('span'); + checkbox.setAttribute('name',checkName); + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (interfaceNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + } else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + if(testNode != undefined) + { + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (testNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + }else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + } + text.textContent = popupStateNodes.state[2].checkText.getAllElementsByName(checkName)[0].textContent; + optH.appendChild(checkbox); + optH.appendChild(text); + this.options.push(optH); + this.content.appendChild(optH); + } + } + this.continue = function() + { + if (specification.interfaces == null) + { + specification.interfaces = new specification.interfaceNode(); + } + for (var object of this.options) + { + var checkbox = object.children[0]; + if (checkbox.checked) + { + var option = { + type: "check", + name: checkbox.getAttribute('name') + }; + specification.interfaces.options.push(option); + } + } + popupStateNodes.state[3].generate(); + popupObject.postNode(popupStateNodes.state[3]); + } + } + this.state[3] = new function() + { + this.title = "Test Metrics"; + this.content = document.createElement("div"); + this.content.id = "state-1"; + var spnH = document.createElement('div'); + var span = document.createElement("span"); + span.textContent = "Select which data points to include in the exported results XML. Some of this is required for certain post script analysis. See the documentation for further details"; + spnH.appendChild(span); + this.content.appendChild(spnH); + this.options = []; + this.checkText; + this.testXML; + this.interfaceXML; + this.generate = function() + { + var interfaceName = popupStateNodes.state[1].select.value; + this.checkText = interfaceSpecs.getElementsByTagName("global")[0].getAllElementsByTagName("metrics")[0]; + this.testXML = interfaceSpecs.getElementsByTagName("tests")[0].getAllElementsByName(interfaceName)[0]; + this.interfaceXML = interfaceSpecs.getAllElementsByTagName("interfaces")[0].getAllElementsByName(this.testXML.getAttribute("interface"))[0].getAllElementsByTagName("metrics")[0]; + this.testXML = this.testXML.getAllElementsByTagName("metrics"); + for (var i=0; i 0) + { + testNode = this.testXML[0].getAllElementsByName(checkName); + if(testNode.length != 0) {testNode = testNode[0];} + else {testNode = undefined;} + } else { + testNode = undefined; + } + var optH = document.createElement('div'); + optH.className = "popup-checkbox"; + var checkbox = document.createElement('input'); + checkbox.type = "checkbox"; + var text = document.createElement('span'); + checkbox.setAttribute('name',checkName); + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (interfaceNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + } else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + if(testNode != undefined) + { + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (testNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + }else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + } + text.textContent = popupStateNodes.state[3].checkText.getAllElementsByName(checkName)[0].textContent; + optH.appendChild(checkbox); + optH.appendChild(text); + this.options.push(optH); + this.content.appendChild(optH); + } + } + this.continue = function() + { + if (specification.metrics == null) { + specification.metrics = new specification.metricNode(); + } + for (var object of this.options) + { + var checkbox = object.children[0]; + if (checkbox.checked) + { + specification.metrics.enabled.push(checkbox.getAttribute('name')); + } + } + popupStateNodes.state[4].generate(); + popupObject.postNode(popupStateNodes.state[4]); + } + } + this.state[4] = new function() + { + this.title = "Test Visuals"; + this.content = document.createElement("div"); + this.content.id = "state-1"; + var spnH = document.createElement('div'); + var span = document.createElement("span"); + span.textContent = "You can display extra visual content with your interface for the test user to interact with. Select from the available options below. Greyed out options are unavailable for your selected interface"; + spnH.appendChild(span); + this.content.appendChild(spnH); + this.options = []; + this.checkText; + this.testXML; + this.interfaceXML; + this.generate = function() + { + var interfaceName = popupStateNodes.state[1].select.value; + this.checkText = interfaceSpecs.getElementsByTagName("global")[0].getAllElementsByTagName("show")[0]; + this.testXML = interfaceSpecs.getElementsByTagName("tests")[0].getAllElementsByName(interfaceName)[0]; + this.interfaceXML = interfaceSpecs.getAllElementsByTagName("interfaces")[0].getAllElementsByName(this.testXML.getAttribute("interface"))[0].getAllElementsByTagName("show")[0]; + this.testXML = this.testXML.getAllElementsByTagName("metrics"); + for (var i=0; i 0) + { + testNode = this.testXML[0].getAllElementsByName(checkName); + if(testNode.length != 0) {testNode = testNode[0];} + else {testNode = undefined;} + } else { + testNode = undefined; + } + var optH = document.createElement('div'); + optH.className = "popup-checkbox"; + var checkbox = document.createElement('input'); + checkbox.type = "checkbox"; + var text = document.createElement('span'); + checkbox.setAttribute('name',checkName); + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (interfaceNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + } else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + if(testNode != undefined) + { + if (interfaceNode.getAttribute('default') == 'on') + { + checkbox.checked = true; + } + if (testNode.getAttribute('support') == "none") + { + checkbox.disabled = true; + checkbox.checked = false; + optH.className = "popup-checkbox disabled"; + }else if (interfaceNode.getAttribute('support') == "mandatory") + { + checkbox.disabled = true; + checkbox.checked = true; + optH.className = "popup-checkbox disabled"; + } + } + text.textContent = this.checkText.getAllElementsByName(checkName)[0].textContent; + optH.appendChild(checkbox); + optH.appendChild(text); + this.options.push(optH); + this.content.appendChild(optH); + } + } + this.continue = function() + { + if (specification.interfaces == null) + { + specification.interfaces = new specification.interfaceNode(); + } + for (var object of this.options) + { + var checkbox = object.children[0]; + if (checkbox.checked) + { + var option = { + type: "show", + name: checkbox.getAttribute('name') + }; + specification.interfaces.options.push(option); + } + } + popupObject.hide(); + convert.convert(document.getElementById('content')); + } + } + this.state[5] = new function() { + this.title = "Add/Edit Survey Element"; + this.content = document.createElement("div"); + this.content.id = "state-1"; + var spnH = document.createElement('div'); + var span = document.createElement("span"); + span.textContent = "You can configure your survey element here. Press 'Continue' to complete your changes."; + spnH.appendChild(span); + this.content.appendChild(spnH); + this.dynamic = document.createElement("div"); + this.option = null; + this.parent = null; + var select = document.createElement("select"); + select.setAttribute("name","type"); + select.addEventListener("change",this,false); + this.content.appendChild(select); + this.content.appendChild(this.dynamic); + this.generate = function(option, parent) + { + this.option = option; + this.parent = parent; + var optionList = specification.schema.getAllElementsByName("survey")[0].getAllElementsByName("type")[0].getAllElementsByTagName("xs:enumeration"); + for (var i=0; i= 0) { + var aeList = this.parent.parent.specification.audioElements; + if (i < aeList.length-1) { + aeList = aeList.slice(0,i).concat(aeList.slice(i+1)); + } else { + aeList = aeList.slice(0,i); + } + } + i = this.parent.parent.children.findIndex(function(element,index,array){ + if (element == this.parent) + return true; + else + return false; + },this); + if (i >= 0) { + var childList = this.parent.children; + if (i < aeList.length-1) { + childList = childList.slice(0,i).concat(childList.slice(i+1)); + } else { + childList = childList.slice(0,i); + } + this.parent.parent.childrenDOM.removeChild(this.parent.rootDOM); + } + }, + findNode: function(element,index,array){ + if (element == this.parent.specification) + return true; + else + return false; + } + } + this.deleteNode.root.textContent = "Delete Entry"; + this.deleteNode.root.addEventListener("click",this.deleteNode,false); + this.buttonDOM.appendChild(this.deleteNode.root); + } + + this.commentQuestionNode = function(parent,rootObject) + { + this.rootDOM = document.createElement("div"); + this.titleDOM = document.createElement("span"); + this.attributeDOM = document.createElement("div"); + this.attributes = []; + this.childrenDOM = document.createElement("div"); + this.children = []; + this.buttonDOM = document.createElement("div"); + this.parent = parent; + this.specification = rootObject; + this.schema = specification.schema.getAllElementsByName("page")[0]; + this.rootDOM.className = "node"; + + var titleDiv = document.createElement('div'); + titleDiv.className = "node-title"; + this.titleDOM.className = "node-title"; + this.titleDOM.textContent = "Test Page"; + titleDiv.appendChild(this.titleDOM); + + this.attributeDOM.className = "node-attributes"; + this.childrenDOM.className = "node-children"; + this.buttonDOM.className = "node-buttons"; + + this.rootDOM.appendChild(titleDiv); + this.rootDOM.appendChild(this.attributeDOM); + this.rootDOM.appendChild(this.childrenDOM); + this.rootDOM.appendChild(this.buttonDOM); + + } + + this.addInterface = { + root: document.createElement("button"), + parent: this, + handleEvent: function() { + var InterfaceObj = new specification.interfaceNode(); + var newInterface = new this.parent.parent.interfaceNode(this.parent.parent,InterfaceObj); + newInterface.build("Interface",""+this.parent.specification.id+"-interface",this.parent.childrenDOM); + this.parent.children.push(newInterface); + this.parent.specification.interfaces.push(InterfaceObj); + this.parent.interfaces.push(newInterface); + } + } + this.addInterface.root.textContent = "Add Interface"; + this.addInterface.root.addEventListener("click",this.addInterface,false); + this.buttonDOM.appendChild(this.addInterface.root); + + this.addAudioElement = { + root: document.createElement("button"), + parent: this, + handleEvent: function() { + var audioElementObject = new this.parent.specification.audioElementNode(); + var audioElementDOM = new this.parent.audioElementNode(this.parent,audioElementObject); + this.parent.specification.audioElements.push(audioElementObject); + this.parent.children.push(audioElementDOM); + this.parent.childrenDOM.appendChild(audioElementDOM.rootDOM); + } + } + this.addAudioElement.root.textContent = "Add Audio Element"; + this.addAudioElement.root.addEventListener("click",this.addAudioElement,false); + this.buttonDOM.appendChild(this.addAudioElement.root); + } +} \ No newline at end of file diff -r 018539fa16c5 -r 2cd9f09455a5 test_create/test_create.html --- a/test_create/test_create.html Tue Feb 02 11:03:01 2016 +0000 +++ b/test_create/test_create.html Wed Feb 10 12:02:25 2016 +0000 @@ -1,3024 +1,601 @@ - - - - - - - - - WAET: Test Creator - - - - - - - -
- -
-
- - + + + + + + + + +
+
+
+ + \ No newline at end of file diff -r 018539fa16c5 -r 2cd9f09455a5 test_create/test_create_2.html --- a/test_create/test_create_2.html Tue Feb 02 11:03:01 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,793 +0,0 @@ - - - - - - - - - test_create_2 - - - - - - - - - - - -

Create Test Setup XML

-
- Drag and Drop an XML specification file here to auto-load. -
- - -
-
-
-

Setup Node

-
-
- Interface: - -
-
- Project Return: - -
-
- Randomise Page Order: - -
-
- Collect Metrics: - -
-
-
-

Pre Test

- - - - -
-
-

Post Test

- - - - -
-
-

Metrics

- -
-
-

Interface

- - -
-
- -
- - diff -r 018539fa16c5 -r 2cd9f09455a5 test_create/test_create_advanced.html --- a/test_create/test_create_advanced.html Tue Feb 02 11:03:01 2016 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,793 +0,0 @@ - - - - - - - - - test_create_2 - - - - - - - - - - - -

Create Test Setup XML

-
- Drag and Drop an XML specification file here to auto-load. -
- - -
-
-
-

Setup Node

-
-
- Interface: - -
-
- Project Return: - -
-
- Randomise Page Order: - -
-
- Collect Metrics: - -
-
-
-

Pre Test

- - - - -
-
-

Post Test

- - - - -
-
-

Metrics

- -
-
-

Interface

- - -
-
- -
- -