comparison ape.js @ 690:657d63ab4458

Updated SMC Paper to reflect comments. Fixed bug in ape where no comment boxes crashed data collection.
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 22 Apr 2015 10:45:08 +0100
parents f996a6663907
children 06fbaccf3b58
comparison
equal deleted inserted replaced
689:f996a6663907 690:657d63ab4458
812 function pageXMLSave(testId) 812 function pageXMLSave(testId)
813 { 813 {
814 // Saves a specific test page 814 // Saves a specific test page
815 var xmlDoc = currentTestHolder; 815 var xmlDoc = currentTestHolder;
816 // Check if any session wide metrics are enabled 816 // Check if any session wide metrics are enabled
817
818 var commentShow = testXMLSetups[testId].attributes['elementComments'];
819 if (commentShow != undefined) {
820 if (commentShow.value == 'false') {commentShow = false;}
821 else {commentShow = true;}
822 } else {commentShow = true;}
823
817 var metric = document.createElement('metric'); 824 var metric = document.createElement('metric');
818 if (audioEngineContext.metric.enableTestTimer) 825 if (audioEngineContext.metric.enableTestTimer)
819 { 826 {
820 var testTime = document.createElement('metricResult'); 827 var testTime = document.createElement('metricResult');
821 testTime.id = 'testTime'; 828 testTime.id = 'testTime';
830 var audioElement = document.createElement('audioElement'); 837 var audioElement = document.createElement('audioElement');
831 audioElement.id = currentTrackOrder[i].attributes['id'].value; 838 audioElement.id = currentTrackOrder[i].attributes['id'].value;
832 audioElement.url = currentTrackOrder[i].attributes['url'].value; 839 audioElement.url = currentTrackOrder[i].attributes['url'].value;
833 var value = document.createElement('value'); 840 var value = document.createElement('value');
834 value.innerHTML = convSliderPosToRate(i); 841 value.innerHTML = convSliderPosToRate(i);
835 var comment = document.createElement("comment"); 842 if (commentShow) {
836 var question = document.createElement("question"); 843 var comment = document.createElement("comment");
837 var response = document.createElement("response"); 844 var question = document.createElement("question");
838 question.textContent = commentObjects[i].children[0].textContent; 845 var response = document.createElement("response");
839 response.textContent = commentObjects[i].children[2].value; 846 question.textContent = commentObjects[i].children[0].textContent;
840 comment.appendChild(question); 847 response.textContent = commentObjects[i].children[2].value;
841 comment.appendChild(response); 848 comment.appendChild(question);
849 comment.appendChild(response);
850 audioElement.appendChild(comment);
851 }
842 audioElement.appendChild(value); 852 audioElement.appendChild(value);
843 audioElement.appendChild(comment);
844 // Check for any per element metrics 853 // Check for any per element metrics
845 var metric = document.createElement('metric'); 854 var metric = document.createElement('metric');
846 var elementMetric = audioEngineContext.audioObjects[i].metric; 855 var elementMetric = audioEngineContext.audioObjects[i].metric;
847 if (audioEngineContext.metric.enableElementTimer) { 856 if (audioEngineContext.metric.enableElementTimer) {
848 var elementTimer = document.createElement('metricResult'); 857 var elementTimer = document.createElement('metricResult');
924 xmlDoc.appendChild(preTestQuestions); 933 xmlDoc.appendChild(preTestQuestions);
925 xmlDoc.appendChild(postTestQuestions); 934 xmlDoc.appendChild(postTestQuestions);
926 935
927 return xmlDoc; 936 return xmlDoc;
928 } 937 }
929