comparison interfaces/ape.js @ 2313:70bb8e542741

#14 fix. APE now saves <error> messages to the <page> node.
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Fri, 29 Apr 2016 15:20:25 +0100
parents e59327ebdb15
children ceaccbd708cb
comparison
equal deleted inserted replaced
2312:483bd6573747 2313:70bb8e542741
23 interfaceContext.checkAllPlayed = function() 23 interfaceContext.checkAllPlayed = function()
24 { 24 {
25 hasBeenPlayed = audioEngineContext.checkAllPlayed(); 25 hasBeenPlayed = audioEngineContext.checkAllPlayed();
26 if (hasBeenPlayed.length > 0) // if a fragment has not been played yet 26 if (hasBeenPlayed.length > 0) // if a fragment has not been played yet
27 { 27 {
28 str = ""; 28 var str = "";
29 if (hasBeenPlayed.length > 1) { 29 if (hasBeenPlayed.length > 1) {
30 for (var i=0; i<hasBeenPlayed.length; i++) { 30 for (var i=0; i<hasBeenPlayed.length; i++) {
31 var ao_id = audioEngineContext.audioObjects[hasBeenPlayed[i]].interfaceDOM.getPresentedId(); 31 var ao_id = audioEngineContext.audioObjects[hasBeenPlayed[i]].interfaceDOM.getPresentedId();
32 str = str + ao_id; // start from 1 32 str = str + ao_id; // start from 1
33 if (i < hasBeenPlayed.length-2){ 33 if (i < hasBeenPlayed.length-2){
34 str += ", "; 34 str += ", ";
35 } else if (i == hasBeenPlayed.length-2) { 35 } else if (i == hasBeenPlayed.length-2) {
36 str += " or "; 36 str += " or ";
37 } 37 }
38 } 38 }
39 alert('You have not played fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.'); 39 str = 'You have not played fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.';
40 } else { 40 } else {
41 alert('You have not played fragment ' + (audioEngineContext.audioObjects[hasBeenPlayed[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.'); 41 str = 'You have not played fragment ' + (audioEngineContext.audioObjects[hasBeenPlayed[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.';
42 } 42 }
43 this.storeErrorNode(str);
44 alert(str);
43 return false; 45 return false;
44 } 46 }
45 return true; 47 return true;
46 }; 48 };
47 49
82 } 84 }
83 } 85 }
84 } 86 }
85 if (state != true) 87 if (state != true)
86 { 88 {
89 this.storeErrorNode(str);
87 alert(str); 90 alert(str);
88 console.log(str); 91 console.log(str);
89 } 92 }
90 return state; 93 return state;
91 }; 94 };
102 state = false; 105 state = false;
103 strNums.push(i); 106 strNums.push(i);
104 } 107 }
105 } 108 }
106 if (state == false) { 109 if (state == false) {
110 var str = "";
107 if (strNums.length > 1) { 111 if (strNums.length > 1) {
108 var str = ""; 112
109 for (var i=0; i<strNums.length; i++) { 113 for (var i=0; i<strNums.length; i++) {
110 var ao_id = audioEngineContext.audioObjects[strNums[i]].interfaceDOM.getPresentedId(); 114 var ao_id = audioEngineContext.audioObjects[strNums[i]].interfaceDOM.getPresentedId();
111 str = str + (ao_id); // start from 1 115 str = str + (ao_id); // start from 1
112 if (i < strNums.length-2){ 116 if (i < strNums.length-2){
113 str += ", "; 117 str += ", ";
114 } else if (i == strNums.length-2) { 118 } else if (i == strNums.length-2) {
115 str += " or "; 119 str += " or ";
116 } 120 }
117 } 121 }
118 alert('You have not commented on fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.'); 122 str = 'You have not commented on fragments ' + str + ' yet. Please listen, rate and comment all samples before submitting.';
119 } else { 123 } else {
120 alert('You have not commented on fragment ' + (audioEngineContext.audioObjects[strNums[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.'); 124 str = 'You have not commented on fragment ' + (audioEngineContext.audioObjects[strNums[0]].interfaceDOM.getPresentedId()) + ' yet. Please listen, rate and comment all samples before submitting.';
121 } 125 }
126 this.storeErrorNode(str);
127 alert(str);
128 console.log(str);
122 } 129 }
123 } 130 }
124 return state; 131 return state;
125 }; 132 };
126 133
162 str += 'On axis "'+this.interfaceSliders[i].interfaceObject.title+'" you have not used the full width of the scale. '; 169 str += 'On axis "'+this.interfaceSliders[i].interfaceObject.title+'" you have not used the full width of the scale. ';
163 } 170 }
164 } 171 }
165 if (state != true) 172 if (state != true)
166 { 173 {
174 this.storeErrorNode(str);
167 alert(str); 175 alert(str);
168 console.log(str); 176 console.log(str);
169 } 177 }
170 return state; 178 return state;
171 }; 179 };