changeset 2314:cbc26d0f104a

Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author www-data <www-data@sucuk.dcs.qmul.ac.uk>
date Fri, 29 Apr 2016 15:21:00 +0100
parents dc0663a24604 (current diff) 70bb8e542741 (diff)
children fa52c9ea2486
files
diffstat 2 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/ape.js	Fri Apr 29 12:21:00 2016 +0100
+++ b/interfaces/ape.js	Fri Apr 29 15:21:00 2016 +0100
@@ -25,7 +25,7 @@
 		hasBeenPlayed = audioEngineContext.checkAllPlayed();
 		if (hasBeenPlayed.length > 0) // if a fragment has not been played yet
 	    {
-	    	str = "";
+	    	var str = "";
 	    	if (hasBeenPlayed.length > 1) {
 		    	for (var i=0; i<hasBeenPlayed.length; i++) {
                     var ao_id = audioEngineContext.audioObjects[hasBeenPlayed[i]].interfaceDOM.getPresentedId();
@@ -36,10 +36,12 @@
 		    			str += " or ";
 		    		}
 		    	}
-		    	alert('You have not played fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.');
+                str = 'You have not played fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.';
 	       } else {
-	       		alert('You have not played fragment ' + (audioEngineContext.audioObjects[hasBeenPlayed[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.');
-	       }
+               str = 'You have not played fragment ' + (audioEngineContext.audioObjects[hasBeenPlayed[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.';
+           }
+            this.storeErrorNode(str);
+            alert(str);
 	        return false;
 	    }
 	    return true;
@@ -84,6 +86,7 @@
 		}
 		if (state != true)
 		{
+            this.storeErrorNode(str);
 			alert(str);
 			console.log(str);
 		}
@@ -104,8 +107,9 @@
 				}
 			}
 			if (state == false) {
+                var str = "";
 				if (strNums.length > 1) {
-					var str = "";
+					
 			    	for (var i=0; i<strNums.length; i++) {
                         var ao_id = audioEngineContext.audioObjects[strNums[i]].interfaceDOM.getPresentedId();
 			    		str = str + (ao_id); // start from 1
@@ -115,10 +119,13 @@
 			    			str += " or ";
 			    		}
 			    	}
-			    	alert('You have not commented on fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.');
+                    str = 'You have not commented on fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.';
 		       } else {
-		       		alert('You have not commented on fragment ' + (audioEngineContext.audioObjects[strNums[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.');
+                   str = 'You have not commented on fragment ' + (audioEngineContext.audioObjects[strNums[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.';
 		       }
+                this.storeErrorNode(str);
+                alert(str);
+                console.log(str);
 			}
 		}
 		return state;
@@ -164,6 +171,7 @@
 		}
 		if (state != true)
 		{
+            this.storeErrorNode(str);
 			alert(str);
 			console.log(str);
 		}
--- a/js/core.js	Fri Apr 29 12:21:00 2016 +0100
+++ b/js/core.js	Fri Apr 29 15:21:00 2016 +0100
@@ -1103,6 +1103,13 @@
             return null;
         }
     }
+    this.getCurrentTestPageStore = function() {
+        if (this.stateIndex >= 0 && this.stateIndex< this.stateMap.length) {
+            return this.currentStore;
+        } else {
+            return null;
+        }
+    }
 }
 
 function AudioEngine(specification) {