# HG changeset patch # User Nicholas Jillings # Date 1493288656 -3600 # Node ID 80a3b693b3f66375291a7c2e6cffb4d83dbea20e # Parent 5591d01adf1c31c789aa055b31020dfb510e9f81 More test_create work diff -r 5591d01adf1c -r 80a3b693b3f6 js/specification.js --- a/js/specification.js Wed Apr 26 17:48:35 2017 +0100 +++ b/js/specification.js Thu Apr 27 11:24:16 2017 +0100 @@ -20,13 +20,20 @@ // nodes this.metrics = new metricNode(); - this.preTest = undefined; - this.postTest = undefined; + this.preTest = new surveyNode(this); + this.postTest = new surveyNode(this); this.pages = []; this.interfaces = new interfaceNode(this); this.errors = []; this.exitText = "Thank you."; + // Creators + this.createNewPage = function () { + var newpage = new page(this); + this.pages.push(newpage); + return newpage; + } + var processAttribute = function (attribute, schema) { // attribute is the string returned from getAttribute on the XML // schema is the node @@ -136,12 +143,10 @@ switch (location) { case 'pre': case 'before': - this.preTest = new surveyNode(this); this.preTest.decode(this, survey[i]); break; case 'post': case 'after': - this.postTest = new surveyNode(this); this.postTest.decode(this, survey[i]); break; } @@ -207,9 +212,14 @@ this.location = undefined; this.options = []; this.parent = undefined; - this.schema = schemaRoot.querySelector('[name=survey]'); this.specification = specification; + this.addOption = function () { + var node = new this.OptionNode(this.specification); + this.options.push(node); + return node; + } + this.OptionNode = function (specification) { this.type = undefined; this.schema = undefined; @@ -381,6 +391,7 @@ }; }; this.decode = function (parent, xml) { + this.schema = schemaRoot.querySelector('[name=survey]'); this.parent = parent; this.location = xml.getAttribute('location'); if (this.location == 'before') { @@ -540,8 +551,8 @@ this.loudness = undefined; this.label = undefined; this.labelStart = undefined; - this.preTest = undefined; - this.postTest = undefined; + this.preTest = new surveyNode(specification); + this.postTest = new surveyNode(specification); this.interfaces = []; this.playOne = undefined; this.restrictMovement = undefined; @@ -592,17 +603,15 @@ for (i = 0; i < survey.length; i++) { var location = survey[i].getAttribute('location'); if (location == 'pre' || location == 'before') { - if (this.preTest !== undefined) { + if (this.preTest.options.length !== 0) { this.errors.push("Already a pre/before test survey defined! Ignoring second!!"); } else { - this.preTest = new surveyNode(this.specification); this.preTest.decode(parent, survey[i], surveySchema); } } else if (location == 'post' || location == 'after') { - if (this.postTest !== undefined) { + if (this.postTest.options.length !== 0) { this.errors.push("Already a post/after test survey defined! Ignoring second!!"); } else { - this.postTest = new surveyNode(this.specification); this.postTest.decode(parent, survey[i], surveySchema); } } diff -r 5591d01adf1c -r 80a3b693b3f6 test_create.html --- a/test_create.html Wed Apr 26 17:48:35 2017 +0100 +++ b/test_create.html Thu Apr 27 11:24:16 2017 +0100 @@ -110,6 +110,7 @@

Pre Test Survey

+

Survey Entry

@@ -197,10 +198,49 @@
+
+

Conditionals

+ +
+
+
+ +
+
+ Check Type: + +
+
+ Value: + +
+
+ Jump To On Pass: + +
+
+ Jump To On Fail: + +
+
+
+

Post Test Survey

+

Survey Entry

@@ -288,6 +328,44 @@
+
+

Conditionals

+ +
+
+
+ +
+
+ Check Type: + +
+
+ Value: + +
+
+ Jump To On Pass: + +
+
+ Jump To On Fail: + +
+
+
+
@@ -338,8 +416,567 @@
+
+ +

Page

+
+
+ Unique ID: + +
+
+ Fragment common-root URL: + +
+
+ Randomise Fragment Order: + +
+
+ Repeat Page N-times: + +
+
+ Loop audio: + +
+
+ Synchronous audio playback: + +
+
+ Loudness (page): + +
+
+ Label type: + +
+
+ Label Start: + +
+
+ Fragment pool size: + +
+
+ Always include page: + +
+
+ Fixed Page Position: + +
+
+ Fixed Page Position: + +
+
+ Fragment pre-silence: + +
+
+ Fragment post-silence: + +
+
+ Cannot interupt audio: + +
+
+ Only move playing audio: + +
+
+
+

Page Title

+ +
+
+

Comment box text prefix

+ +

Example: + {{page.commentboxprefix}} A +

+
+
+

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

+ +
+
+

Options

+
+ +
+
+
+
+ +
+
+ Name: + +
+
+ Displayed Text: + +
+
+
+
+
+

Conditionals

+ +
+
+
+ +
+
+ Check Type: + +
+
+ Value: + +
+
+ Jump To On Pass: + +
+
+ Jump To On Fail: + +
+
+
+
+
+
+
+

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

+ +
+
+

Options

+
+ +
+
+
+
+ +
+
+ Name: + +
+
+ Displayed Text: + +
+
+
+
+
+

Conditionals

+ +
+
+
+ +
+
+ Check Type: + +
+
+ Value: + +
+
+ Jump To On Pass: + +
+
+ Jump To On Fail: + +
+
+
+
+
+
+
+

Interface

+
+
+
+ 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: + + Maximum: + +
+
+ Show master volume control: + +
+
+ Show playhead: + +
+
+ Show Page Count: + +
+
+ Show Fragment Comments: + +
+
+
+
+

Axis Title

+ +
+
+ Axis name (in saves): + +
+
+
+
+

Axis Image

+ +
+
+

Axis Scales

+ +
+
+
+ +
+
+ Position: + +
+
+ Text: + +
+
+
+
+
+
+

Comment Questions

+
+
+
+ Unique ID: + +
+
+ Common Name: + +
+
+ Minimum: + +
+
+ Maximum: + +
+
+ Step size: + +
+
+ Initial Value: + +
+
+
+

Question:

+ +
+
+

Options

+
+
+
+ +
+
+ Name: + +
+
+ Display Text: + +
+
+
+
+
+
+
+

Audio Fragment

+
+
+ Unique ID: + +
+
+ URL: + + Full URL: {{page.hostURL}}{{fragment.url}} +
+
+ Fragment Gain (dB): + +
+
+ Fragment Label: + +
+
+ Fragment Common name: + +
+
+ Fragment Type: + +
+
+ Anchor must be below: + +
+
+ Reference must be above: + +
+
+ Loudness: + +
+
+ Always include fragment: + +
+
+ Fragment Pre-Silence: + +
+
+ Fragment Post-Silence: + +
+
+ Fragment playback start position (s): + +
+
+ Fragment playback stop position (s): + +
+
+ Fragment sampling rate: + +
+
+ Fragment Image (URL): + +
+
+