annotate test_create/test_create.html @ 2021:094b3a72978b

Create_Test: Creates XML Document.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 03 Jun 2015 12:07:07 +0100
parents 7d3cbad47ae4
children 3b24b06f93a1
rev   line source
nickjillings@2016 1 <!DOCTYPE html>
nickjillings@2016 2 <html lang="en">
nickjillings@2016 3 <head>
nickjillings@2016 4 <meta charset="utf-8">
nickjillings@2016 5
nickjillings@2016 6 <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
nickjillings@2016 7 Remove this if you use the .htaccess -->
nickjillings@2016 8 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
nickjillings@2016 9
nickjillings@2016 10 <title>WAET Create Test</title>
nickjillings@2016 11 <meta name="description" content="">
nickjillings@2016 12 <meta name="author" content="">
nickjillings@2016 13
nickjillings@2016 14 <meta name="viewport" content="width=device-width; initial-scale=1.0">
nickjillings@1591 15
nickjillings@1591 16 <script type="text/javascript">
nickjillings@1591 17 // To aid 'one-page set-up' all scripts and CSS must be included directly in this file!
nickjillings@1591 18 var topLevel;
nickjillings@1591 19 window.onload = function() {
nickjillings@1591 20 // Initialise page
nickjillings@1591 21 topLevel = document.getElementById('topLevelBody');
nickjillings@1591 22 var setup = document.createElement('div');
nickjillings@1591 23 setup.id = 'setupTagDiv';
nickjillings@1591 24
nickjillings@1591 25 };
nickjillings@1591 26
nickjillings@1594 27 function attributePair(string, type, mandatory){
nickjillings@1591 28 var id = document.createElement("span");
nickjillings@1591 29 id.textContent = string;
nickjillings@1591 30 var input = document.createElement("input");
nickjillings@1591 31 input.type = type;
nickjillings@1594 32 if (type == 'text') {
nickjillings@1594 33 if (mandatory == true) {
nickjillings@1594 34 input.setAttribute('mandatory','true');
nickjillings@1594 35 }
nickjillings@1594 36 else {
nickjillings@1594 37 input.setAttribute('mandatory','false');
nickjillings@1594 38 }
nickjillings@1594 39 }
nickjillings@1591 40 return [id, input];
nickjillings@1591 41 }
nickjillings@1591 42
nickjillings@1592 43 function removeNode(event) {
nickjillings@1592 44 event.srcElement.parentElement.parentElement.removeChild(event.srcElement.parentElement);
nickjillings@1592 45 }
nickjillings@1592 46
nickjillings@1594 47 function buttonClickedValidate() {
nickjillings@1594 48 var ready = validate();
nickjillings@1594 49 if (ready == false) {
nickjillings@1594 50 var errMsg = document.getElementById('errorMessage');
nickjillings@1595 51 errMsg.textContent = "There were some errors with your XML. Any input boxes highlighted in red are invalid because they are empty or because its ID matches another elements ID. Please fill these in correctly. Any boxes which are yellow are not-invalid but will use the default value.";
nickjillings@1594 52 errMsg.style.visibility = 'visible';
nickjillings@1594 53 document.getElementById('createXML').disabled = true;
nickjillings@1594 54
nickjillings@1594 55 } else {
nickjillings@1594 56 var errMsg = document.getElementById('errorMessage');
nickjillings@1594 57 errMsg.textContent = "";
nickjillings@1594 58 errMsg.style.visiblity = 'hidden';
nickjillings@1594 59 document.getElementById('createXML').disabled = false;
nickjillings@1594 60 }
nickjillings@1594 61 }
nickjillings@1594 62
nickjillings@1595 63 function buttonClickedSubmit() {
nickjillings@1595 64 var ready = validate();
nickjillings@1595 65 if (ready == true) {
nickjillings@1595 66 var xmlDoc = document.createElement('BrowserEvalProjectDocument');
nickjillings@1595 67 var setup = document.createElement('setup');
nickjillings@1595 68 setup.setAttribute('interface',document.getElementById('interface').value);
nickjillings@1595 69 if (document.getElementById('projectReturn').value == "") {
nickjillings@1595 70 setup.setAttribute('projectReturn',"null");
nickjillings@1595 71 } else {
nickjillings@1595 72 setup.setAttribute('projectReturn',document.getElementById('projectReturn').value);
nickjillings@1595 73 }
nickjillings@1595 74 setup.setAttribute('randomiseOrder',document.getElementById('randomisePageOrder').checked);
nickjillings@1595 75 setup.setAttribute('collectMetrics',document.getElementById('collectMetrics').checked);
nickjillings@1595 76
nickjillings@1595 77 var globalPreTest = document.createElement('preTest');
nickjillings@1595 78 var options = document.getElementById('globalPreTest').getElementsByClassName('head');
nickjillings@1595 79 constructPrePost(globalPreTest, options);
nickjillings@1595 80
nickjillings@1595 81 var globalPostTest = document.createElement('postTest');
nickjillings@1595 82 options = document.getElementById('globalPostTest').getElementsByClassName('head');
nickjillings@1595 83 constructPrePost(globalPostTest, options);
nickjillings@1595 84
nickjillings@1595 85 var globalMetrics = document.createElement('metric');
nickjillings@1595 86 options = document.getElementById('globalMetric').getElementsByClassName('attrib')[0].getElementsByTagName('input');
nickjillings@1595 87 for (var i=0; i<options.length; i++) {
nickjillings@1595 88 if (options[i].checked) {
nickjillings@1595 89 var metric = document.createElement('metricEnable');
nickjillings@1595 90 metric.textContent = options[i].id;
nickjillings@1595 91 globalMetrics.appendChild(metric);
nickjillings@1595 92 }
nickjillings@1595 93 }
nickjillings@2021 94 setup.appendChild(globalPreTest);
nickjillings@2021 95 setup.appendChild(globalPostTest);
nickjillings@2021 96 setup.appendChild(globalMetrics);
nickjillings@2021 97 xmlDoc.appendChild(setup);
nickjillings@1595 98
nickjillings@2021 99 var audioHolders = document.getElementsByName('audio-holder');
nickjillings@2021 100 for (var i=0; i<audioHolders.length; i++) {
nickjillings@2021 101 var audioHolder = document.createElement('audioHolder');
nickjillings@2021 102 var audioHolderDOM = audioHolders[i];
nickjillings@2021 103 var attribs = audioHolderDOM.getElementsByClassName('attrib')[0].getElementsByTagName('input');
nickjillings@2021 104 audioHolder.id = attribs[0].value;
nickjillings@2021 105 if (attribs[1].value != "") {audioHolder.setAttribute('sampleRate',attribs[1].value);}
nickjillings@2021 106 if (attribs[2].value != "") {audioHolder.setAttribute('hostURL',attribs[2].value);}
nickjillings@2021 107 audioHolder.setAttribute('randomiseOrder',attribs[3].checked);
nickjillings@2021 108 audioHolder.setAttribute('repeatCount',attribs[4].checked);
nickjillings@2021 109 audioHolder.setAttribute('loop',attribs[5].checked);
nickjillings@2021 110 audioHolder.setAttribute('elementComments',attribs[6].checked);
nickjillings@2021 111
nickjillings@2021 112 // Audio-Holder PreTests
nickjillings@2021 113 var audioHolderPreTest = document.createElement('preTest');
nickjillings@2021 114 var audioHolderPostTest = document.createElement('postTest');
nickjillings@2021 115 options = audioHolderDOM.childNodes[2].getElementsByClassName('head');
nickjillings@2021 116 constructPrePost(audioHolderPreTest, options);
nickjillings@2021 117 options = audioHolderDOM.childNodes[3].getElementsByClassName('head');
nickjillings@2021 118 constructPrePost(audioHolderPostTest, options);
nickjillings@2021 119
nickjillings@2021 120 audioHolder.appendChild(audioHolderPreTest);
nickjillings@2021 121 audioHolder.appendChild(audioHolderPostTest);
nickjillings@2021 122
nickjillings@2021 123 // audio-Elements
nickjillings@2021 124 var audioElementsDOM = [];
nickjillings@2021 125 var commentQuestionDOM = [];
nickjillings@2021 126 for (var j=0; j<audioHolderDOM.childElementCount; j++) {
nickjillings@2021 127 var child = audioHolderDOM.childNodes[j];
nickjillings@2021 128 var name = child.getAttribute('name');
nickjillings@2021 129 if (name == 'audio-element') {audioElementsDOM.push(child);}
nickjillings@2021 130 else if (name == 'comment-question') {commentQuestionDOM.push(child);}
nickjillings@2021 131 }
nickjillings@2021 132
nickjillings@2021 133 for (var j=0; j<audioElementsDOM.length; j++) {
nickjillings@2021 134 var audioElement = document.createElement('audioElement');
nickjillings@2021 135 attribs = audioElementsDOM[j].getElementsByClassName('attrib')[0].getElementsByTagName('input');
nickjillings@2021 136 audioElement.id = attribs[0].value;
nickjillings@2021 137 audioElement.setAttribute('url',attribs[1].value);
nickjillings@2021 138 audioHolder.appendChild(audioElement);
nickjillings@2021 139 }
nickjillings@2021 140
nickjillings@2021 141 for (var j=0; j<commentQuestionDOM.length; j++) {
nickjillings@2021 142 var commentQuestion = document.createElement('commentQuestion');
nickjillings@2021 143 attribs = commentQuestionDOM[j].getElementsByClassName('attrib')[0].getElementsByTagName('input');
nickjillings@2021 144 commentQuestion.id = attribs[0].value;
nickjillings@2021 145 commentQuestion.textContent = attribs[1].value;
nickjillings@2021 146 audioHolder.appendChild(commentQuestion);
nickjillings@2021 147 }
nickjillings@2021 148 xmlDoc.appendChild(audioHolder);
nickjillings@2021 149 }
nickjillings@2021 150 return xmlDoc;
nickjillings@1595 151 }
nickjillings@1595 152 }
nickjillings@1595 153
nickjillings@1595 154 function constructPrePost(parent, options) {
nickjillings@1595 155 for (var i=0; i<options.length; i++) {
nickjillings@1595 156 var elem = options[i];
nickjillings@1595 157 var attributes = elem.getElementsByClassName('attrib')[0].getElementsByTagName('input');
nickjillings@1595 158 if (elem.getAttribute('name') == 'question-node') {
nickjillings@1595 159 var node = document.createElement('question');
nickjillings@1595 160 node.setAttribute('id',attributes[0].value);
nickjillings@1595 161 node.textContent = attributes[1].value;
nickjillings@1595 162 } else if (elem.getAttribute('name') == 'statement-node') {
nickjillings@1595 163 var node = document.createElement('statment');
nickjillings@1595 164 node.textContent = attributes[0].value;
nickjillings@1595 165 }
nickjillings@1595 166 parent.appendChild(node);
nickjillings@1595 167 }
nickjillings@1595 168 }
nickjillings@1595 169
nickjillings@1594 170 function validate() {
nickjillings@1594 171 var canExport = true;
nickjillings@1594 172 // Checks if the XML can be created from the given entries
nickjillings@1594 173 var inputs = document.getElementsByTagName('input');
nickjillings@1594 174 for (var i=0; i<inputs.length; i++) {
nickjillings@1594 175 if (inputs[i].type == 'text') {
nickjillings@1594 176 if (inputs[i].value == "") {
nickjillings@1594 177 var mandatory = inputs[i].getAttribute('mandatory');
nickjillings@1594 178 if (mandatory == "true") {
nickjillings@1594 179 errorInput(inputs[i]);
nickjillings@1594 180 canExport = false;
nickjillings@1594 181 } else {
nickjillings@1594 182 warningInput(inputs[i]);
nickjillings@1594 183 }
nickjillings@1594 184 } else {
nickjillings@1594 185 goodInput(inputs[i]);
nickjillings@1594 186 }
nickjillings@1594 187 }
nickjillings@1594 188 }
nickjillings@1595 189
nickjillings@1595 190 var audioHolders = document.getElementsByName('audio-holder');
nickjillings@1595 191 for (var i=0; i<audioHolders.length; i++) {
nickjillings@1595 192 var divs = audioHolders[i].getElementsByClassName('head');
nickjillings@1595 193 var IDs = [];
nickjillings@1595 194 for (var j=0; j<divs.length; j++) {
nickjillings@1595 195 if (divs[j].getAttribute('name') == 'audio-element') {
nickjillings@1595 196 var obj = divs[j].getElementsByClassName('attrib')[0].children[1];
nickjillings@1595 197 var aeID = obj.value;
nickjillings@1595 198 if (aeID != "") {
nickjillings@1595 199 var unique = true;
nickjillings@1595 200 for (var k=0; k<IDs.length; k++) {
nickjillings@1595 201 if (aeID == IDs[k]) {
nickjillings@1595 202 unique = false;
nickjillings@1595 203 break;
nickjillings@1595 204 }
nickjillings@1595 205 }
nickjillings@1595 206 if (unique == true) {
nickjillings@1595 207 IDs.push(aeID);
nickjillings@1595 208 } else {
nickjillings@1595 209 errorInput(obj);
nickjillings@1595 210 canExport = false;
nickjillings@1595 211 }
nickjillings@1595 212 }
nickjillings@1595 213 }
nickjillings@1595 214 }
nickjillings@1595 215 }
nickjillings@1594 216 return canExport;
nickjillings@1594 217 };
nickjillings@1594 218
nickjillings@1594 219 function errorInput(node) {
nickjillings@1594 220 node.style.backgroundColor = "#FF0000";
nickjillings@1594 221 }
nickjillings@1594 222
nickjillings@1594 223 function warningInput(node) {
nickjillings@1594 224 node.style.backgroundColor = "#FFFF00";
nickjillings@1594 225 }
nickjillings@1594 226
nickjillings@1594 227 function goodInput(node) {
nickjillings@1594 228 node.style.backgroundColor = "#FFFFFF";
nickjillings@1594 229 }
nickjillings@1594 230
nickjillings@1591 231 function questionNode() {
nickjillings@1591 232 var node = document.createElement("div");
nickjillings@1591 233 node.setAttribute('class','head');
nickjillings@1591 234 node.setAttribute('name','question-node');
nickjillings@1591 235 var nodeTitle = document.createElement("span");
nickjillings@1591 236 nodeTitle.textContent = "Question";
nickjillings@1591 237 var attributes = document.createElement("div");
nickjillings@1591 238 attributes.setAttribute('class','attrib');
nickjillings@1594 239 var id = attributePair("ID:","text", true);
nickjillings@1594 240 var question = attributePair("Question:","text", false);
nickjillings@1591 241 node.appendChild(nodeTitle);
nickjillings@1591 242 id.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1591 243 question.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1591 244 node.appendChild(attributes);
nickjillings@1592 245
nickjillings@1592 246 var removeButton = document.createElement("button");
nickjillings@1592 247 removeButton.textContent = "Remove";
nickjillings@1592 248 removeButton.onclick = removeNode;
nickjillings@1592 249 node.appendChild(removeButton);
nickjillings@1591 250 return node;
nickjillings@1591 251 }
nickjillings@1591 252
nickjillings@1591 253 function statementNode() {
nickjillings@1591 254 var node = document.createElement("div");
nickjillings@1591 255 node.setAttribute('class','head');
nickjillings@1594 256 node.setAttribute('name','statement-node');
nickjillings@1591 257 var nodeTitle = document.createElement("span");
nickjillings@1591 258 nodeTitle.textContent = "Statement";
nickjillings@1591 259 var attributes = document.createElement("div");
nickjillings@1591 260 attributes.setAttribute('class','attrib');
nickjillings@1594 261 var statement = attributePair("Statement:","text",false);
nickjillings@1591 262 node.appendChild(nodeTitle);
nickjillings@1591 263 statement.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1591 264 node.appendChild(attributes);
nickjillings@1592 265
nickjillings@1592 266 var removeButton = document.createElement("button");
nickjillings@1592 267 removeButton.textContent = "Remove";
nickjillings@1592 268 removeButton.onclick = removeNode;
nickjillings@1592 269 node.appendChild(removeButton);
nickjillings@1591 270 return node;
nickjillings@1591 271 }
nickjillings@1591 272
nickjillings@1591 273 function audioHolderNode() {
nickjillings@1591 274 var audioHolderCounts = document.getElementsByName("audio-holder").length;
nickjillings@1591 275 var node = document.createElement("div");
nickjillings@1591 276 node.setAttribute("class","head");
nickjillings@1591 277 node.setAttribute("name","audio-holder");
nickjillings@1592 278 node.setAttribute("id","audio-holder-"+audioHolderCounts);
nickjillings@1591 279 var nodeTitle = document.createElement("span");
nickjillings@1592 280 nodeTitle.textContent = "Audio Holder "+(audioHolderCounts+1);
nickjillings@1591 281
nickjillings@1591 282 var attributes = document.createElement("div");
nickjillings@1591 283 attributes.setAttribute('class','attrib');
nickjillings@1594 284 var id = attributePair("ID:","text",true);
nickjillings@1592 285 id[1].value=audioHolderCounts;
nickjillings@1594 286 var hostURL = attributePair("Host URL:", "text",false);
nickjillings@1594 287 var sampleRate = attributePair("Sample Rate:","text",false);
nickjillings@1592 288 var randomiseOrder = attributePair("Randomise Element Order:","checkbox");
nickjillings@1592 289 var repeatCount = attributePair("Repeat Page Count:","number");
nickjillings@1592 290 repeatCount[1].value = 0;
nickjillings@1592 291 var loop = attributePair("Loop Element Playback","checkbox");
nickjillings@1592 292 var elementComments = attributePair("Enable Comment Boxes","checkbox");
nickjillings@1592 293 id.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 294 hostURL.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 295 sampleRate.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 296 hostURL.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 297 randomiseOrder.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 298 repeatCount.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 299 loop.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 300 elementComments.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 301
nickjillings@1592 302 node.appendChild(nodeTitle);
nickjillings@1592 303 node.appendChild(attributes);
nickjillings@1592 304
nickjillings@1592 305 var pretest = document.createElement("div");
nickjillings@1592 306 pretest.setAttribute('class','head');
nickjillings@1592 307 pretest.setAttribute('name','pre-test');
nickjillings@1592 308 var pretestTitle = document.createElement("h4");
nickjillings@1592 309 pretestTitle.textContent = "Pre Test";
nickjillings@1592 310 var buttonAddQ = document.createElement("button");
nickjillings@1592 311 buttonAddQ.textContent = "Add Pre Test Question";
nickjillings@1592 312 buttonAddQ.onclick = function(){event.srcElement.parentElement.appendChild(questionNode());};
nickjillings@1592 313 var buttonAddS = document.createElement("button");
nickjillings@1592 314 buttonAddS.textContent = "Add Pre Test Statement";
nickjillings@1592 315 buttonAddS.onclick = function(){event.srcElement.parentElement.appendChild(statementNode());};
nickjillings@1592 316 pretest.appendChild(pretestTitle);
nickjillings@1592 317 pretest.appendChild(buttonAddQ);
nickjillings@1592 318 pretest.appendChild(buttonAddS);
nickjillings@1592 319
nickjillings@1592 320 var posttest = document.createElement("div");
nickjillings@1592 321 posttest.setAttribute('class','head');
nickjillings@1592 322 posttest.setAttribute('name','post-test');
nickjillings@1592 323 var posttestTitle = document.createElement("h4");
nickjillings@1592 324 posttestTitle.textContent = "Post Test";
nickjillings@1592 325 var buttonAddQ = document.createElement("button");
nickjillings@1592 326 buttonAddQ.textContent = "Add Post Test Question";
nickjillings@1592 327 buttonAddQ.onclick = function(){event.srcElement.parentElement.appendChild(questionNode());};
nickjillings@1592 328 var buttonAddS = document.createElement("button");
nickjillings@1592 329 buttonAddS.textContent = "Add Post Test Statement";
nickjillings@1592 330 buttonAddS.onclick = function(){event.srcElement.parentElement.appendChild(statementNode());};
nickjillings@1592 331 posttest.appendChild(posttestTitle);
nickjillings@1592 332 posttest.appendChild(buttonAddQ);
nickjillings@1592 333 posttest.appendChild(buttonAddS);
nickjillings@1592 334
nickjillings@1592 335 node.appendChild(pretest);
nickjillings@1592 336 node.appendChild(posttest);
nickjillings@1592 337
nickjillings@1592 338 var newAudioElementButton = document.createElement("button");
nickjillings@1592 339 newAudioElementButton.textContent = "Add audio element";
nickjillings@1592 340 newAudioElementButton.onclick = function(){
nickjillings@1592 341 event.srcElement.parentElement.appendChild(audioElementNode());
nickjillings@1592 342 };
nickjillings@1592 343 node.appendChild(newAudioElementButton);
nickjillings@1592 344
nickjillings@1592 345 var newCommentButton = document.createElement("button");
nickjillings@1592 346 newCommentButton.textContent = "Add Comment Box";
nickjillings@1592 347 newCommentButton.onclick = function() {
nickjillings@1592 348 event.srcElement.parentElement.appendChild(commentBox());
nickjillings@1592 349 };
nickjillings@1592 350 node.appendChild(newCommentButton);
nickjillings@1592 351
nickjillings@1592 352 var removeButton = document.createElement("button");
nickjillings@1592 353 removeButton.textContent = "Remove Audio Holder";
nickjillings@1592 354 removeButton.onclick = removeNode;
nickjillings@1592 355 node.appendChild(removeButton);
nickjillings@1592 356 return node;
nickjillings@1592 357 }
nickjillings@1592 358
nickjillings@1592 359 function audioElementNode() {
nickjillings@1592 360 var parentStructure = event.srcElement.parentElement.childNodes;
nickjillings@1592 361 var audioElemCounts = 0;
nickjillings@1592 362 for (var i=0; i<parentStructure.length; i++) {
nickjillings@1592 363 if (parentStructure[i].getAttribute('name') == "audio-element")
nickjillings@1592 364 {audioElemCounts++;}
nickjillings@1592 365 }
nickjillings@1592 366 var node = document.createElement('div');
nickjillings@1592 367 node.setAttribute('class','head');
nickjillings@1592 368 node.setAttribute('name','audio-element');
nickjillings@1592 369 var nodeTitle = document.createElement('span');
nickjillings@1592 370 nodeTitle.textContent = 'Audio Element '+(audioElemCounts+1);
nickjillings@1592 371
nickjillings@1592 372 var attributes = document.createElement("div");
nickjillings@1592 373 attributes.setAttribute('class','attrib');
nickjillings@1594 374 var id = attributePair("ID:","text",true);
nickjillings@1592 375 id[1].value = audioElemCounts;
nickjillings@1594 376 var url = attributePair("URL:","text",true);
nickjillings@1592 377 id.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 378 url.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 379
nickjillings@1592 380 node.appendChild(nodeTitle);
nickjillings@1592 381 node.appendChild(attributes);
nickjillings@1592 382
nickjillings@1592 383 var removeButton = document.createElement("button");
nickjillings@1592 384 removeButton.textContent = "Remove Audio Element";
nickjillings@1592 385 removeButton.onclick = removeNode;
nickjillings@1592 386 node.appendChild(removeButton);
nickjillings@1592 387 return node;
nickjillings@1592 388 }
nickjillings@1592 389
nickjillings@1592 390 function commentBox() {
nickjillings@1592 391 var node = document.createElement('div');
nickjillings@1592 392 node.setAttribute('class','head');
nickjillings@1592 393 node.setAttribute('name','comment-question');
nickjillings@1592 394 var nodeTitle = document.createElement('h4');
nickjillings@1592 395 nodeTitle.textContent = "Comment Box";
nickjillings@1592 396
nickjillings@1592 397 var attributes = document.createElement('div');
nickjillings@1592 398 attributes.setAttribute('class','attrib');
nickjillings@1594 399 var id = attributePair("ID:",'text',true);
nickjillings@1594 400 var question = attributePair("Question:",'text',true);
nickjillings@1592 401 id.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 402 question.forEach(function(item){attributes.appendChild(item);},false);
nickjillings@1592 403
nickjillings@1592 404 var removeButton = document.createElement("button");
nickjillings@1592 405 removeButton.textContent = "Remove Comment Box";
nickjillings@1592 406 removeButton.onclick = removeNode;
nickjillings@1592 407
nickjillings@1592 408 node.appendChild(nodeTitle);
nickjillings@1592 409 node.appendChild(attributes);
nickjillings@1592 410 node.appendChild(removeButton);
nickjillings@1592 411 return node;
nickjillings@1591 412 }
nickjillings@1591 413 </script>
nickjillings@1591 414 <style>
nickjillings@1591 415 div {
nickjillings@1591 416 padding: 2px;
nickjillings@1591 417 margin-top: 2px;
nickjillings@1591 418 margin-bottom: 2px;
nickjillings@1591 419 }
nickjillings@1591 420 div.head{
nickjillings@1591 421 margin-left: 10px;
nickjillings@1591 422 border: black;
nickjillings@1591 423 border-width: 2px;
nickjillings@1591 424 border-style: solid;
nickjillings@1591 425 }
nickjillings@1591 426 div.attrib{
nickjillings@1591 427 margin-left:25px;
nickjillings@1591 428 border: black;
nickjillings@1591 429 border-width: 2px;
nickjillings@1591 430 border-style: dashed;
nickjillings@1591 431 margin-bottom: 10px;
nickjillings@1591 432 }
nickjillings@1591 433 </style>
nickjillings@1591 434
nickjillings@2016 435 </head>
nickjillings@2016 436
nickjillings@2016 437 <body>
nickjillings@1591 438 <h1>Create Test Setup XML</h1>
nickjillings@1594 439 <button id="validateXML" onclick="buttonClickedValidate();">Validate</button>
nickjillings@1594 440 <button id="createXML" onclick="buttonClickedValidate();" disabled>Submit</button>
nickjillings@1594 441 <span id="errorMessage" visibility="hidden"></span>
nickjillings@1591 442 <div id="topLevelBody" align="left">
nickjillings@2016 443 <!-- Interface goes here -->
nickjillings@1591 444 <div name='test-setup'>
nickjillings@1591 445 <div id="setup" class="head">
nickjillings@1591 446 <h2>Setup Tag</h2>
nickjillings@1591 447 <div id="setup-attribs" class="attrib">
nickjillings@1591 448 <span>Interface</span>
nickjillings@1591 449 <select id="interface">
nickjillings@1591 450 <option value='APE'>APE</option>
nickjillings@1591 451 </select>
nickjillings@1591 452 <span>Project Return</span>
nickjillings@1594 453 <input type="text" id="projectReturn" mandatory="false">
nickjillings@1591 454 <span>Randomise Test Page Order</span>
nickjillings@1591 455 <input id="randomisePageOrder" type="checkbox" value="false">
nickjillings@1591 456 <span>Collect Session Metrics</span>
nickjillings@1591 457 <input id="collectMetrics" type="checkbox">
nickjillings@1591 458 </div>
nickjillings@1591 459 <div id="globalPreTest" class="head">
nickjillings@1591 460 <h3>Pre Test</h3>
nickjillings@1591 461 <button id="addPreTestQ" onclick="event.srcElement.parentElement.appendChild(questionNode());">Add Pre Test Question</button>
nickjillings@1591 462 <button id="addPreTestS" onclick="event.srcElement.parentElement.appendChild(statementNode());">Add Pre Test Statement</button>
nickjillings@1591 463 </div>
nickjillings@1591 464 <div id="globalPostTest" class="head">
nickjillings@1591 465 <h3>Post Test</h3>
nickjillings@1591 466 <button id="addPreTestQ" onclick="event.srcElement.parentElement.appendChild(questionNode());">Add Post Test Question</button>
nickjillings@1591 467 <button id="addPreTestS" onclick="event.srcElement.parentElement.appendChild(statementNode());">Add Post Test Statement</button>
nickjillings@1591 468 </div>
nickjillings@1591 469 <div id="globalMetric" class="head">
nickjillings@1591 470 <h3>Global Metrics</h3>
nickjillings@1591 471 <div id="globalMetric-attrib" class="attrib">
nickjillings@1591 472 <span>Test Timer</span>
nickjillings@1591 473 <input type="checkbox" id="testTimer" />
nickjillings@1591 474 <span>Element Playback Timer</span>
nickjillings@1591 475 <input type="checkbox" id="elementTimer" />
nickjillings@1591 476 <span>Element Initial Position</span>
nickjillings@1591 477 <input type="checkbox" id="elementInitialPosition" />
nickjillings@1591 478 <span>Element Tracker</span>
nickjillings@1591 479 <input type="checkbox" id="elementTracker" />
nickjillings@1591 480 <span>Element Flag Listened To</span>
nickjillings@1595 481 <input type="checkbox" id="elementFlagListenedTo" />
nickjillings@1591 482 <span>Element Flag Moved</span>
nickjillings@1591 483 <input type="checkbox" id="elementFlagMoved" />
nickjillings@1591 484 </div>
nickjillings@1591 485 </div>
nickjillings@1592 486 <button id="addAudioHolder" onclick="event.srcElement.parentElement.appendChild(audioHolderNode());">Add AudioHolder / Test Page</button>
nickjillings@1591 487 </div>
nickjillings@1591 488 </div>
nickjillings@2016 489 </div>
nickjillings@2016 490 </body>
nickjillings@2016 491 </html>