Mercurial > hg > webaudioevaluationtool
comparison core.js @ 1367:703192cda962
Default interface checks will attach an error node containing test page time stamp and error message on submit request.
author | Nicholas Jillings <nickjillings@users.noreply.github.com> |
---|---|
date | Mon, 01 Feb 2016 10:37:28 +0000 |
parents | ca52594840b2 |
children | c0022a09c4f6 |
comparison
equal
deleted
inserted
replaced
1366:4c6125164a1d | 1367:703192cda962 |
---|---|
2733 | 2733 |
2734 this.update = function() { | 2734 this.update = function() { |
2735 // Update the playhead position, startPlay must be called | 2735 // Update the playhead position, startPlay must be called |
2736 if (this.timePerPixel > 0) { | 2736 if (this.timePerPixel > 0) { |
2737 var time = this.playbackObject.getCurrentPosition(); | 2737 var time = this.playbackObject.getCurrentPosition(); |
2738 if (time > 0) { | 2738 if (time > 0 && time < this.maxTime) { |
2739 var width = 490; | 2739 var width = 490; |
2740 var pix = Math.floor(time/this.timePerPixel); | 2740 var pix = Math.floor(time/this.timePerPixel); |
2741 this.scrubberHead.style.left = pix+'px'; | 2741 this.scrubberHead.style.left = pix+'px'; |
2742 if (this.maxTime > 60.0) { | 2742 if (this.maxTime > 60.0) { |
2743 var secs = time%60; | 2743 var secs = time%60; |
2849 { | 2849 { |
2850 if (ao.interfaceDOM.getValue() > (ao.specification.marker/100) && ao.specification.marker > 0) { | 2850 if (ao.interfaceDOM.getValue() > (ao.specification.marker/100) && ao.specification.marker > 0) { |
2851 // Anchor is not set below | 2851 // Anchor is not set below |
2852 console.log('Anchor node not below marker value'); | 2852 console.log('Anchor node not below marker value'); |
2853 alert('Please keep listening'); | 2853 alert('Please keep listening'); |
2854 this.storeErrorNode('Anchor node not below marker value'); | |
2854 return false; | 2855 return false; |
2855 } | 2856 } |
2856 } | 2857 } |
2857 } | 2858 } |
2858 return true; | 2859 return true; |
2864 { | 2865 { |
2865 if (ao.specification.type == "reference") | 2866 if (ao.specification.type == "reference") |
2866 { | 2867 { |
2867 if (ao.interfaceDOM.getValue() < (ao.specification.marker/100) && ao.specification.marker > 0) { | 2868 if (ao.interfaceDOM.getValue() < (ao.specification.marker/100) && ao.specification.marker > 0) { |
2868 // Anchor is not set below | 2869 // Anchor is not set below |
2869 console.log('Reference node not below marker value'); | 2870 console.log('Reference node not above marker value'); |
2871 this.storeErrorNode('Reference node not above marker value'); | |
2870 alert('Please keep listening'); | 2872 alert('Please keep listening'); |
2871 return false; | 2873 return false; |
2872 } | 2874 } |
2873 } | 2875 } |
2874 } | 2876 } |
2922 str_start += ', '; | 2924 str_start += ', '; |
2923 } | 2925 } |
2924 } | 2926 } |
2925 str_start += ". Please keep listening"; | 2927 str_start += ". Please keep listening"; |
2926 console.log("[ALERT]: "+str_start); | 2928 console.log("[ALERT]: "+str_start); |
2929 this.storeErrorNode("[ALERT]: "+str_start); | |
2927 alert(str_start); | 2930 alert(str_start); |
2928 } | 2931 } |
2929 }; | 2932 }; |
2930 this.checkAllMoved = function() | 2933 this.checkAllMoved = function() |
2931 { | 2934 { |
2953 str += 'and '+failed[i]; | 2956 str += 'and '+failed[i]; |
2954 } | 2957 } |
2955 str +='.'; | 2958 str +='.'; |
2956 alert(str); | 2959 alert(str); |
2957 console.log(str); | 2960 console.log(str); |
2961 this.storeErrorNode(str); | |
2958 return false; | 2962 return false; |
2959 }; | 2963 }; |
2960 this.checkAllPlayed = function() | 2964 this.checkAllPlayed = function() |
2961 { | 2965 { |
2962 var str = "You have not played "; | 2966 var str = "You have not played "; |
2983 str += 'and '+failed[i]; | 2987 str += 'and '+failed[i]; |
2984 } | 2988 } |
2985 str +='.'; | 2989 str +='.'; |
2986 alert(str); | 2990 alert(str); |
2987 console.log(str); | 2991 console.log(str); |
2992 this.storeErrorNode(str); | |
2988 return false; | 2993 return false; |
2989 }; | 2994 }; |
2995 | |
2996 this.storeErrorNode = function(errorMessage) | |
2997 { | |
2998 var time = audioEngineContext.timer.getTestTime(); | |
2999 var node = storage.document.createElement('error'); | |
3000 node.setAttribute('time',time); | |
3001 node.textContent = errorMessage; | |
3002 testState.currentStore.XMLDOM.appendChild(node); | |
3003 }; | |
2990 } | 3004 } |
2991 | 3005 |
2992 function Storage() | 3006 function Storage() |
2993 { | 3007 { |
2994 // Holds results in XML format until ready for collection | 3008 // Holds results in XML format until ready for collection |