# HG changeset patch # User www-data # Date 1501597427 -3600 # Node ID 300bb2bbba4a2e1e15879d22be0fb62d27980b73 # Parent 0e4b844970406fa1bd22b12ec95ef494adbf89c1# Parent 03a66e54cdff24a98d0085c11a0a4c59758e1437 Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool diff -r 0e4b84497040 -r 300bb2bbba4a interfaces/mushra.js --- a/interfaces/mushra.js Thu Jul 27 21:00:36 2017 +0100 +++ b/interfaces/mushra.js Tue Aug 01 15:23:47 2017 +0100 @@ -179,7 +179,7 @@ audioObject.bindInterface(orNode); } else { // Create a slider per track - var label = interfaceContext.getLabel(labelType, index, audioHolderObject.labelStart); + var label = element.label || interfaceContext.getLabel(labelType, index, audioHolderObject.labelStart); var sliderObj = new sliderObject(audioObject, label); if (typeof audioHolderObject.initialPosition === "number") { diff -r 0e4b84497040 -r 300bb2bbba4a js/core.js --- a/js/core.js Thu Jul 27 21:00:36 2017 +0100 +++ b/js/core.js Tue Aug 01 15:23:47 2017 +0100 @@ -555,7 +555,7 @@ this.store = null; var lastNodeStart; $(window).keypress(function (e) { - if (e.keyCode == 13 && popup.popup.style.visibility == 'visible') { + if (e.keyCode == 13 && popup.popup.style.visibility == 'visible' && interfaceContext.lightbox.isVisible() === false) { console.log(e); popup.buttonProceed.onclick(); e.preventDefault(); @@ -1216,6 +1216,39 @@ this.currentStore = null; this.initialise = function () { + function randomiseElements(page) { + // Get the elements which are fixed / labelled + var fixed = [], + or = [], + remainder = []; + page.audioElements.forEach(function (a) { + if (a.label.length > 0 || a.postion !== undefined) { + fixed.push(a); + } else if (a.type === "outside-reference") { + or.push(a); + } else { + remainder.push(a); + } + }) + if (page.poolSize > 0 || page.randomiseOrder) { + page.randomiseOrder = true; + if (page.poolSize === 0) { + page.poolSize = page.audioElements.length; + } + page.poolSize -= fixed.length; + remainder = pickSubPool(remainder, page.poolSize); + } + // Randomise the remainders + if (page.randomiseOrder) { + remainder = randomiseOrder(remainder); + } + fixed = fixed.concat(remainder); + page.audioElements = fixed.concat(or); + page.audioElements.forEach(function (a, i) { + a.position = i; + }); + } + // Get the data from Specification var pagePool = []; specification.pages.forEach(function (page) { @@ -1253,17 +1286,7 @@ page.presentedId = i; this.stateMap.push(page); var elements = page.audioElements; - if (page.poolSize > 0 || page.randomiseOrder) { - page.randomiseOrder = true; - if (page.poolSize === 0) { - page.poolSize = elements.length; - } - elements = pickSubPool(elements, page.poolSize); - } - if (page.randomiseOrder) { - elements = randomiseOrder(elements); - } - page.audioElements = elements; + randomiseElements(page); storage.createTestPageStore(page); audioEngineContext.loadPageData(page); }, this); @@ -1325,23 +1348,6 @@ popup.hidePopup(); if (this.currentStateMap === null) { this.currentStateMap = this.stateMap[this.stateIndex]; - // Find and extract the outside reference - var elements = [], - ref = []; - var elem = this.currentStateMap.audioElements.pop(); - while (elem) { - if (elem.type == "outside-reference") { - ref.push(elem); - } else { - elements.push(elem); - } - elem = this.currentStateMap.audioElements.pop(); - } - elements = elements.reverse(); - if (this.currentStateMap.randomiseOrder) { - elements = randomiseOrder(elements); - } - this.currentStateMap.audioElements = elements.concat(ref); this.currentStore = storage.testPages[this.stateIndex]; if (this.currentStateMap.preTest !== undefined) { @@ -2401,6 +2407,7 @@ show: function () { this.root.style.visibility = "visible"; this.blanker.style.visibility = "visible"; + this.accept.focus(); }, clear: function () { this.root.style.visibility = ""; @@ -2414,6 +2421,9 @@ }, resize: function (event) { this.root.style.left = (window.innerWidth / 2) - 250 + 'px'; + }, + isVisible: function () { + return this.root.style.visibility == "visible"; } }; diff -r 0e4b84497040 -r 300bb2bbba4a test_create.html --- a/test_create.html Thu Jul 27 21:00:36 2017 +0100 +++ b/test_create.html Tue Aug 01 15:23:47 2017 +0100 @@ -12,13 +12,14 @@ - WAET 1.2.1 Test Creator + WAET 1.2.2 Test Creator
-

Web Audio Evaluation Tool - Test Creator

+

Web Audio Evaluation Tool

+

Test Creator v1.2.2

@@ -45,7 +46,9 @@
Interface: - +
Save URL: @@ -53,7 +56,7 @@
Exit URL: - +
Randomise Page Order: @@ -61,15 +64,15 @@
Page Pool Size: - +
Loudness Normalisation (LUFS): - +
Fixed Sampling Rate: - +
Pre-Test audio calibration: @@ -77,15 +80,15 @@
Global Cross-fade time: - +
Global Fragment Pre-Silence: - +
Global Fragment Post-Silence: - +
Play audio one-at-a-time: @@ -93,11 +96,11 @@
Minimum number of fragment plays - +
Maximum number of fragment plays - +
@@ -140,11 +143,11 @@

Pre Test Survey

-
+

Survey Entry

-
+
Survey Type:
-
+
Unique Survey Entry ID:
-
+
Entry Name:
-
+
Mandatory:
-
+
Minimum Wait Time (s):
-
+
Box Size:
-
+
Minimum Selected:
-
+
Maximum Selected:
-
+
Minimum Value:
-
+
Maximum Value:
-
+
Video URL:
-
+

Statement

@@ -271,11 +274,11 @@

Post Test Survey

-
+

Survey Entry

-
+
Survey Type:
-
+
Unique Survey Entry ID:
-
+
Entry Name:
-
+
Mandatory:
-
+
Minimum Wait Time (s):
-
+
Box Size:
-
+
Minimum Selected:
-
+
Maximum Selected:
-
+
Minimum Value:
-
+
Maximum Value:
-
+
Video URL:
-
+

Statement

@@ -403,23 +406,23 @@

Interface (Globals)

-
+
Check all fragments played:
-
+
Check all fragments fully played:
-
+
Check all fragments have been moved:
-
+
Check all fragments have comments:
-
+
Enforce a scale usage: Minimum: @@ -427,19 +430,19 @@ Maximum:
-
+
Show master volume control:
-
+
Show playhead:
-
+
Show Page Count:
-
+
Show Fragment Comments:
@@ -467,8 +470,8 @@
- Repeat Page N-times: - + Numer of repetitions: +
Loop audio: @@ -480,7 +483,7 @@
Loudness (page): - +
Label type: @@ -499,7 +502,7 @@
Fragment pool size: - +
Always include page: @@ -511,11 +514,11 @@
Fragment pre-silence: - +
Fragment post-silence: - +
Cannot interupt audio: @@ -527,11 +530,11 @@
Minimum number of fragment plays - +
Maximum number of fragment plays - +
@@ -548,11 +551,11 @@

Pre Page Survey

-
+

Survey Entry

-
+
Survey Type:
-
+
Unique Survey Entry ID:
-
+
Entry Name:
-
+
Mandatory:
-
+
Minimum Wait Time (s):
-
+
Box Size:
-
+
Minimum Selected:
-
+
Maximum Selected:
-
+
Minimum Value:
-
+
Maximum Value:
-
+
Video URL:
-
+

Statement

@@ -679,11 +682,11 @@

Post Page Survey

-
+

Survey Entry

-
+
Survey Type:
-
+
Unique Survey Entry ID: - +
-
+
Entry Name:
-
+
Mandatory:
-
+
Minimum Wait Time (s):
-
+
Box Size:
-
+
Minimum Selected:
-
+
Maximum Selected:
-
+
Minimum Value:
-
+
Maximum Value:
-
+
Video URL:
-
+

Statement

@@ -808,7 +811,7 @@
-
+

Interface

@@ -955,15 +958,15 @@
-
+

Audio Fragment

-
+
Unique ID:
-
+
URL: Full URL: {{page.hostURL}}{{fragment.url}} @@ -991,15 +994,15 @@
Anchor must be below: - +
Reference must be above: - +
Loudness: - +
Always include fragment: @@ -1044,13 +1047,13 @@