# HG changeset patch # User Nicholas Jillings # Date 1452597481 0 # Node ID 0db687b660f106e0042e50041bbf4227ba07cd33 # Parent f5b148187b723fe09423639e29779a6e09823952 Updated AB files. One comparison per page node, all elements in the page compared against each other. diff -r f5b148187b72 -r 0db687b660f1 AB.css --- a/AB.css Tue Jan 12 09:16:39 2016 +0000 +++ b/AB.css Tue Jan 12 11:18:01 2016 +0000 @@ -53,6 +53,10 @@ background-color: #FF0000; } +div.disabled { + background-color: #AAA; +} + div.selected { background-color: #008000; } diff -r f5b148187b72 -r 0db687b660f1 AB.js --- a/AB.js Tue Jan 12 09:16:39 2016 +0000 +++ b/AB.js Tue Jan 12 11:18:01 2016 +0000 @@ -68,35 +68,11 @@ // Construct the AB Boxes var boxes = document.createElement('div'); boxes.align = "center"; - var boxA = document.createElement('div'); - boxA.className = 'comparitor-holder'; - boxA.id = 'comparitor-A'; - var selector = document.createElement('div'); - selector.className = 'comparitor-selector'; - selector.innerHTML = 'A'; - var playback = document.createElement('button'); - playback.className = 'comparitor-button'; - playback.textContent = "Listen"; - boxA.appendChild(selector); - boxA.appendChild(playback); - boxes.appendChild(boxA); - - var boxB = document.createElement('div'); - boxB.className = 'comparitor-holder'; - boxB.id = 'comparitor-B'; - var selector = document.createElement('div'); - selector.className = 'comparitor-selector'; - selector.innerHTML = 'B'; - var playback = document.createElement('button'); - playback.className = 'comparitor-button'; - playback.textContent = "Listen"; - boxB.appendChild(selector); - boxB.appendChild(playback); - boxes.appendChild(boxB); + boxes.id = "box-holders"; var submit = document.createElement('button'); submit.id = "submit"; - submit.onclick = function() {interfaceContext.comparitor.submitButton();}; + submit.onclick = buttonSubmitClick; submit.className = "big-button"; submit.textContent = "submit"; submit.style.position = "absolute"; @@ -115,7 +91,6 @@ // Load the full interface testState.initialise(); testState.advanceState(); - resizeWindow(null); } function loadTest(audioHolderObject) @@ -135,146 +110,133 @@ // Populate the comparitor object interfaceContext.comparitor = new Comparitor(audioHolderObject); - interfaceContext.comparitor.progress(); + resizeWindow(null); } function Comparitor(audioHolderObject) -{ - this.pairs = []; - this.listened = [false, false]; - this.selected = null; - this.index = -1; - this.currentPair = null; - this.progress = function() +{ + this.comparitorBox = function(audioElement,id,text) { - this.index++; - if (this.index >= this.pairs.length) + this.parent = audioElement; + this.id = id; + this.value = 0; + this.disabled = true; + this.box = document.createElement('div'); + this.box.className = 'comparitor-holder'; + this.box.setAttribute('track-id',audioElement.id); + this.box.id = 'comparitor-'+text; + this.selector = document.createElement('div'); + this.selector.className = 'comparitor-selector disabled'; + var selectorText = document.createElement('span'); + selectorText.textContent = text; + this.selector.appendChild(selectorText); + this.playback = document.createElement('button'); + this.playback.className = 'comparitor-button'; + this.playback.disabled = true; + this.playback.textContent = "Listen"; + this.box.appendChild(this.selector); + this.box.appendChild(this.playback); + this.selector.onclick = function() { - buttonSubmitClick(); - return; - } - $(".comparitor-selector").removeClass('selected'); - this.listened = [false, false]; - this.selected = null; - this.currentPair = this.pairs[this.index]; + if ($(event.currentTarget).hasClass('disabled')) + { + console.log("Please wait until sample has loaded"); + return; + } + $(".comparitor-selector").removeClass('selected'); + var id = event.currentTarget.parentElement.getAttribute('track-id'); + interfaceContext.comparitor.selected = id; + $(event.currentTarget).addClass('selected'); + for (var i=0; i - + Please enter your name. @@ -14,7 +14,7 @@ - This is an example of an 'APE'-style test, with two pages, using the test stimuli in 'example_eval/'. + This is an example of an 'AB'-style test, with two pages, using the test stimuli in 'example_eval/'. @@ -38,7 +38,10 @@ testTimer elementTimer + elementInitialPosition + elementTracker elementFlagListenedTo + elementFlagMoved elementListenTracker @@ -53,12 +56,11 @@ Depth - + - - Example of an 'APE' style interface with hidden anchor 'zero' (which needs to be below 20%), looping of the samples, randomisation of marker labels, mandatory moving of every sample, and a forced scale usage of at least 25%-75%. + A two way comparison using randomised element order, automatic loudness and synchronised looping. @@ -67,4 +69,27 @@ + + Comment on fragment + + Depth + + + + + + + + + + + A 7 way comparison using randomised element order and synchronised looping. + + + + + Please enter the genre. + + + \ No newline at end of file