comparison test_create/test_create.html @ 1912:c0ff84783b59

Implemented Bug/Feature #1649. Edit the exit text by modifying <exitText>, see mushra_example.xml for example.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 22 Mar 2016 13:44:59 +0000
parents db85dec2b0b0
children 6c819878ac85
comparison
equal deleted inserted replaced
1911:db2a2a4a773e 1912:c0ff84783b59
17 this.metrics = null; 17 this.metrics = null;
18 this.interfaces = null; 18 this.interfaces = null;
19 this.loudness = null; 19 this.loudness = null;
20 this.errors = []; 20 this.errors = [];
21 this.schema = null; 21 this.schema = null;
22 this.exitText = "Thank you.";
22 23
23 this.processAttribute = function(attribute,schema,schemaRoot) 24 this.processAttribute = function(attribute,schema,schemaRoot)
24 { 25 {
25 // attribute is the string returned from getAttribute on the XML 26 // attribute is the string returned from getAttribute on the XML
26 // schema is the <xs:attribute> node 27 // schema is the <xs:attribute> node
86 break; 87 break;
87 } 88 }
88 89
89 } 90 }
90 91
92 var exitTextNode = setupNode.getElementsByTagName('exitText');
93 if (exitTextNode.length == 1) {
94 this.exitText = exitTextNode[0].textContent;
95 }
96
91 this.metrics = new this.metricNode(); 97 this.metrics = new this.metricNode();
92 98
93 this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]); 99 this.metrics.decode(this,setupNode.getElementsByTagName('metric')[0]);
94 100
95 // Now process the survey node options 101 // Now process the survey node options
158 eval("setup.setAttribute('"+name+"',this."+name+")"); 164 eval("setup.setAttribute('"+name+"',this."+name+")");
159 } 165 }
160 } 166 }
161 root.appendChild(setup); 167 root.appendChild(setup);
162 // Survey node 168 // Survey node
169 if (this.exitText != null) {
170 var exitTextNode = RootDocument.createElement('exitText');
171 exitTextNode.textContent = this.exitText;
172 setup.appendChild(exitTextNode);
173 }
163 setup.appendChild(this.preTest.encode(RootDocument)); 174 setup.appendChild(this.preTest.encode(RootDocument));
164 setup.appendChild(this.postTest.encode(RootDocument)); 175 setup.appendChild(this.postTest.encode(RootDocument));
165 setup.appendChild(this.metrics.encode(RootDocument)); 176 setup.appendChild(this.metrics.encode(RootDocument));
166 setup.appendChild(this.interfaces.encode(RootDocument)); 177 setup.appendChild(this.interfaces.encode(RootDocument));
167 for (var page of this.pages) 178 for (var page of this.pages)