comparison core.js @ 469:d39d243e6601 Dev_main

Outside references now have an interfaceDOM. All interfaceDOM objects must respond to canMove() for determining if fixed or not.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 12 Jan 2016 18:29:55 +0000
parents 44f7a5013b94
children 1330c77d212c
comparison
equal deleted inserted replaced
468:44f7a5013b94 469:d39d243e6601
1236 file.setAttribute('sampleCount',this.buffer.buffer.length); 1236 file.setAttribute('sampleCount',this.buffer.buffer.length);
1237 file.setAttribute('duration',this.buffer.buffer.duration); 1237 file.setAttribute('duration',this.buffer.buffer.duration);
1238 this.storeDOM.appendChild(file); 1238 this.storeDOM.appendChild(file);
1239 if (this.specification.type != 'outside-reference') { 1239 if (this.specification.type != 'outside-reference') {
1240 var interfaceXML = this.interfaceDOM.exportXMLDOM(this); 1240 var interfaceXML = this.interfaceDOM.exportXMLDOM(this);
1241 if (interfaceXML.length == undefined) { 1241 if (interfaceXML != null)
1242 this.storeDOM.appendChild(interfaceXML); 1242 {
1243 } else { 1243 if (interfaceXML.length == undefined) {
1244 for (var i=0; i<interfaceXML.length; i++) 1244 this.storeDOM.appendChild(interfaceXML);
1245 { 1245 } else {
1246 this.storeDOM.appendChild(interfaceXML[i]); 1246 for (var i=0; i<interfaceXML.length; i++)
1247 {
1248 this.storeDOM.appendChild(interfaceXML[i]);
1249 }
1247 } 1250 }
1248 } 1251 }
1249 if (this.commentDOM != null) { 1252 if (this.commentDOM != null) {
1250 this.storeDOM.appendChild(this.commentDOM.exportXMLDOM(this)); 1253 this.storeDOM.appendChild(this.commentDOM.exportXMLDOM(this));
1251 } 1254 }
2728 } 2731 }
2729 } 2732 }
2730 if (passed == false) 2733 if (passed == false)
2731 { 2734 {
2732 check_pass = false; 2735 check_pass = false;
2733 console.log("Continue listening to track-"+i); 2736 console.log("Continue listening to track-"+audioEngineContext.audioObjects.interfaceDOM.getPresentedId());
2734 error_obj.push(i); 2737 error_obj.push(audioEngineContext.audioObjects.interfaceDOM.getPresentedId());
2735 } 2738 }
2736 } 2739 }
2737 if (check_pass == false) 2740 if (check_pass == false)
2738 { 2741 {
2739 var str_start = "You have not completely listened to fragments "; 2742 var str_start = "You have not completely listened to fragments ";
2752 }; 2755 };
2753 this.checkAllMoved = function() 2756 this.checkAllMoved = function()
2754 { 2757 {
2755 var str = "You have not moved "; 2758 var str = "You have not moved ";
2756 var failed = []; 2759 var failed = [];
2757 for (var i in audioEngineContext.audioObjects) 2760 for (var ao of audioEngineContext.audioObjects)
2758 { 2761 {
2759 if(audioEngineContext.audioObjects[i].metric.wasMoved == false && audioEngineContext.audioObjects[i].specification.type != 'outsidereference') 2762 if(ao.metric.wasMoved == false && ao.interfaceDOM.canMove() == true)
2760 { 2763 {
2761 failed.push(audioEngineContext.audioObjects[i].id); 2764 failed.push(ao.interfaceDOM.getPresentedId());
2762 } 2765 }
2763 } 2766 }
2764 if (failed.length == 0) 2767 if (failed.length == 0)
2765 { 2768 {
2766 return true; 2769 return true;
2782 }; 2785 };
2783 this.checkAllPlayed = function() 2786 this.checkAllPlayed = function()
2784 { 2787 {
2785 var str = "You have not played "; 2788 var str = "You have not played ";
2786 var failed = []; 2789 var failed = [];
2787 for (var i in audioEngineContext.audioObjects) 2790 for (var ao of audioEngineContext.audioObjects)
2788 { 2791 {
2789 if(audioEngineContext.audioObjects[i].metric.wasListenedTo == false) 2792 if(ao.metric.wasListenedTo == false)
2790 { 2793 {
2791 failed.push(audioEngineContext.audioObjects[i].id); 2794 failed.push(ao.interfaceDOM.getPresentedId());
2792 } 2795 }
2793 } 2796 }
2794 if (failed.length == 0) 2797 if (failed.length == 0)
2795 { 2798 {
2796 return true; 2799 return true;