# HG changeset patch # User Nicholas Jillings # Date 1501575237 -3600 # Node ID 9c26e579e64d6794f962ad9c8f6c7e9e16c7ef50 # Parent a1e294297380c7e2b99b88e3ce47725b42c712e5 Test create supports template XMLs. Added ITU-R BS.1116 template. diff -r a1e294297380 -r 9c26e579e64d test_create.html --- a/test_create.html Mon Jul 31 16:15:47 2017 +0100 +++ b/test_create.html Tue Aug 01 09:13:57 2017 +0100 @@ -1063,7 +1063,7 @@
-
+
diff -r a1e294297380 -r 9c26e579e64d test_create/interfaces/specifications.json --- a/test_create/interfaces/specifications.json Mon Jul 31 16:15:47 2017 +0100 +++ b/test_create/interfaces/specifications.json Tue Aug 01 09:13:57 2017 +0100 @@ -13,52 +13,10 @@ "name": "MUSHRA", "interface": "MUSHRA", "description": { - "en": "Multi-stimulus with hidden reference and anchor. Each fragment is shown on its own vertical slider. One fragment must be labelled as a reference and another labelled as an anchor. One external reference must also be shown." + "en": "Multi-stimulus with hidden reference and anchor. Each fragment is shown on its own vertical slider. One fragment must be labelled as a reference and another labelled as an anchor. One external reference must also be shown. ITU-R BS.1116-3" }, "scales": ["ACR"], - "checks": [{ - "name": "fragmentMoved", - "support": "none" - }, { - "name": "fragmentPlayed", - "support": "none" - }, { - "name": "fragmentFullPlayback", - "support": "none" - }, { - "name": "fragmentComments", - "support": "none" - }, { - "name": "scalerange", - "support": "none" - }], - "show": [{ - "name": "volume", - "support": "none" - }, { - "name": "page-count", - "support": "none" - }, { - "name": "playhead", - "support": "none" - }, { - "name": "comments", - "support": "none" - }], - "elements": [{ - "anchor": { - "min": 1, - "max": "undefined" - }, - "reference": { - "min": 1, - "max": "undefined" - }, - "outsidereference": { - "min": 1, - "max": "undefined" - } - }] + "template": "./tests/templates/itur1116.xml" }, { "name": "Vertical Sliders", "interface": "MUSHRA", @@ -83,7 +41,7 @@ "description": { "en": "Each stimulus is placed on a discrete scale equalling the number of fragments. The fragments are then ranked based on the question posed. Only one element can occupy a rank position" } - },{ + }, { "name": "Likert", "interface": "discrete", "description": { diff -r a1e294297380 -r 9c26e579e64d test_create/test_core.js --- a/test_create/test_core.js Mon Jul 31 16:15:47 2017 +0100 +++ b/test_create/test_core.js Tue Aug 01 09:13:57 2017 +0100 @@ -153,10 +153,12 @@ AngularInterface.controller("introduction", ['$scope', '$element', '$window', function ($s, $e, $w) { $s.state = 0; + $s.selected = undefined; $s.next = function () { $s.state++; if ($s.state > 1 || $s.file) { $s.hidePopup(); + $s.initialise($s.selected); } }; $s.back = function () { @@ -177,19 +179,32 @@ if (obj === undefined) { throw ("Cannot find specification"); } - $s.setTestPrototype(obj); + if (typeof obj.template === "string") { + get(obj.template).then(function (data) { + $s.parseFile(data); + }, function (err) {}) + } else { + $s.setTestPrototype(obj); + } }; - // Get the test interface specifications + $s.select = function (name) { + $s.selected = name; + } + // Get the test interface specifications $s.file = undefined; $s.description = ""; + $s.parseFile = function (f) { + var p = new DOMParser(); + specification.decode(p.parseFromString(f, "text/xml")); + $s.$apply(); + } + $s.handleFiles = function ($event) { $s.file = $event.currentTarget.files[0]; var r = new FileReader(); r.onload = function () { - var p = new DOMParser(); - specification.decode(p.parseFromString(r.result, "text/xml")); - $s.$apply(); + $s.parseFile(r.result); }; r.readAsText($s.file); }; @@ -242,12 +257,14 @@ $s.$watch("selectedTestPrototype", $s.configure); $s.placeholder = function (name) { - var spec = $s.schema.querySelector("attribute[name=\"" + name + "\"]") || $w.specification.schema.querySelector("attribute[name=\"" + name + "\"]"); - var attr = spec.getAttribute("default"); - if (attr === undefined) { - return ""; + if ($s.schema) { + var spec = $s.schema.querySelector("attribute[name=\"" + name + "\"]") || $w.specification.schema.querySelector("attribute[name=\"" + name + "\"]"); + var attr = spec.getAttribute("default"); + if (attr === undefined) { + return ""; + } + return attr; } - return attr; } }]); diff -r a1e294297380 -r 9c26e579e64d tests/templates/itur1116.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/templates/itur1116.xml Tue Aug 01 09:13:57 2017 +0100 @@ -0,0 +1,41 @@ + + + + Thank you for participating in this listening test. You may now exit the test environment + + testTimer + elementTimer + elementInitialPosition + elementTracker + elementFlagListenedTo + elementFlagMoved + elementListenTracker + + + + + Imperceptible + Perceptible but not annoying + Slightly annoying + Annoying + Very annoying + + + + + + Quality + + + + + + + + Quality + + + + + +