# HG changeset patch # User Nicholas Jillings # Date 1429724224 -3600 # Node ID 4924b57165c23ca61015aa69649a6de2cf89bfe1 # Parent 438468ff317e6b66d95bc989850cf7a726cd6332# Parent c6bff12144a0251702ea01fba14d9ec73823e017 Version 1.0 Release! diff -r 438468ff317e -r 4924b57165c2 ape.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ape.css Wed Apr 22 18:37:04 2015 +0100 @@ -0,0 +1,101 @@ +/* + * Hold any style information for APE interface. Customise if you like to make the interface your own! + * + */ +body { + /* Set the background colour (note US English spelling) to grey*/ + background-color: #ddd +} + +div.title { + /* Specify any colouring for the title */ +} + +div.pageTitle { + width: auto; + height: 20px; +} + +div.testHalt { + /* Specify any colouring during the test halt for pre/post questions */ + background-color: rgba(0,0,0,0.5); + /* Don't mess with this bit */ + z-index: 2; + width: 100%; + height: 100%; + position: absolute; + left: 0px; + top: 0px; +} + +button { + /* Specify any button structure or style */ + min-width: 20px; + background-color: #ddd +} + +div#slider { + /* Specify any structure for the slider holder interface */ + background-color: #eee; + height: 150px; + margin-bottom: 5px; +} + +div.sliderScale { + width: 100%; + min-height: 20px; +} + +div.sliderScale span { + /* Any formatting of text below scale */ + min-width: 5px; + height: 20px; + height: 100%; + position: absolute; +} + +div.track-slider { + /* Specify any strcture for the slider objects */ + position: absolute; + height: inherit; + width: 12px; + float: left; + background-color: rgb(100,200,100); +} + +div.comment-div { + border:#444444; + border-style:solid; + border-width:1px; + width: 624px; + float: left; + margin: 5px; +} + +div.comment-div span { + margin-left: 15px; +} + +div.popupHolder { + width: 500px; + height: 250px; + background-color: #fff; + border-radius: 10px; + box-shadow: 0px 0px 50px #000; + z-index: 2; +} + +button.popupButton { + /* Button for popup window + */ + width: 50px; + height: 25px; + position: absolute; + left: 440px; + top: 215px; + border-radius: 5px; + border: #444; + border-width: 1px; + border-style: solid; + background-color: #fff; +} diff -r 438468ff317e -r 4924b57165c2 ape.js --- a/ape.js Fri Apr 10 10:20:52 2015 +0100 +++ b/ape.js Wed Apr 22 18:37:04 2015 +0100 @@ -3,6 +3,14 @@ * Create the APE interface */ +var currentState; // Keep track of the current state (pre/post test, which test, final test? first test?) +// preTest - In preTest state +// testRun-ID - In test running, test Id number at the end 'testRun-2' +// testRunPost-ID - Post test of test ID +// testRunPre-ID - Pre-test of test ID +// postTest - End of test, final submission! + + // Once this is loaded and parsed, begin execution loadInterface(projectXML); @@ -12,9 +20,6 @@ var width = window.innerWidth; var height = window.innerHeight; - // Set background to grey #ddd - document.getElementsByTagName('body')[0].style.backgroundColor = '#ddd'; - // The injection point into the HTML page var insertPoint = document.getElementById("topLevelBody"); var testContent = document.createElement('div'); @@ -26,6 +31,104 @@ var xmlSetup = xmlDoc.find('setup'); // Should put in an error function here incase of malprocessed or malformed XML + // Extract the different test XML DOM trees + var audioHolders = xmlDoc.find('audioHolder'); + audioHolders.each(function(index,element) { + var repeatN = element.attributes['repeatCount'].value; + for (var r=0; r<=repeatN; r++) { + testXMLSetups[testXMLSetups.length] = element; + } + }); + + // New check if we need to randomise the test order + var randomise = xmlSetup[0].attributes['randomiseOrder']; + if (randomise != undefined) { + randomise = Boolean(randomise.value); + } else { + randomise = false; + } + if (randomise) + { + testXMLSetups = randomiseOrder(testXMLSetups); + } + + // Obtain the metrics enabled + var metricNode = xmlSetup.find('Metric'); + var metricNode = metricNode.find('metricEnable'); + metricNode.each(function(index,node){ + var enabled = node.textContent; + switch(enabled) + { + case 'testTimer': + sessionMetrics.prototype.enableTestTimer = true; + break; + case 'elementTimer': + sessionMetrics.prototype.enableElementTimer = true; + break; + case 'elementTracker': + sessionMetrics.prototype.enableElementTracker = true; + break; + case 'elementInitalPosition': + sessionMetrics.prototype.enableElementInitialPosition = true; + break; + case 'elementFlagListenedTo': + sessionMetrics.prototype.enableFlagListenedTo = true; + break; + case 'elementFlagMoved': + sessionMetrics.prototype.enableFlagMoved = true; + break; + case 'elementFlagComments': + sessionMetrics.prototype.enableFlagComments = true; + break; + } + }); + + // Create APE specific metric functions + audioEngineContext.metric.initialiseTest = function() + { + var sliders = document.getElementsByClassName('track-slider'); + for (var i=0; i= 0) + { + audioEngineContext.audioObjects[this.lastClicked].metric.listening(time); + } + this.lastClicked = id; + audioEngineContext.audioObjects[id].metric.listening(time); + } + }; + // Create the top div for the Title element var titleAttr = xmlSetup[0].attributes['title']; var title = document.createElement('div'); @@ -42,6 +145,13 @@ // Insert the titleSpan element into the title div element. title.appendChild(titleSpan); + var pagetitle = document.createElement('div'); + pagetitle.className = "pageTitle"; + pagetitle.align = "center"; + var titleSpan = document.createElement('span'); + titleSpan.id = "pageTitle"; + pagetitle.appendChild(titleSpan); + // Store the return URL path in global projectReturn projectReturn = xmlSetup[0].attributes['projectReturn'].value; @@ -57,6 +167,7 @@ // Create playback start/stop points var playback = document.createElement("button"); playback.innerHTML = 'Start'; + playback.id = 'playback-button'; // onclick function. Check if it is playing or not, call the correct function in the // audioEngine, change the button text to reflect the next state. playback.onclick = function() { @@ -71,10 +182,8 @@ // Create Submit (save) button var submit = document.createElement("button"); submit.innerHTML = 'Submit'; - submit.onclick = function() { - // TODO: Update this for postTest tags - createProjectSave(projectReturn) - }; + submit.onclick = buttonSubmitClick; + submit.id = 'submit-button'; // Append the interface buttons into the interfaceButtons object. interfaceButtons.appendChild(playback); interfaceButtons.appendChild(submit); @@ -93,26 +202,103 @@ canvas.id = 'slider'; // Must have a known EXACT width, as this is used later to determine the ratings canvas.style.width = width - 100 +"px"; - canvas.style.height = 150 + "px"; - canvas.style.marginBottom = "25px"; - canvas.style.backgroundColor = '#eee'; canvas.align = "left"; sliderBox.appendChild(canvas); + // Create the div to hold any scale objects + var scale = document.createElement('div'); + scale.className = 'sliderScale'; + scale.id = 'sliderScaleHolder'; + scale.align = 'left'; + sliderBox.appendChild(scale); + // Global parent for the comment boxes on the page var feedbackHolder = document.createElement('div'); - // Find the parent audioHolder object. - var audioHolder = xmlDoc.find('audioHolder'); - audioHolder = audioHolder[0]; // Remove from one field array + feedbackHolder.id = 'feedbackHolder'; + + testContent.style.zIndex = 1; + insertPoint.innerHTML = null; // Clear the current schema + + // Create pre and post test questions + var blank = document.createElement('div'); + blank.className = 'testHalt'; + + var popupHolder = document.createElement('div'); + popupHolder.id = 'popupHolder'; + popupHolder.className = 'popupHolder'; + popupHolder.style.position = 'absolute'; + popupHolder.style.left = (window.innerWidth/2)-250 + 'px'; + popupHolder.style.top = (window.innerHeight/2)-125 + 'px'; + insertPoint.appendChild(popupHolder); + insertPoint.appendChild(blank); + hidePopup(); + + var preTest = xmlSetup.find('PreTest'); + var postTest = xmlSetup.find('PostTest'); + preTest = preTest[0]; + postTest = postTest[0]; + + currentState = 'preTest'; + + // Create Pre-Test Box + if (preTest != undefined && preTest.children.length >= 1) + { + showPopup(); + preTestPopupStart(preTest); + } + + // Inject into HTML + testContent.appendChild(title); // Insert the title + testContent.appendChild(pagetitle); + testContent.appendChild(interfaceButtons); + testContent.appendChild(sliderBox); + testContent.appendChild(feedbackHolder); + insertPoint.appendChild(testContent); + + // Load the full interface + +} + +function loadTest(id) +{ + // Used to load a specific test page + var textXML = testXMLSetups[id]; + + var feedbackHolder = document.getElementById('feedbackHolder'); + var canvas = document.getElementById('slider'); + feedbackHolder.innerHTML = null; + canvas.innerHTML = null; + + // Setup question title + var interfaceObj = $(textXML).find('interface'); + var titleNode = interfaceObj.find('title'); + if (titleNode[0] != undefined) + { + document.getElementById('pageTitle').textContent = titleNode[0].textContent; + } + var positionScale = canvas.style.width.substr(0,canvas.style.width.length-2); + var offset = 50-8; // Half the offset of the slider (window width -100) minus the body padding of 8 + // TODO: AUTOMATE ABOVE!! + var scale = document.getElementById('sliderScaleHolder'); + scale.innerHTML = null; + interfaceObj.find('scale').each(function(index,scaleObj){ + var position = Number(scaleObj.attributes['position'].value)*0.01; + var pixelPosition = (position*positionScale)+offset; + var scaleDOM = document.createElement('span'); + scaleDOM.textContent = scaleObj.textContent; + scale.appendChild(scaleDOM); + scaleDOM.style.left = Math.floor((pixelPosition-($(scaleDOM).width()/2)))+'px'; + }); + // Extract the hostURL attribute. If not set, create an empty string. - var hostURL = audioHolder.attributes['hostURL']; + var hostURL = textXML.attributes['hostURL']; if (hostURL == undefined) { hostURL = ""; } else { hostURL = hostURL.value; } // Extract the sampleRate. If set, convert the string to a Number. - var hostFs = audioHolder.attributes['sampleRate']; + var hostFs = textXML.attributes['sampleRate']; if (hostFs != undefined) { hostFs = Number(hostFs.value); } @@ -125,215 +311,620 @@ return; } } + + var commentShow = textXML.attributes['elementComments']; + if (commentShow != undefined) { + if (commentShow.value == 'false') {commentShow = false;} + else {commentShow = true;} + } else {commentShow = true;} + + var loopPlayback = textXML.attributes['loop']; + if (loopPlayback != undefined) + { + loopPlayback = loopPlayback.value; + if (loopPlayback == 'true') { + loopPlayback = true; + } else { + loopPlayback = false; + } + } else { + loopPlayback = false; + } + audioEngineContext.loopPlayback = loopPlayback; + + // Create AudioEngine bindings for playback + if (loopPlayback) { + audioEngineContext.play = function() { + // Send play command to all playback buffers for synchronised start + // Also start timer callbacks to detect if playback has finished + if (this.status == 0) { + this.timer.startTest(); + // First get current clock + var timer = audioContext.currentTime; + // Add 3 seconds + timer += 3.0; + // Send play to all tracks + for (var i=0; i'; - trackSliderObj.style.float = "left"; trackSliderObj.draggable = true; trackSliderObj.ondragend = dragEnd; + trackSliderObj.ondragstart = function() + { + var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! + audioEngineContext.metric.sliderMoveStart(id); + }; // Onclick, switch playback to that track trackSliderObj.onclick = function() { // Get the track ID from the object ID var id = Number(this.id.substr(13,2)); // Maximum theoretical tracks is 99! + audioEngineContext.metric.sliderPlayed(id); audioEngineContext.selectedTrack(id); }; canvas.appendChild(trackSliderObj); }); + // Append any commentQuestion boxes + var commentQuestions = $(textXML).find('CommentQuestion'); + $(commentQuestions).each(function(index,element) { + // Create document objects to hold the comment boxes + var trackComment = document.createElement('div'); + trackComment.className = 'comment-div commentQuestion'; + trackComment.id = element.attributes['id'].value; + // Create a string next to each comment asking for a comment + var trackString = document.createElement('span'); + trackString.innerHTML = element.textContent; + // Create the HTML5 comment box 'textarea' + var trackCommentBox = document.createElement('textarea'); + trackCommentBox.rows = '4'; + trackCommentBox.cols = '100'; + trackCommentBox.name = 'commentQuestion'+index; + trackCommentBox.className = 'trackComment'; + var br = document.createElement('br'); + // Add to the holder. + trackComment.appendChild(trackString); + trackComment.appendChild(br); + trackComment.appendChild(trackCommentBox); + feedbackHolder.appendChild(trackComment); + }); - // Create pre and post test questions + // Now process any pre-test commands - // Inject into HTML - insertPoint.innerHTML = null; // Clear the current schema - testContent.appendChild(title); // Insert the title - testContent.appendChild(interfaceButtons); - testContent.appendChild(sliderBox); - testContent.appendChild(feedbackHolder); - insertPoint.appendChild(testContent); + var preTest = $(testXMLSetups[id]).find('PreTest')[0]; + if (preTest.children.length > 0) + { + currentState = 'testRunPre-'+id; + preTestPopupStart(preTest); + showPopup(); + } else { + currentState = 'testRun-'+id; + } +} + +function preTestPopupStart(preTest) +{ + var popupHolder = document.getElementById('popupHolder'); + popupHolder.innerHTML = null; + // Parse the first box + var preTestOption = document.createElement('div'); + preTestOption.id = 'preTest'; + preTestOption.style.marginTop = '25px'; + preTestOption.align = "center"; + var child = preTest.children[0]; + if (child.nodeName == 'statement') + { + preTestOption.innerHTML = ''+child.innerHTML+''; + } else if (child.nodeName == 'question') + { + var questionId = child.attributes['id'].value; + var textHold = document.createElement('span'); + textHold.innerHTML = child.innerHTML; + textHold.id = questionId + 'response'; + var textEnter = document.createElement('textarea'); + preTestOption.appendChild(textHold); + preTestOption.appendChild(textEnter); + } + var nextButton = document.createElement('button'); + nextButton.className = 'popupButton'; + nextButton.value = '0'; + nextButton.innerHTML = 'Next'; + nextButton.onclick = popupButtonClick; - var preTest = xmlDoc.find('PreTest'); - var postTest = xmlDoc.find('PostTest'); - preTest = preTest[0]; - postTest = postTest[0]; - if (preTest != undefined || postTest != undefined) + popupHolder.appendChild(preTestOption); + popupHolder.appendChild(nextButton); +} + +function popupButtonClick() +{ + // Global call from the 'Next' button click + if (currentState == 'preTest') { - testContent.style.zIndex = 1; - var blank = document.createElement('div'); - blank.id = 'testHalt'; - blank.style.zIndex = 2; - blank.style.width = window.innerWidth + 'px'; - blank.style.height = window.innerHeight + 'px'; - blank.style.position = 'absolute'; - blank.style.top = '0'; - blank.style.left = '0'; - insertPoint.appendChild(blank); + // At the start of the preTest routine! + var xmlTree = projectXML.find('setup'); + var preTest = xmlTree.find('PreTest')[0]; + this.value = preTestButtonClick(preTest,this.value); + } else if (currentState.substr(0,10) == 'testRunPre') + { + //Specific test pre-test + var testId = currentState.substr(11,currentState.length-10); + var preTest = $(testXMLSetups[testId]).find('PreTest')[0]; + this.value = preTestButtonClick(preTest,this.value); + } else if (currentState.substr(0,11) == 'testRunPost') + { + // Specific test post-test + var testId = currentState.substr(12,currentState.length-11); + var preTest = $(testXMLSetups[testId]).find('PostTest')[0]; + this.value = preTestButtonClick(preTest,this.value); + } else if (currentState == 'postTest') + { + // At the end of the test, running global post test + var xmlTree = projectXML.find('setup'); + var PostTest = xmlTree.find('PostTest')[0]; + this.value = preTestButtonClick(PostTest,this.value); } - - // Create Pre-Test Box - if (preTest != undefined && preTest.children.length >= 1) +} + +function preTestButtonClick(preTest,index) +{ + // Called on click of pre-test button + // Need to find and parse preTest again! + var preTestOption = document.getElementById('preTest'); + // Check if current state is a question! + if (preTest.children[index].nodeName == 'question') { + var questionId = preTest.children[index].attributes['id'].value; + var questionHold = document.createElement('comment'); + var questionResponse = document.getElementById(questionId + 'response'); + var mandatory = preTest.children[index].attributes['mandatory']; + if (mandatory != undefined){ + if (mandatory.value == 'true') {mandatory = true;} + else {mandatory = false;} + } else {mandatory = false;} + if (mandatory == true && questionResponse.value.length == 0) { + return index; + } + questionHold.id = questionId; + questionHold.innerHTML = questionResponse.value; + postPopupResponse(questionHold); + } + index++; + if (index < preTest.children.length) { - - var preTestHolder = document.createElement('div'); - preTestHolder.id = 'preTestHolder'; - preTestHolder.style.zIndex = 2; - preTestHolder.style.width = '500px'; - preTestHolder.style.height = '250px'; - preTestHolder.style.backgroundColor = '#fff'; - preTestHolder.style.position = 'absolute'; - preTestHolder.style.left = (window.innerWidth/2)-250 + 'px'; - preTestHolder.style.top = (window.innerHeight/2)-125 + 'px'; - // Parse the first box - var preTestOption = document.createElement('div'); - preTestOption.id = 'preTest'; - preTestOption.style.marginTop = '25px'; - preTestOption.align = "center"; - var child = preTest.children[0]; + // More to process + var child = preTest.children[index]; if (child.nodeName == 'statement') { preTestOption.innerHTML = ''+child.innerHTML+''; } else if (child.nodeName == 'question') { - var questionId = child.attributes['id'].value; var textHold = document.createElement('span'); textHold.innerHTML = child.innerHTML; - textHold.id = questionId + 'response'; var textEnter = document.createElement('textarea'); + textEnter.id = child.attributes['id'].value + 'response'; + var br = document.createElement('br'); + preTestOption.innerHTML = null; preTestOption.appendChild(textHold); + preTestOption.appendChild(br); preTestOption.appendChild(textEnter); } - var nextButton = document.createElement('button'); - nextButton.id = 'preTestNext'; - nextButton.value = '1'; - nextButton.innerHTML = 'next'; - nextButton.style.position = 'relative'; - nextButton.style.left = '450px'; - nextButton.style.top = '175px'; - nextButton.onclick = function() { - // Need to find and parse preTest again! - var preTest = projectXML.find('PreTest')[0]; - // Check if current state is a question! - if (preTest.children[this.value-1].nodeName == 'question') { - var questionId = preTest.children[this.value-1].attributes['id'].value; - var questionHold = document.createElement('comment'); - var questionResponse = document.getElementById(questionId + 'response'); - questionHold.id = questionId; - questionHold.innerHTML = questionResponse.value; - preTestQuestions.appendChild(questionHold); - } - if (this.value < preTest.children.length) - { - // More to process - var child = preTest.children[this.value]; - if (child.nodeName == 'statement') - { - preTestOption.innerHTML = ''+child.innerHTML+''; - } else if (child.nodeName == 'question') - { - var textHold = document.createElement('span'); - textHold.innerHTML = child.innerHTML; - var textEnter = document.createElement('textarea'); - textEnter.id = child.attributes['id'].value + 'response'; - preTestOption.innerHTML = null; - preTestOption.appendChild(textHold); - preTestOption.appendChild(textEnter); - } - } else { - // Time to clear - preTestHolder.style.zIndex = -1; - preTestHolder.style.visibility = 'hidden'; - var blank = document.getElementById('testHalt'); - blank.style.zIndex = -2; - blank.style.visibility = 'hidden'; - } - this.value++; - }; - - preTestHolder.appendChild(preTestOption); - preTestHolder.appendChild(nextButton); - insertPoint.appendChild(preTestHolder); + } else { + // Time to clear + preTestOption.innerHTML = null; + if (currentState != 'postTest') { + hidePopup(); + // Progress the state! + advanceState(); + } else { + a = createProjectSave(projectReturn); + preTestOption.appendChild(a); + } } + return index; +} +function postPopupResponse(response) +{ + if (currentState == 'preTest') { + preTestQuestions.appendChild(response); + } else if (currentState == 'postTest') { + postTestQuestions.appendChild(response); + } else { + // Inside a specific test + if (currentState.substr(0,10) == 'testRunPre') { + // Pre Test + var store = $(currentTestHolder).find('preTest'); + } else { + // Post Test + var store = $(currentTestHolder).find('postTest'); + } + store[0].appendChild(response); + } +} + +function showPopup() +{ + var popupHolder = document.getElementById('popupHolder'); + popupHolder.style.zIndex = 3; + popupHolder.style.visibility = 'visible'; + var blank = document.getElementsByClassName('testHalt')[0]; + blank.style.zIndex = 2; + blank.style.visibility = 'visible'; +} + +function hidePopup() +{ + var popupHolder = document.getElementById('popupHolder'); + popupHolder.style.zIndex = -1; + popupHolder.style.visibility = 'hidden'; + var blank = document.getElementsByClassName('testHalt')[0]; + blank.style.zIndex = -2; + blank.style.visibility = 'hidden'; } function dragEnd(ev) { // Function call when a div has been dropped - if (ev.x >= 50 && ev.x < window.innerWidth-50) { - this.style.left = (ev.x)+'px'; + var slider = document.getElementById('slider'); + var w = slider.style.width; + w = Number(w.substr(0,w.length-2)); + var x = ev.x; + if (x >= 42 && x < w+42) { + this.style.left = (x)+'px'; } else { - if (ev.x<50) { - this.style.left = '50px'; + if (x<42) { + this.style.left = '42px'; } else { - this.style.left = window.innerWidth-50 + 'px'; + this.style.left = (w+42) + 'px'; } } + audioEngineContext.metric.sliderMoved(); +} + +function advanceState() +{ + console.log(currentState); + if (currentState == 'preTest') + { + // End of pre-test, begin the test + loadTest(0); + } else if (currentState.substr(0,10) == 'testRunPre') + { + // Start the test + var testId = currentState.substr(11,currentState.length-10); + currentState = 'testRun-'+testId; + } else if (currentState.substr(0,11) == 'testRunPost') + { + var testId = currentState.substr(12,currentState.length-11); + testEnded(testId); + } else if (currentState.substr(0,7) == 'testRun') + { + var testId = currentState.substr(8,currentState.length-7); + // Check if we have any post tests to perform + var postXML = $(testXMLSetups[testId]).find('PostTest')[0]; + if (postXML == undefined) { + testEnded(testId); + } + else if (postXML.children.length > 0) + { + currentState = 'testRunPost-'+testId; + showPopup(); + preTestPopupStart(postXML); + } + else { + + + // No post tests, check if we have another test to perform instead + + } + } + console.log(currentState); +} + +function testEnded(testId) +{ + pageXMLSave(testId); + if (testXMLSetups.length-1 > testId) + { + // Yes we have another test to perform + testId = (Number(testId)+1); + currentState = 'testRun-'+testId; + loadTest(testId); + } else { + console.log('Testing Completed!'); + currentState = 'postTest'; + // Check for any post tests + var xmlSetup = projectXML.find('setup'); + var postTest = xmlSetup.find('PostTest')[0]; + showPopup(); + preTestPopupStart(postTest); + } +} + +function buttonSubmitClick() +{ + if (audioEngineContext.status == 1) { + var playback = document.getElementById('playback-button'); + playback.click(); + // This function is called when the submit button is clicked. Will check for any further tests to perform, or any post-test options + } else + { + if (audioEngineContext.timer.testStarted == false) + { + alert('You have not started the test! Please press start to begin the test!'); + return; + } + } + if (currentState.substr(0,7) == 'testRun') + { + audioEngineContext.timer.stopTest(); + advanceState(); + } +} + +function convSliderPosToRate(id) +{ + var w = document.getElementById('slider').style.width; + var maxPix = w.substr(0,w.length-2); + var slider = document.getElementsByClassName('track-slider')[id]; + var pix = slider.style.left; + pix = pix.substr(0,pix.length-2); + var rate = (pix-42)/maxPix; + return rate; +} + +function pageXMLSave(testId) +{ + // Saves a specific test page + var xmlDoc = currentTestHolder; + // Check if any session wide metrics are enabled + + var commentShow = testXMLSetups[testId].attributes['elementComments']; + if (commentShow != undefined) { + if (commentShow.value == 'false') {commentShow = false;} + else {commentShow = true;} + } else {commentShow = true;} + + var metric = document.createElement('metric'); + if (audioEngineContext.metric.enableTestTimer) + { + var testTime = document.createElement('metricResult'); + testTime.id = 'testTime'; + testTime.textContent = audioEngineContext.timer.testDuration; + metric.appendChild(testTime); + } + xmlDoc.appendChild(metric); + var trackSliderObjects = document.getElementsByClassName('track-slider'); + var commentObjects = document.getElementsByClassName('comment-div'); + for (var i=0; i + @@ -17,7 +18,11 @@ - +