Mercurial > hg > webaudioevaluationtool
changeset 943:759c2ace3c65
Merge
author | Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk> |
---|---|
date | Sun, 17 May 2015 21:37:08 +0100 |
parents | b5262d076f0b (current diff) 36d5c460f04b (diff) |
children | 23bf5007b552 |
files | ape.css ape.js core.js example_eval/project.xml index.html |
diffstat | 1 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/ape.js Sun May 17 18:40:56 2015 +0100 +++ b/ape.js Sun May 17 21:37:08 2015 +0100 @@ -242,7 +242,7 @@ currentState = 'preTest'; // Create Pre-Test Box - if (preTest != undefined && preTest.children.length >= 1) + if (preTest != undefined && preTest.childElementCount >= 1) { showPopup(); preTestPopupStart(preTest); @@ -537,7 +537,7 @@ // Now process any pre-test commands var preTest = $(testXMLSetups[id]).find('PreTest')[0]; - if (preTest.children.length > 0) + if (preTest.childElementCount > 0) { currentState = 'testRunPre-'+id; preTestPopupStart(preTest); @@ -556,15 +556,15 @@ preTestOption.id = 'preTest'; preTestOption.style.marginTop = '25px'; preTestOption.align = "center"; - var child = preTest.children[0]; + var child = $(preTest).children()[0]; if (child.nodeName == 'statement') { - preTestOption.innerHTML = '<span>'+child.innerHTML+'</span>'; + preTestOption.innerHTML = '<span>'+child.textContent+'</span>'; } else if (child.nodeName == 'question') { var questionId = child.attributes['id'].value; var textHold = document.createElement('span'); - textHold.innerHTML = child.innerHTML; + textHold.innerHTML = child.textContent; textHold.id = questionId + 'response'; var textEnter = document.createElement('textarea'); preTestOption.appendChild(textHold); @@ -616,11 +616,11 @@ // Need to find and parse preTest again! var preTestOption = document.getElementById('preTest'); // Check if current state is a question! - if (preTest.children[index].nodeName == 'question') { - var questionId = preTest.children[index].attributes['id'].value; + if ($(preTest).children()[index].nodeName == 'question') { + var questionId = $(preTest).children()[index].attributes['id'].value; var questionHold = document.createElement('comment'); var questionResponse = document.getElementById(questionId + 'response'); - var mandatory = preTest.children[index].attributes['mandatory']; + var mandatory = $(preTest).children()[index].attributes['mandatory']; if (mandatory != undefined){ if (mandatory.value == 'true') {mandatory = true;} else {mandatory = false;} @@ -633,17 +633,17 @@ postPopupResponse(questionHold); } index++; - if (index < preTest.children.length) + if (index < preTest.childElementCount) { // More to process - var child = preTest.children[index]; + var child = $(preTest).children()[index]; if (child.nodeName == 'statement') { - preTestOption.innerHTML = '<span>'+child.innerHTML+'</span>'; + preTestOption.innerHTML = '<span>'+child.textContent+'</span>'; } else if (child.nodeName == 'question') { var textHold = document.createElement('span'); - textHold.innerHTML = child.innerHTML; + textHold.innerHTML = child.textContent; var textEnter = document.createElement('textarea'); textEnter.id = child.attributes['id'].value + 'response'; var br = document.createElement('br'); @@ -748,7 +748,7 @@ if (postXML == undefined) { testEnded(testId); } - else if (postXML.children.length > 0) + else if (postXML.childElementCount > 0) { currentState = 'testRunPost-'+testId; showPopup();