# HG changeset patch # User Nicholas Jillings # Date 1492780148 -3600 # Node ID 87d71c41c174855698564a5cce3df414af7df6d2 # Parent 2fc62a50d593f48163f59edac85a4078abb16b21 #145. Added survey node duration to results diff -r 2fc62a50d593 -r 87d71c41c174 js/core.js --- a/js/core.js Fri Apr 21 14:03:51 2017 +0100 +++ b/js/core.js Fri Apr 21 14:09:08 2017 +0100 @@ -553,7 +553,7 @@ this.currentIndex = null; this.node = null; this.store = null; - var lastNodeStart = undefined; + var lastNodeStart; $(window).keypress(function (e) { if (e.keyCode == 13 && popup.popup.style.visibility == 'visible') { console.log(e); @@ -1118,6 +1118,7 @@ interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait "+(node.specification.minWait-timeDelta).toFixed(0)+" seconds"); return; } + node.elapsedTime = timeDelta; if (node.specification.type == 'question') { // Must extract the question data pass = processQuestion.call(this, node); @@ -3512,7 +3513,7 @@ var clone = this.parent.root.cloneNode(true); hold.appendChild(clone); var saveURL = specification.returnURL + "php/save.php?key=" + this.key + "&saveFilenamePrefix="; - if (this.parent.filenamePrefix.length == 0) { + if (this.parent.filenamePrefix.length === 0) { saveURL += "save"; } else { saveURL += this.parent.filenamePrefix; @@ -3605,6 +3606,7 @@ } surveyresult = surveyresult.nextElementSibling; } + surveyresult.setAttribute("duration", node.elapsedTime); switch (node.specification.type) { case "number": case "question":