Mercurial > hg > webaudioevaluationtool
diff core.js @ 2179:9fa5e164b3ef
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 | c5e9c8eb1852 |
children | c3666ac704ba |
line wrap: on
line diff
--- a/core.js Tue Mar 22 12:35:48 2016 +0000 +++ b/core.js Tue Mar 22 13:44:59 2016 +0000 @@ -416,7 +416,7 @@ if (response.getAttribute("state") == "OK") { var file = response.getElementsByTagName("file")[0]; console.log("Save: OK, written "+file.getAttribute("bytes")+"B"); - popup.popupContent.textContent = "Thank you. Your session has been saved."; + popup.popupContent.textContent = specification.exitText; } else { var message = response.getElementsByTagName("message"); console.log("Save: Error! "+message.textContent); @@ -1776,6 +1776,7 @@ this.loudness = null; this.errors = []; this.schema = null; + this.exitText = "Thank you."; this.processAttribute = function(attribute,schema,schemaRoot) { @@ -1844,6 +1845,11 @@ } } + + var exitTextNode = setupNode.getElementsByTagName('exitText'); + if (exitTextNode.length == 1) { + this.exitText = exitTextNode[0].textContent; + } this.metrics = new this.metricNode(); @@ -1917,6 +1923,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));