# HG changeset patch # User Nicholas Jillings # Date 1433339790 -3600 # Node ID 6372b01560cd62f774a789ee547697b0faa6343f # Parent e103d40537b50aa650d7bfa6fc8f3eda5fe46bcf create_test: Imports from drag and drop project XML diff -r e103d40537b5 -r 6372b01560cd test_create/test_create.html --- a/test_create/test_create.html Wed Jun 03 12:54:08 2015 +0100 +++ b/test_create/test_create.html Wed Jun 03 14:56:30 2015 +0100 @@ -185,8 +185,9 @@ var node = document.createElement('question'); node.setAttribute('id',attributes[0].value); node.textContent = attributes[1].value; + node.setAttribute('mandatory',attributes[2].checked); } else if (elem.getAttribute('name') == 'statement-node') { - var node = document.createElement('statment'); + var node = document.createElement('statement'); node.textContent = attributes[0].value; } parent.appendChild(node); @@ -264,9 +265,12 @@ attributes.setAttribute('class','attrib'); var id = attributePair("ID:","text", true); var question = attributePair("Question:","text", false); + question[1].style.width = "500px"; + var mandatory = attributePair("Mandatory:","checkbox", false); node.appendChild(nodeTitle); id.forEach(function(item){attributes.appendChild(item);},false); question.forEach(function(item){attributes.appendChild(item);},false); + mandatory.forEach(function(item){attributes.appendChild(item);},false); node.appendChild(attributes); var removeButton = document.createElement("button"); @@ -285,6 +289,7 @@ var attributes = document.createElement("div"); attributes.setAttribute('class','attrib'); var statement = attributePair("Statement:","text",false); + statement[1].style.width = "500px"; node.appendChild(nodeTitle); statement.forEach(function(item){attributes.appendChild(item);},false); node.appendChild(attributes); @@ -383,22 +388,15 @@ } function audioElementNode() { - var parentStructure = event.srcElement.parentElement.childNodes; - var audioElemCounts = 0; - for (var i=0; i