changeset 8:a6ce34b4dd41

checkOneFragmentSelected ignored when one or more fragments are inactive
author Giulio Moro <giuliomoro@yahoo.it>
date Sun, 24 Apr 2016 14:41:26 +0100
parents 0dde5b0c5d5c
children 0d161eb5c083
files core.js
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Sun Apr 24 13:42:51 2016 +0100
+++ b/core.js	Sun Apr 24 14:41:26 2016 +0100
@@ -3139,7 +3139,15 @@
 	this.checkOneFragmentSelected = function(){
 		console.log("checkOneFragmentSelected");
 		var str = "You should select an answer before continuing";
-		if(this.comparator.selected === null){
+		var isInactive = 0;
+		for (var ao of audioEngineContext.audioObjects)
+		{
+			if(ao.specification.inactive === true)
+			{
+				++isInactive;
+			}
+		}
+		if(this.comparator.selected === null && isInactive===0){
 			alert(str);
 			return false;
 		} else {