diff test_create/test_create.html @ 1271:2dd5f7071e3f

Implemented Bug/Feature #1649. Edit the exit text by modifying <exitText>, see mushra_example.xml for example.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 22 Mar 2016 13:44:59 +0000
parents 3600fff74af9
children 6c819878ac85
line wrap: on
line diff
--- a/test_create/test_create.html	Tue Mar 22 12:35:48 2016 +0000
+++ b/test_create/test_create.html	Tue Mar 22 13:44:59 2016 +0000
@@ -19,6 +19,7 @@
             this.loudness = null;
             this.errors = [];
             this.schema = null;
+            this.exitText = "Thank you.";
 
             this.processAttribute = function(attribute,schema,schemaRoot)
             {
@@ -88,6 +89,11 @@
 
                 }
 
+                var exitTextNode = setupNode.getElementsByTagName('exitText');
+                if (exitTextNode.length == 1) {
+                    this.exitText = exitTextNode[0].textContent;
+                }
+
                 this.metrics = new this.metricNode();
 
                 this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]);
@@ -160,6 +166,11 @@
                 }
                 root.appendChild(setup);
                 // Survey node
+                if (this.exitText != null) {
+                    var exitTextNode = RootDocument.createElement('exitText');
+                    exitTextNode.textContent = this.exitText;
+                    setup.appendChild(exitTextNode);
+                }
                 setup.appendChild(this.preTest.encode(RootDocument));
                 setup.appendChild(this.postTest.encode(RootDocument));
                 setup.appendChild(this.metrics.encode(RootDocument));