annotate test_create/test_create.html @ 923:7a7a72880996

Merge from the default branch
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 02 Jun 2015 11:24:23 +0100
parents 95ff666edb66
children 2dc00907c6ab
rev   line source
n@921 1 <!DOCTYPE html>
n@921 2 <html lang="en">
n@921 3 <head>
n@921 4 <meta charset="utf-8">
n@921 5
n@921 6 <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
n@921 7 Remove this if you use the .htaccess -->
n@921 8 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
n@921 9
n@921 10 <title>WAET Create Test</title>
n@921 11 <meta name="description" content="">
n@921 12 <meta name="author" content="">
n@921 13
n@921 14 <meta name="viewport" content="width=device-width; initial-scale=1.0">
n@921 15
n@921 16 <script type="text/javascript">
n@921 17 // To aid 'one-page set-up' all scripts and CSS must be included directly in this file!
n@921 18 var topLevel;
n@921 19 window.onload = function() {
n@921 20 // Initialise page
n@921 21 topLevel = document.getElementById('topLevelBody');
n@921 22 var setup = document.createElement('div');
n@921 23 setup.id = 'setupTagDiv';
n@921 24
n@921 25 };
n@921 26
n@921 27 function attributePair(string, type){
n@921 28 var id = document.createElement("span");
n@921 29 id.textContent = string;
n@921 30 var input = document.createElement("input");
n@921 31 input.type = type;
n@921 32 return [id, input];
n@921 33 }
n@921 34
n@922 35 function removeNode(event) {
n@922 36 event.srcElement.parentElement.parentElement.removeChild(event.srcElement.parentElement);
n@922 37 }
n@922 38
n@921 39 function questionNode() {
n@921 40 var node = document.createElement("div");
n@921 41 node.setAttribute('class','head');
n@921 42 node.setAttribute('name','question-node');
n@921 43 var nodeTitle = document.createElement("span");
n@921 44 nodeTitle.textContent = "Question";
n@921 45 var attributes = document.createElement("div");
n@921 46 attributes.setAttribute('class','attrib');
n@921 47 var id = attributePair("ID:","text");
n@921 48 var question = attributePair("Question:","text");
n@921 49 node.appendChild(nodeTitle);
n@921 50 id.forEach(function(item){attributes.appendChild(item);},false);
n@921 51 question.forEach(function(item){attributes.appendChild(item);},false);
n@921 52 node.appendChild(attributes);
n@922 53
n@922 54 var removeButton = document.createElement("button");
n@922 55 removeButton.textContent = "Remove";
n@922 56 removeButton.onclick = removeNode;
n@922 57 node.appendChild(removeButton);
n@921 58 return node;
n@921 59 }
n@921 60
n@921 61 function statementNode() {
n@921 62 var node = document.createElement("div");
n@921 63 node.setAttribute('class','head');
n@921 64 node.setAttribute('name','question-node');
n@921 65 var nodeTitle = document.createElement("span");
n@921 66 nodeTitle.textContent = "Statement";
n@921 67 var attributes = document.createElement("div");
n@921 68 attributes.setAttribute('class','attrib');
n@921 69 var statement = attributePair("Statement:","text");
n@921 70 node.appendChild(nodeTitle);
n@921 71 statement.forEach(function(item){attributes.appendChild(item);},false);
n@921 72 node.appendChild(attributes);
n@922 73
n@922 74 var removeButton = document.createElement("button");
n@922 75 removeButton.textContent = "Remove";
n@922 76 removeButton.onclick = removeNode;
n@922 77 node.appendChild(removeButton);
n@921 78 return node;
n@921 79 }
n@921 80
n@921 81 function audioHolderNode() {
n@921 82 var audioHolderCounts = document.getElementsByName("audio-holder").length;
n@921 83 var node = document.createElement("div");
n@921 84 node.setAttribute("class","head");
n@921 85 node.setAttribute("name","audio-holder");
n@922 86 node.setAttribute("id","audio-holder-"+audioHolderCounts);
n@921 87 var nodeTitle = document.createElement("span");
n@922 88 nodeTitle.textContent = "Audio Holder "+(audioHolderCounts+1);
n@921 89
n@921 90 var attributes = document.createElement("div");
n@921 91 attributes.setAttribute('class','attrib');
n@921 92 var id = attributePair("ID:","text");
n@922 93 id[1].value=audioHolderCounts;
n@922 94 var hostURL = attributePair("Host URL:", "text");
n@922 95 var sampleRate = attributePair("Sample Rate:","text");
n@922 96 var randomiseOrder = attributePair("Randomise Element Order:","checkbox");
n@922 97 var repeatCount = attributePair("Repeat Page Count:","number");
n@922 98 repeatCount[1].value = 0;
n@922 99 var loop = attributePair("Loop Element Playback","checkbox");
n@922 100 var elementComments = attributePair("Enable Comment Boxes","checkbox");
n@922 101 id.forEach(function(item){attributes.appendChild(item);},false);
n@922 102 hostURL.forEach(function(item){attributes.appendChild(item);},false);
n@922 103 sampleRate.forEach(function(item){attributes.appendChild(item);},false);
n@922 104 hostURL.forEach(function(item){attributes.appendChild(item);},false);
n@922 105 randomiseOrder.forEach(function(item){attributes.appendChild(item);},false);
n@922 106 repeatCount.forEach(function(item){attributes.appendChild(item);},false);
n@922 107 loop.forEach(function(item){attributes.appendChild(item);},false);
n@922 108 elementComments.forEach(function(item){attributes.appendChild(item);},false);
n@922 109
n@922 110 node.appendChild(nodeTitle);
n@922 111 node.appendChild(attributes);
n@922 112
n@922 113 var pretest = document.createElement("div");
n@922 114 pretest.setAttribute('class','head');
n@922 115 pretest.setAttribute('name','pre-test');
n@922 116 var pretestTitle = document.createElement("h4");
n@922 117 pretestTitle.textContent = "Pre Test";
n@922 118 var buttonAddQ = document.createElement("button");
n@922 119 buttonAddQ.textContent = "Add Pre Test Question";
n@922 120 buttonAddQ.onclick = function(){event.srcElement.parentElement.appendChild(questionNode());};
n@922 121 var buttonAddS = document.createElement("button");
n@922 122 buttonAddS.textContent = "Add Pre Test Statement";
n@922 123 buttonAddS.onclick = function(){event.srcElement.parentElement.appendChild(statementNode());};
n@922 124 pretest.appendChild(pretestTitle);
n@922 125 pretest.appendChild(buttonAddQ);
n@922 126 pretest.appendChild(buttonAddS);
n@922 127
n@922 128 var posttest = document.createElement("div");
n@922 129 posttest.setAttribute('class','head');
n@922 130 posttest.setAttribute('name','post-test');
n@922 131 var posttestTitle = document.createElement("h4");
n@922 132 posttestTitle.textContent = "Post Test";
n@922 133 var buttonAddQ = document.createElement("button");
n@922 134 buttonAddQ.textContent = "Add Post Test Question";
n@922 135 buttonAddQ.onclick = function(){event.srcElement.parentElement.appendChild(questionNode());};
n@922 136 var buttonAddS = document.createElement("button");
n@922 137 buttonAddS.textContent = "Add Post Test Statement";
n@922 138 buttonAddS.onclick = function(){event.srcElement.parentElement.appendChild(statementNode());};
n@922 139 posttest.appendChild(posttestTitle);
n@922 140 posttest.appendChild(buttonAddQ);
n@922 141 posttest.appendChild(buttonAddS);
n@922 142
n@922 143 node.appendChild(pretest);
n@922 144 node.appendChild(posttest);
n@922 145
n@922 146 var newAudioElementButton = document.createElement("button");
n@922 147 newAudioElementButton.textContent = "Add audio element";
n@922 148 newAudioElementButton.onclick = function(){
n@922 149 event.srcElement.parentElement.appendChild(audioElementNode());
n@922 150 };
n@922 151 node.appendChild(newAudioElementButton);
n@922 152
n@922 153 var newCommentButton = document.createElement("button");
n@922 154 newCommentButton.textContent = "Add Comment Box";
n@922 155 newCommentButton.onclick = function() {
n@922 156 event.srcElement.parentElement.appendChild(commentBox());
n@922 157 };
n@922 158 node.appendChild(newCommentButton);
n@922 159
n@922 160 var removeButton = document.createElement("button");
n@922 161 removeButton.textContent = "Remove Audio Holder";
n@922 162 removeButton.onclick = removeNode;
n@922 163 node.appendChild(removeButton);
n@922 164 return node;
n@922 165 }
n@922 166
n@922 167 function audioElementNode() {
n@922 168 var parentStructure = event.srcElement.parentElement.childNodes;
n@922 169 var audioElemCounts = 0;
n@922 170 for (var i=0; i<parentStructure.length; i++) {
n@922 171 if (parentStructure[i].getAttribute('name') == "audio-element")
n@922 172 {audioElemCounts++;}
n@922 173 }
n@922 174 var node = document.createElement('div');
n@922 175 node.setAttribute('class','head');
n@922 176 node.setAttribute('name','audio-element');
n@922 177 var nodeTitle = document.createElement('span');
n@922 178 nodeTitle.textContent = 'Audio Element '+(audioElemCounts+1);
n@922 179
n@922 180 var attributes = document.createElement("div");
n@922 181 attributes.setAttribute('class','attrib');
n@922 182 var id = attributePair("ID:","text");
n@922 183 id[1].value = audioElemCounts;
n@922 184 var url = attributePair("URL:","text");
n@922 185 id.forEach(function(item){attributes.appendChild(item);},false);
n@922 186 url.forEach(function(item){attributes.appendChild(item);},false);
n@922 187
n@922 188 node.appendChild(nodeTitle);
n@922 189 node.appendChild(attributes);
n@922 190
n@922 191 var removeButton = document.createElement("button");
n@922 192 removeButton.textContent = "Remove Audio Element";
n@922 193 removeButton.onclick = removeNode;
n@922 194 node.appendChild(removeButton);
n@922 195 return node;
n@922 196 }
n@922 197
n@922 198 function commentBox() {
n@922 199 var node = document.createElement('div');
n@922 200 node.setAttribute('class','head');
n@922 201 node.setAttribute('name','comment-question');
n@922 202 var nodeTitle = document.createElement('h4');
n@922 203 nodeTitle.textContent = "Comment Box";
n@922 204
n@922 205 var attributes = document.createElement('div');
n@922 206 attributes.setAttribute('class','attrib');
n@922 207 var id = attributePair("ID:",'text');
n@922 208 var question = attributePair("Question:",'text');
n@922 209 id.forEach(function(item){attributes.appendChild(item);},false);
n@922 210 question.forEach(function(item){attributes.appendChild(item);},false);
n@922 211
n@922 212 var removeButton = document.createElement("button");
n@922 213 removeButton.textContent = "Remove Comment Box";
n@922 214 removeButton.onclick = removeNode;
n@922 215
n@922 216 node.appendChild(nodeTitle);
n@922 217 node.appendChild(attributes);
n@922 218 node.appendChild(removeButton);
n@922 219 return node;
n@921 220 }
n@921 221 </script>
n@921 222 <style>
n@921 223 div {
n@921 224 padding: 2px;
n@921 225 margin-top: 2px;
n@921 226 margin-bottom: 2px;
n@921 227 }
n@921 228 div.head{
n@921 229 margin-left: 10px;
n@921 230 border: black;
n@921 231 border-width: 2px;
n@921 232 border-style: solid;
n@921 233 }
n@921 234 div.attrib{
n@921 235 margin-left:25px;
n@921 236 border: black;
n@921 237 border-width: 2px;
n@921 238 border-style: dashed;
n@921 239 margin-bottom: 10px;
n@921 240 }
n@921 241 </style>
n@921 242
n@921 243 </head>
n@921 244
n@921 245 <body>
n@921 246 <h1>Create Test Setup XML</h1>
n@921 247 <div id="topLevelBody" align="left">
n@921 248 <!-- Interface goes here -->
n@921 249 <div name='test-setup'>
n@921 250 <div id="setup" class="head">
n@921 251 <h2>Setup Tag</h2>
n@921 252 <div id="setup-attribs" class="attrib">
n@921 253 <span>Interface</span>
n@921 254 <select id="interface">
n@921 255 <option value='APE'>APE</option>
n@921 256 </select>
n@921 257 <span>Project Return</span>
n@921 258 <input type="text" id="projectReturn">
n@921 259 <span>Randomise Test Page Order</span>
n@921 260 <input id="randomisePageOrder" type="checkbox" value="false">
n@921 261 <span>Collect Session Metrics</span>
n@921 262 <input id="collectMetrics" type="checkbox">
n@921 263 </div>
n@921 264 <div id="globalPreTest" class="head">
n@921 265 <h3>Pre Test</h3>
n@921 266 <button id="addPreTestQ" onclick="event.srcElement.parentElement.appendChild(questionNode());">Add Pre Test Question</button>
n@921 267 <button id="addPreTestS" onclick="event.srcElement.parentElement.appendChild(statementNode());">Add Pre Test Statement</button>
n@921 268 </div>
n@921 269 <div id="globalPostTest" class="head">
n@921 270 <h3>Post Test</h3>
n@921 271 <button id="addPreTestQ" onclick="event.srcElement.parentElement.appendChild(questionNode());">Add Post Test Question</button>
n@921 272 <button id="addPreTestS" onclick="event.srcElement.parentElement.appendChild(statementNode());">Add Post Test Statement</button>
n@921 273 </div>
n@921 274 <div id="globalMetric" class="head">
n@921 275 <h3>Global Metrics</h3>
n@921 276 <div id="globalMetric-attrib" class="attrib">
n@921 277 <span>Test Timer</span>
n@921 278 <input type="checkbox" id="testTimer" />
n@921 279 <span>Element Playback Timer</span>
n@921 280 <input type="checkbox" id="elementTimer" />
n@921 281 <span>Element Initial Position</span>
n@921 282 <input type="checkbox" id="elementInitialPosition" />
n@921 283 <span>Element Tracker</span>
n@921 284 <input type="checkbox" id="elementTracker" />
n@921 285 <span>Element Flag Listened To</span>
n@921 286 <input type="checkbox" id="elementFlagListened" />
n@921 287 <span>Element Flag Moved</span>
n@921 288 <input type="checkbox" id="elementFlagMoved" />
n@921 289 </div>
n@921 290 </div>
n@922 291 <button id="addAudioHolder" onclick="event.srcElement.parentElement.appendChild(audioHolderNode());">Add AudioHolder / Test Page</button>
n@921 292 </div>
n@921 293 </div>
n@921 294 </div>
n@921 295 </body>
n@921 296 </html>