# HG changeset patch # User Nicholas Jillings # Date 1429648362 -3600 # Node ID ce9ea95a6279e4f64937688496b66df8a202452b # Parent faa111de3b330d22264d567918dc5f6674da70ac Added commentQuestion object diff -r faa111de3b33 -r ce9ea95a6279 ape.js --- a/ape.js Tue Apr 21 21:15:12 2015 +0100 +++ b/ape.js Tue Apr 21 21:32:42 2015 +0100 @@ -497,6 +497,30 @@ canvas.appendChild(trackSliderObj); }); + // Append any commentQuestion boxes + var commentQuestions = $(textXML).find('CommentQuestion'); + $(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.attributes['id'].value; + // Create a string next to each comment asking for a comment + var trackString = document.createElement('span'); + trackString.innerHTML = element.textContent; + // 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); + }); + // Now process any pre-test commands var preTest = $(testXMLSetups[id]).find('PreTest')[0]; @@ -863,6 +887,19 @@ audioElement.appendChild(metric); xmlDoc.appendChild(audioElement); } + var commentQuestion = document.getElementsByClassName('commentQuestion'); + for (var i=0; i