# HG changeset patch # User Nicholas Jillings # Date 1452599438 0 # Node ID 32757cefeee01fe3313ead03acbf9c20db9ca39b # Parent 0db687b660f106e0042e50041bbf4227ba07cd33 Core.js now randomises the audio elements when asked to on page creation. AB has stricter selection policies, selection can occur only once playback has started. diff -r 0db687b660f1 -r 32757cefeee0 AB.js --- a/AB.js Tue Jan 12 11:18:01 2016 +0000 +++ b/AB.js Tue Jan 12 11:50:38 2016 +0000 @@ -138,11 +138,18 @@ this.box.appendChild(this.playback); this.selector.onclick = function() { + var time = audioEngineContext.timer.getTestTime(); if ($(event.currentTarget).hasClass('disabled')) { console.log("Please wait until sample has loaded"); return; } + if (audioEngineContext.status == 0) + { + alert("Please listen to the samples before making a selection"); + console.log("Please listen to the samples before making a selection"); + return; + } $(".comparitor-selector").removeClass('selected'); var id = event.currentTarget.parentElement.getAttribute('track-id'); interfaceContext.comparitor.selected = id; @@ -155,8 +162,9 @@ } else { obj.value = 0; } - obj.parent.metric.moved(audioEngineContext.timer.getTestTime(),obj.value); + obj.parent.metric.moved(time,obj.value); } + console.log("Selected "+id+' ('+time+')'); }; this.playback.onclick = function() { diff -r 0db687b660f1 -r 32757cefeee0 core.js --- a/core.js Tue Jan 12 11:18:01 2016 +0000 +++ b/core.js Tue Jan 12 11:50:38 2016 +0000 @@ -747,6 +747,10 @@ if (this.currentStateMap == null) { this.currentStateMap = this.stateMap[this.stateIndex]; + if (this.currentStateMap.randomiseOrder) + { + this.currentStateMap.audioElements = randomiseOrder(this.currentStateMap.audioElements); + } storage.createTestPageStore(this.currentStateMap); if (this.currentStateMap.preTest != null) { diff -r 0db687b660f1 -r 32757cefeee0 example_eval/AB_example.xml --- a/example_eval/AB_example.xml Tue Jan 12 11:18:01 2016 +0000 +++ b/example_eval/AB_example.xml Tue Jan 12 11:50:38 2016 +0000 @@ -1,6 +1,6 @@ - + Please enter your name.