annotate interfaces/horizontal-sliders.js @ 1112:28aa066720ed

Fixed typo
author Giulio Moro <giuliomoro@yahoo.it>
date Sun, 21 Feb 2016 03:35:27 +0000
parents 282dfb8076f5
children b5bf2f57187c a4ad9e55b5b8
rev   line source
n@1106 1 // Once this is loaded and parsed, begin execution
n@1106 2 loadInterface();
n@1106 3
n@1106 4 function loadInterface() {
n@1106 5 // Use this to do any one-time page / element construction. For instance, placing any stationary text objects,
n@1106 6 // holding div's, or setting up any nodes which are present for the entire test sequence
n@1106 7
n@1106 8 // The injection point into the HTML page
n@1106 9 interfaceContext.insertPoint = document.getElementById("topLevelBody");
n@1106 10 var testContent = document.createElement('div');
n@1106 11 testContent.id = 'testContent';
n@1106 12
n@1106 13 // Create the top div for the Title element
n@1106 14 var titleAttr = specification.title;
n@1106 15 var title = document.createElement('div');
n@1106 16 title.className = "title";
n@1106 17 title.align = "center";
n@1106 18 var titleSpan = document.createElement('span');
n@1106 19
n@1106 20 // Set title to that defined in XML, else set to default
n@1106 21 if (titleAttr != undefined) {
n@1106 22 titleSpan.textContent = titleAttr;
n@1106 23 } else {
n@1106 24 titleSpan.textContent = 'Listening test';
n@1106 25 }
n@1106 26 // Insert the titleSpan element into the title div element.
n@1106 27 title.appendChild(titleSpan);
n@1106 28
n@1106 29 var pagetitle = document.createElement('div');
n@1106 30 pagetitle.className = "pageTitle";
n@1106 31 pagetitle.align = "center";
n@1106 32 var titleSpan = document.createElement('span');
n@1106 33 titleSpan.id = "pageTitle";
n@1106 34 pagetitle.appendChild(titleSpan);
n@1106 35
n@1106 36 // Create Interface buttons!
n@1106 37 var interfaceButtons = document.createElement('div');
n@1106 38 interfaceButtons.id = 'interface-buttons';
n@1106 39 interfaceButtons.style.height = '25px';
n@1106 40
n@1106 41 // Create playback start/stop points
n@1106 42 var playback = document.createElement("button");
n@1106 43 playback.innerHTML = 'Stop';
n@1106 44 playback.id = 'playback-button';
n@1106 45 playback.style.float = 'left';
n@1106 46 // onclick function. Check if it is playing or not, call the correct function in the
n@1106 47 // audioEngine, change the button text to reflect the next state.
n@1106 48 playback.onclick = function() {
n@1106 49 if (audioEngineContext.status == 1) {
n@1106 50 audioEngineContext.stop();
n@1106 51 this.innerHTML = 'Stop';
n@1106 52 var time = audioEngineContext.timer.getTestTime();
n@1106 53 console.log('Stopped at ' + time); // DEBUG/SAFETY
n@1106 54 }
n@1106 55 };
n@1106 56 // Create Submit (save) button
n@1106 57 var submit = document.createElement("button");
n@1106 58 submit.innerHTML = 'Submit';
n@1106 59 submit.onclick = buttonSubmitClick;
n@1106 60 submit.id = 'submit-button';
n@1106 61 submit.style.float = 'left';
n@1106 62 // Append the interface buttons into the interfaceButtons object.
n@1106 63 interfaceButtons.appendChild(playback);
n@1106 64 interfaceButtons.appendChild(submit);
n@1106 65
n@1106 66 // Create a slider box
n@1106 67 var sliderBox = document.createElement('div');
n@1106 68 sliderBox.style.width = "100%";
n@1106 69 sliderBox.style.height = window.innerHeight - 200+12 + 'px';
n@1106 70 sliderBox.style.marginBottom = '10px';
n@1106 71 sliderBox.id = 'slider';
n@1106 72 var scaleHolder = document.createElement('div');
n@1106 73 scaleHolder.id = "scale-holder";
n@1106 74 scaleHolder.style.marginLeft = "107px";
n@1106 75 sliderBox.appendChild(scaleHolder);
n@1106 76 var scaleText = document.createElement('div');
n@1106 77 scaleText.id = "scale-text-holder";
n@1106 78 scaleText.style.height = "25px";
n@1106 79 scaleText.style.width = "100%";
n@1106 80 scaleHolder.appendChild(scaleText);
n@1106 81 var scaleCanvas = document.createElement('canvas');
n@1106 82 scaleCanvas.id = "scale-canvas";
n@1106 83 scaleCanvas.style.marginLeft = "100px";
n@1106 84 scaleHolder.appendChild(scaleCanvas);
n@1106 85 var sliderObjectHolder = document.createElement('div');
n@1106 86 sliderObjectHolder.id = 'slider-holder';
n@1106 87 sliderObjectHolder.align = "center";
n@1106 88 sliderBox.appendChild(sliderObjectHolder);
n@1106 89
n@1106 90 // Global parent for the comment boxes on the page
n@1106 91 var feedbackHolder = document.createElement('div');
n@1106 92 feedbackHolder.id = 'feedbackHolder';
n@1106 93
n@1106 94 testContent.style.zIndex = 1;
n@1106 95 interfaceContext.insertPoint.innerHTML = null; // Clear the current schema
n@1106 96
n@1106 97 // Inject into HTML
n@1106 98 testContent.appendChild(title); // Insert the title
n@1106 99 testContent.appendChild(pagetitle);
n@1106 100 testContent.appendChild(interfaceButtons);
n@1106 101 testContent.appendChild(sliderBox);
n@1106 102 testContent.appendChild(feedbackHolder);
n@1106 103 interfaceContext.insertPoint.appendChild(testContent);
n@1106 104
n@1106 105 // Load the full interface
n@1106 106 testState.initialise();
n@1106 107 testState.advanceState();
n@1106 108 };
n@1106 109
n@1106 110 function loadTest(page)
n@1106 111 {
n@1106 112 // Called each time a new test page is to be build. The page specification node is the only item passed in
n@1106 113 var id = page.id;
n@1106 114
n@1106 115 var feedbackHolder = document.getElementById('feedbackHolder');
n@1106 116 feedbackHolder.innerHTML = null;
n@1106 117
n@1106 118 var interfaceObj = page.interfaces;
n@1106 119 if (interfaceObj.length > 1)
n@1106 120 {
n@1106 121 console.log("WARNING - This interface only supports one <interface> node per page. Using first interface node");
n@1106 122 }
n@1106 123 interfaceObj = interfaceObj[0];
n@1106 124 if(interfaceObj.title != null)
n@1106 125 {
n@1106 126 document.getElementById("pageTitle").textContent = interfaceObj.title;
n@1106 127 }
n@1106 128
n@1106 129 var interfaceOptions = specification.interfaces.options.concat(interfaceObj.options);
n@1106 130 for (var option of interfaceOptions)
n@1106 131 {
n@1106 132 if (option.type == "show")
n@1106 133 {
n@1106 134 switch(option.name) {
n@1106 135 case "playhead":
n@1106 136 var playbackHolder = document.getElementById('playback-holder');
n@1106 137 if (playbackHolder == null)
n@1106 138 {
n@1106 139 playbackHolder = document.createElement('div');
n@1106 140 playbackHolder.style.width = "100%";
n@1106 141 playbackHolder.align = 'center';
n@1106 142 playbackHolder.appendChild(interfaceContext.playhead.object);
n@1106 143 feedbackHolder.appendChild(playbackHolder);
n@1106 144 }
n@1106 145 break;
n@1106 146 case "page-count":
n@1106 147 var pagecountHolder = document.getElementById('page-count');
n@1106 148 if (pagecountHolder == null)
n@1106 149 {
n@1106 150 pagecountHolder = document.createElement('div');
n@1106 151 pagecountHolder.id = 'page-count';
n@1106 152 }
n@1106 153 pagecountHolder.innerHTML = '<span>Page '+(page.presentedId+1)+' of '+specification.pages.length+'</span>';
n@1106 154 var inject = document.getElementById('interface-buttons');
n@1106 155 inject.appendChild(pagecountHolder);
n@1106 156 break;
n@1106 157 case "volume":
n@1106 158 if (document.getElementById('master-volume-holder') == null)
n@1106 159 {
n@1106 160 feedbackHolder.appendChild(interfaceContext.volume.object);
n@1106 161 }
n@1106 162 break;
n@1106 163 }
n@1106 164 }
n@1106 165 }
n@1106 166
n@1106 167 // Delete outside reference
n@1106 168 var outsideReferenceHolder = document.getElementById('outside-reference');
n@1106 169 if (outsideReferenceHolder != null) {
n@1106 170 document.getElementById('interface-buttons').removeChild(outsideReferenceHolder);
n@1106 171 }
n@1106 172
n@1106 173 var sliderBox = document.getElementById('slider-holder');
n@1106 174 sliderBox.innerHTML = null;
n@1106 175
n@1106 176 var commentBoxPrefix = "Comment on track";
n@1106 177 if (interfaceObj.commentBoxPrefix != undefined) {
n@1106 178 commentBoxPrefix = interfaceObj.commentBoxPrefix;
n@1106 179 }
n@1106 180 var loopPlayback = page.loop;
n@1106 181
n@1106 182 $(page.commentQuestions).each(function(index,element) {
n@1106 183 var node = interfaceContext.createCommentQuestion(element);
n@1106 184 feedbackHolder.appendChild(node.holder);
n@1106 185 });
n@1106 186
n@1106 187 // Find all the audioElements from the audioHolder
n@1106 188 var label = 0;
n@1106 189 $(page.audioElements).each(function(index,element){
n@1106 190 // Find URL of track
n@1106 191 // In this jQuery loop, variable 'this' holds the current audioElement.
n@1106 192
n@1106 193 var audioObject = audioEngineContext.newTrack(element);
n@1106 194 if (element.type == 'outside-reference')
n@1106 195 {
n@1106 196 // Construct outside reference;
n@1106 197 var orNode = new outsideReferenceDOM(audioObject,index,document.getElementById('interface-buttons'));
n@1106 198 audioObject.bindInterface(orNode);
n@1106 199 } else {
n@1106 200 // Create a slider per track
n@1106 201 var sliderObj = new sliderObject(audioObject,label);
n@1106 202
n@1106 203 if (typeof page.initialPosition === "number")
n@1106 204 {
n@1106 205 // Set the values
n@1106 206 sliderObj.slider.value = page.initalPosition;
n@1106 207 } else {
n@1106 208 // Distribute it randomnly
n@1106 209 sliderObj.slider.value = Math.random();
n@1106 210 }
n@1106 211 sliderBox.appendChild(sliderObj.holder);
n@1106 212 audioObject.bindInterface(sliderObj);
n@1106 213 interfaceContext.createCommentBox(audioObject);
n@1106 214 label += 1;
n@1106 215 }
n@1106 216
n@1106 217 });
n@1106 218 if (page.showElementComments)
n@1106 219 {
n@1106 220 interfaceContext.showCommentBoxes(feedbackHolder,true);
n@1106 221 }
n@1106 222 // Auto-align
n@1106 223 resizeWindow(null);
n@1106 224 }
n@1106 225
n@1106 226 function sliderObject(audioObject,label)
n@1106 227 {
n@1106 228 // An example node, you can make this however you want for each audioElement.
n@1106 229 // However, every audioObject (audioEngineContext.audioObject) MUST have an interface object with the following
n@1106 230 // You attach them by calling audioObject.bindInterface( )
n@1106 231 this.parent = audioObject;
n@1106 232
n@1106 233 this.holder = document.createElement('div');
n@1106 234 this.title = document.createElement('div');
n@1106 235 this.slider = document.createElement('input');
n@1106 236 this.play = document.createElement('button');
n@1106 237
n@1106 238 this.holder.className = 'track-slider';
n@1106 239 this.holder.style.width = window.innerWidth-200 + 'px';
n@1106 240 this.holder.appendChild(this.title);
n@1106 241 this.holder.appendChild(this.slider);
n@1106 242 this.holder.appendChild(this.play);
n@1106 243 this.holder.setAttribute('trackIndex',audioObject.id);
n@1106 244 this.title.textContent = label;
n@1106 245 this.title.className = 'track-slider-title';
n@1106 246
n@1106 247 this.slider.type = "range";
n@1106 248 this.slider.className = "track-slider-range track-slider-not-moved";
n@1106 249 this.slider.min = "0";
n@1106 250 this.slider.max = "1";
n@1106 251 this.slider.step = "0.01";
n@1106 252 this.slider.style.width = window.innerWidth-420 + 'px';
n@1106 253 this.slider.onchange = function()
n@1106 254 {
n@1106 255 var time = audioEngineContext.timer.getTestTime();
n@1106 256 var id = Number(this.parentNode.getAttribute('trackIndex'));
n@1106 257 audioEngineContext.audioObjects[id].metric.moved(time,this.value);
n@1106 258 console.log('slider '+id+' moved to '+this.value+' ('+time+')');
n@1106 259 $(this).removeClass('track-slider-not-moved');
n@1106 260 };
n@1106 261
n@1106 262 this.play.className = 'track-slider-button';
n@1106 263 this.play.textContent = "Loading...";
n@1106 264 this.play.value = audioObject.id;
n@1106 265 this.play.disabled = true;
n@1106 266 this.play.setAttribute("playstate","ready");
n@1106 267 this.play.onclick = function(event)
n@1106 268 {
n@1106 269 var id = Number(event.currentTarget.value);
n@1106 270 //audioEngineContext.metric.sliderPlayed(id);
n@1106 271 if (event.currentTarget.getAttribute("playstate") == "ready")
n@1106 272 {audioEngineContext.play(id);}
n@1106 273 else if (event.currentTarget.getAttribute("playstate") == "playing")
n@1106 274 {audioEngineContext.stop();}
n@1106 275 };
n@1106 276 this.resize = function(event)
n@1106 277 {
n@1106 278 this.holder.style.width = window.innerWidth-200 + 'px';
n@1106 279 this.slider.style.width = window.innerWidth-420 + 'px';
n@1106 280 };
n@1106 281 this.enable = function()
n@1106 282 {
n@1106 283 // This is used to tell the interface object that playback of this node is ready
n@1106 284 this.play.disabled = false;
n@1106 285 this.play.textContent = "Play";
n@1106 286 $(this.slider).removeClass('track-slider-disabled');
n@1106 287 };
n@1106 288 this.updateLoading = function(progress)
n@1106 289 {
n@1106 290 // progress is a value from 0 to 100 indicating the current download state of media files
n@1106 291 };
n@1106 292 this.startPlayback = function()
n@1106 293 {
n@1106 294 // Called when playback has begun
n@1106 295 this.play.setAttribute("playstate","playing");
n@1106 296 $(".track-slider").removeClass('track-slider-playing');
n@1106 297 $(this.holder).addClass('track-slider-playing');
n@1106 298 var outsideReference = document.getElementById('outside-reference');
n@1106 299 if (outsideReference != null) {
n@1106 300 $(outsideReference).removeClass('track-slider-playing');
n@1106 301 }
n@1106 302 };
n@1106 303 this.stopPlayback = function()
n@1106 304 {
n@1106 305 // Called when playback has stopped. This gets called even if playback never started!
n@1106 306 this.play.setAttribute("playstate","ready");
n@1106 307 $(this.holder).removeClass('track-slider-playing');
n@1106 308 };
n@1106 309 this.getValue = function()
n@1106 310 {
n@1106 311 // Return the current value of the object. If there is no value, return 0
n@1106 312 return this.slider.value;
n@1106 313 };
n@1106 314 this.getPresentedId = function()
n@1106 315 {
n@1106 316 // Return the presented ID of the object. For instance, the APE has sliders starting from 0. Whilst AB has alphabetical scale
n@1106 317 return this.title.textContent;
n@1106 318 };
n@1106 319 this.canMove = function()
n@1106 320 {
n@1106 321 // Return either true or false if the interface object can be moved. AB / Reference cannot, whilst sliders can and therefore have a continuous scale.
n@1106 322 // These are checked primarily if the interface check option 'fragmentMoved' is enabled.
n@1106 323 return true;
n@1106 324 };
n@1106 325 this.exportXMLDOM = function(audioObject) {
n@1106 326 // Called by the audioObject holding this element to export the interface <value> node.
n@1106 327 // If there is no value node (such as outside reference), return null
n@1106 328 // If there are multiple value nodes (such as multiple scale / 2D scales), return an array of nodes with each value node having an 'interfaceName' attribute
n@1106 329 // Use storage.document.createElement('value'); to generate the XML node.
n@1106 330 var node = storage.document.createElement('value');
n@1106 331 node.textContent = this.slider.value;
n@1106 332 return node;
n@1106 333 };
n@1106 334 };
n@1106 335
n@1106 336 function outsideReferenceDOM(audioObject,index,inject)
n@1106 337 {
n@1106 338 this.parent = audioObject;
n@1106 339 this.outsideReferenceHolder = document.createElement('button');
n@1106 340 this.outsideReferenceHolder.id = 'outside-reference';
n@1106 341 this.outsideReferenceHolder.className = 'outside-reference';
n@1106 342 this.outsideReferenceHolder.setAttribute('track-id',index);
n@1106 343 this.outsideReferenceHolder.textContent = "Play Reference";
n@1106 344 this.outsideReferenceHolder.disabled = true;
n@1106 345
n@1106 346 this.outsideReferenceHolder.onclick = function(event)
n@1106 347 {
n@1106 348 audioEngineContext.play(event.currentTarget.getAttribute('track-id'));
n@1106 349 };
n@1106 350 inject.appendChild(this.outsideReferenceHolder);
n@1106 351 this.enable = function()
n@1106 352 {
n@1106 353 if (this.parent.state == 1)
n@1106 354 {
n@1106 355 this.outsideReferenceHolder.disabled = false;
n@1106 356 }
n@1106 357 };
n@1106 358 this.updateLoading = function(progress)
n@1106 359 {
n@1106 360 if (progress != 100)
n@1106 361 {
n@1106 362 progress = String(progress);
n@1106 363 progress = progress.split('.')[0];
n@1106 364 this.outsideReferenceHolder[0].children[0].textContent = progress+'%';
n@1106 365 } else {
n@1106 366 this.outsideReferenceHolder[0].children[0].textContent = "Play Reference";
n@1106 367 }
n@1106 368 };
n@1106 369 this.startPlayback = function()
n@1106 370 {
n@1106 371 // Called when playback has begun
n@1106 372 $('.track-slider').removeClass('track-slider-playing');
n@1106 373 $('.comment-div').removeClass('comment-box-playing');
n@1106 374 $(this.outsideReferenceHolder).addClass('track-slider-playing');
n@1106 375 };
n@1106 376 this.stopPlayback = function()
n@1106 377 {
n@1106 378 // Called when playback has stopped. This gets called even if playback never started!
n@1106 379 $(this.outsideReferenceHolder).removeClass('track-slider-playing');
n@1106 380 };
n@1106 381 this.exportXMLDOM = function(audioObject)
n@1106 382 {
n@1106 383 return null;
n@1106 384 };
n@1106 385 this.getValue = function()
n@1106 386 {
n@1106 387 return 0;
n@1106 388 };
n@1106 389 this.getPresentedId = function()
n@1106 390 {
n@1106 391 return 'reference';
n@1106 392 };
n@1106 393 this.canMove = function()
n@1106 394 {
n@1106 395 return false;
n@1106 396 };
n@1106 397 }
n@1106 398
n@1106 399 function resizeWindow(event)
n@1106 400 {
n@1106 401 // Called on every window resize event, use this to scale your page properly
n@1106 402
n@1106 403 var numObj = document.getElementsByClassName('track-slider').length;
n@1106 404 var totalHeight = (numObj * 125)-25;
n@1106 405 document.getElementById('scale-holder').style.width = window.innerWidth-220 + 'px';
n@1106 406 var canvas = document.getElementById('scale-canvas');
n@1106 407 canvas.width = window.innerWidth-420;
n@1106 408 canvas.height = totalHeight;
n@1106 409 for (var i in audioEngineContext.audioObjects)
n@1106 410 {
n@1106 411 if (audioEngineContext.audioObjects[i].specification.type != 'outside-reference'){
n@1106 412 audioEngineContext.audioObjects[i].interfaceDOM.resize(event);
n@1106 413 }
n@1106 414 }
n@1106 415 document.getElementById("slider").style.height = totalHeight+50+'px';
n@1106 416 drawScale();
n@1106 417 }
n@1106 418
n@1106 419 function drawScale()
n@1106 420 {
n@1106 421 var interfaceObj = testState.currentStateMap.interfaces[0];
n@1106 422 var scales = testState.currentStateMap.interfaces[0].scales;
n@1106 423 scales = scales.sort(function(a,b) {
n@1106 424 return a.position - b.position;
n@1106 425 });
n@1106 426 var canvas = document.getElementById('scale-canvas');
n@1106 427 var ctx = canvas.getContext("2d");
n@1106 428 var height = canvas.height;
n@1106 429 var width = canvas.width;
n@1106 430 var textHolder = document.getElementById('scale-text-holder');
n@1106 431 textHolder.innerHTML = null;
n@1106 432 ctx.fillStyle = "#000000";
n@1106 433 ctx.setLineDash([1,4]);
n@1106 434 for (var scale of scales)
n@1106 435 {
n@1106 436 var posPercent = scale.position / 100.0;
n@1106 437 var posPix = Math.round(width * posPercent);
n@1106 438 if(posPix<=0){posPix=1;}
n@1106 439 if(posPix>=width){posPix=width-1;}
n@1106 440 ctx.moveTo(posPix,0);
n@1106 441 ctx.lineTo(posPix,height);
n@1106 442 ctx.stroke();
n@1106 443
n@1106 444 var text = document.createElement('div');
n@1106 445 text.align = "center";
n@1106 446 var textC = document.createElement('span');
n@1106 447 textC.textContent = scale.text;
n@1106 448 text.appendChild(textC);
n@1106 449 text.className = "scale-text";
n@1106 450 textHolder.appendChild(text);
n@1106 451 text.style.width = Math.ceil($(text).width())+'px';
n@1106 452 text.style.left = (posPix+100-($(text).width()/2)) +'px';
n@1106 453 }
n@1106 454 }
n@1106 455
n@1106 456 function buttonSubmitClick() // TODO: Only when all songs have been played!
n@1106 457 {
n@1106 458 var checks = [];
n@1106 459 checks = checks.concat(testState.currentStateMap.interfaces[0].options);
n@1106 460 checks = checks.concat(specification.interfaces.options);
n@1106 461 var canContinue = true;
n@1106 462
n@1106 463 // Check that the anchor and reference objects are correctly placed
n@1106 464 if (interfaceContext.checkHiddenAnchor() == false) {return;}
n@1106 465 if (interfaceContext.checkHiddenReference() == false) {return;}
n@1106 466
n@1106 467 for (var i=0; i<checks.length; i++) {
n@1106 468 if (checks[i].type == 'check')
n@1106 469 {
n@1106 470 switch(checks[i].name) {
n@1106 471 case 'fragmentPlayed':
n@1106 472 // Check if all fragments have been played
n@1106 473 var checkState = interfaceContext.checkAllPlayed();
n@1106 474 if (checkState == false) {canContinue = false;}
n@1106 475 break;
n@1106 476 case 'fragmentFullPlayback':
n@1106 477 // Check all fragments have been played to their full length
n@1106 478 var checkState = interfaceContext.checkAllPlayed();
n@1106 479 if (checkState == false) {canContinue = false;}
n@1106 480 console.log('NOTE: fragmentFullPlayback not currently implemented, performing check fragmentPlayed instead');
n@1106 481 break;
n@1106 482 case 'fragmentMoved':
n@1106 483 // Check all fragment sliders have been moved.
n@1106 484 var checkState = interfaceContext.checkAllMoved();
n@1106 485 if (checkState == false) {canContinue = false;}
n@1106 486 break;
n@1106 487 case 'fragmentComments':
n@1106 488 // Check all fragment sliders have been moved.
n@1106 489 var checkState = interfaceContext.checkAllCommented();
n@1106 490 if (checkState == false) {canContinue = false;}
n@1106 491 break;
n@1106 492 //case 'scalerange':
n@1106 493 // Check the scale is used to its full width outlined by the node
n@1106 494 //var checkState = interfaceContext.checkScaleRange();
n@1106 495 //if (checkState == false) {canContinue = false;}
n@1106 496 // break;
n@1106 497 default:
n@1106 498 console.log("WARNING - Check option "+checks[i].check+" is not supported on this interface");
n@1106 499 break;
n@1106 500 }
n@1106 501
n@1106 502 }
n@1106 503 if (!canContinue) {break;}
n@1106 504 }
n@1106 505
n@1106 506 if (canContinue) {
n@1106 507 if (audioEngineContext.status == 1) {
n@1106 508 var playback = document.getElementById('playback-button');
n@1106 509 playback.click();
n@1106 510 // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options
n@1106 511 } else
n@1106 512 {
n@1106 513 if (audioEngineContext.timer.testStarted == false)
n@1106 514 {
n@1106 515 alert('You have not started the test! Please press start to begin the test!');
n@1106 516 return;
n@1106 517 }
n@1106 518 }
n@1106 519 testState.advanceState();
n@1106 520 }
n@1106 521 }
n@1106 522
n@1106 523 function pageXMLSave(store, pageSpecification)
n@1106 524 {
n@1106 525 // MANDATORY
n@1106 526 // Saves a specific test page
n@1106 527 // You can use this space to add any extra nodes to your XML <audioHolder> saves
n@1106 528 // Get the current <page> information in store (remember to appendChild your data to it)
n@1106 529 // pageSpecification is the current page node configuration
n@1106 530 // To create new XML nodes, use storage.document.createElement();
n@1106 531 }