changeset 3131:735d96d343f6

Fixed #287
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 21 Feb 2019 12:01:34 +0000
parents ebe6a4c98635
children 38d2150045f5
files js/core.js
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Thu Feb 21 11:52:09 2019 +0000
+++ b/js/core.js	Thu Feb 21 12:01:34 2019 +0000
@@ -1160,13 +1160,12 @@
 
     this.proceedClicked = function () {
         // Each time the popup button is clicked!
-        if (testState.stateIndex === -1 && specification.calibration) {
-            advanceState();
-            return;
-        }
         var node = this.popupOptions[this.currentIndex],
             pass = true,
             timeDelta = (new Date() - lastNodeStart) / 1000.0;
+        if (node == undefined) {
+            advanceState();
+        }
         if (timeDelta < node.specification.minWait) {
             interfaceContext.lightbox.post("Error", "Not enough time has elapsed, please wait " + (node.specification.minWait - timeDelta).toFixed(0) + " seconds");
             return;
@@ -1202,7 +1201,6 @@
                 this.store.postResult(node);
             }, this);
             this.store.complete();
-            testState.stateIndex++;
             advanceState();
         }
     };
@@ -1370,10 +1368,10 @@
             storage.update();
         }
         if (this.stateIndex == -2) {
+            this.stateIndex++;
             if (this.preTestSurvey !== undefined) {
                 popup.initState(this.preTestSurvey, storage.globalPreTest);
             } else {
-                this.stateIndex++;
                 this.advanceState();
             }
         } else if (this.stateIndex == -1) {