# HG changeset patch # User Nicholas Jillings # Date 1433757681 -3600 # Node ID 8ea4b48bbe11f91856ea831cb1692ac8ae614139 # Parent f4c6c98055298645b07fdfb4db9e0623bf415684# Parent b0d68351088179a0cdd0a335274d32e53a8bf1dd Merge from the default branch diff -r f4c6c9805529 -r 8ea4b48bbe11 ape.css --- a/ape.css Fri Jun 05 12:42:32 2015 +0100 +++ b/ape.css Mon Jun 08 11:01:21 2015 +0100 @@ -51,15 +51,11 @@ min-height: 30px; } -div.sliderScale span{ - font-size: 1.2em; -} - div.sliderScale span { /* Any formatting of text below scale */ + font-size: 1.2em; min-width: 5px; height: 20px; - height: 100%; position: absolute; } diff -r f4c6c9805529 -r 8ea4b48bbe11 ape.js --- a/ape.js Fri Jun 05 12:42:32 2015 +0100 +++ b/ape.js Mon Jun 08 11:01:21 2015 +0100 @@ -292,27 +292,9 @@ interfaceContext.showCommentBoxes(feedbackHolder,true); } - // Append any commentQuestion boxes $(audioHolderObject.commentQuestions).each(function(index,element) { - // Create document objects to hold the comment boxes - var trackComment = document.createElement('div'); - trackComment.className = 'comment-div commentQuestion'; - trackComment.id = element.id; - // Create a string next to each comment asking for a comment - var trackString = document.createElement('span'); - trackString.innerHTML = element.question; - // Create the HTML5 comment box 'textarea' - var trackCommentBox = document.createElement('textarea'); - trackCommentBox.rows = '4'; - trackCommentBox.cols = '100'; - trackCommentBox.name = 'commentQuestion'+index; - trackCommentBox.className = 'trackComment'; - var br = document.createElement('br'); - // Add to the holder. - trackComment.appendChild(trackString); - trackComment.appendChild(br); - trackComment.appendChild(trackCommentBox); - feedbackHolder.appendChild(trackComment); + var node = interfaceContext.createCommentQuestion(element); + feedbackHolder.appendChild(node.holder); }); @@ -484,19 +466,10 @@ var audioElement = audioEngineContext.audioObjects[i].exportXMLDOM(); xmlDoc.appendChild(audioElement); } - var commentQuestion = document.getElementsByClassName('commentQuestion'); - for (var i=0; i= this.options.length) { + break; + } + } + if (i >= this.options.length) { + response.textContent = 'null'; + } else { + response.textContent = this.options[i].getAttribute('setvalue'); + response.setAttribute('number',i); + } + root.appendChild(question); + root.appendChild(response); + return root; + }; + }; + + this.createCommentBox = function(audioObject) { - var node = new this.commentBox(audioObject); + var node = new this.elementCommentBox(audioObject); this.commentBoxes.push(node); audioObject.commentDOM = node; return node; @@ -1293,5 +1451,16 @@ inject.appendChild(this.commentBoxes[i].trackComment); } }; + + this.createCommentQuestion = function(element) { + var node; + if (element.type == 'text') { + node = new this.commentBox(element); + } else if (element.type == 'radio') { + node = new this.radioBox(element); + } + this.commentQuestions.push(node); + return node; + }; } diff -r f4c6c9805529 -r 8ea4b48bbe11 example_eval/project.xml --- a/example_eval/project.xml Fri Jun 05 12:42:32 2015 +0100 +++ b/example_eval/project.xml Mon Jun 08 11:01:21 2015 +0100 @@ -2,7 +2,7 @@ - Please enter your location. + Please enter your location. Check options which are relevant to you @@ -54,7 +54,15 @@ --> - What is your mixing experience + What is your mixing experience + + Please enter your ranking preference on this song + + + + + + Please enter the genre diff -r f4c6c9805529 -r 8ea4b48bbe11 scripts/score_boxplot.py --- a/scripts/score_boxplot.py Fri Jun 05 12:42:32 2015 +0100 +++ b/scripts/score_boxplot.py Mon Jun 08 11:01:21 2015 +0100 @@ -64,8 +64,7 @@ plt.ylabel('Rating') plt.ylim(0,1) - plt.show() + #plt.show() # show plot #exit() - #TODO Save output automatically - + plt.savefig(rating_folder+page_name+"-ind.png") diff -r f4c6c9805529 -r 8ea4b48bbe11 scripts/score_individual.py --- a/scripts/score_individual.py Fri Jun 05 12:42:32 2015 +0100 +++ b/scripts/score_individual.py Mon Jun 08 11:01:21 2015 +0100 @@ -9,7 +9,7 @@ markerlist = ["x", ".", "o", "*", "+", "v", ">", "<", "8", "s", "p"] # get every csv file in folder -for file in os.listdir(rating_folder): # You have to put this in folder where rating csv files are. +for file in os.listdir(rating_folder): if file.endswith(".csv"): page_name = file[:-4] # file name (without extension) is page ID @@ -47,13 +47,14 @@ plt.legend(linehandles, legendnames, loc='upper right', - bbox_to_anchor=(1.1, 1), borderaxespad=0.) + bbox_to_anchor=(1.1, 1), + borderaxespad=0., + numpoints=1 # remove extra marker + ) #TODO Put legend outside of box - #TODO Why two markers in legend? - plt.show() + #plt.show() # show plot #exit() - #TODO Save output automatically - + plt.savefig(rating_folder+page_name+"-ind.png")