Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2248:9c7f09d3364d
Merge branch 'master' of https://github.com/BrechtDeMan/WebAudioEvaluationTool
author | www-data <www-data@sucuk.dcs.qmul.ac.uk> |
---|---|
date | Tue, 19 Apr 2016 12:21:11 +0100 |
parents | ae2bf6a1693e |
children | c32b9477cebf |
comparison
equal
deleted
inserted
replaced
2246:d052405e29e2 | 2248:9c7f09d3364d |
---|---|
190 document.getElementsByTagName('body')[0].appendChild(msg); | 190 document.getElementsByTagName('body')[0].appendChild(msg); |
191 document.getElementsByTagName('body')[0].appendChild(span); | 191 document.getElementsByTagName('body')[0].appendChild(span); |
192 document.getElementsByTagName('body')[0].appendChild(errorNode[0]); | 192 document.getElementsByTagName('body')[0].appendChild(errorNode[0]); |
193 return; | 193 return; |
194 } | 194 } |
195 if (responseDocument == undefined) { | 195 if (responseDocument == undefined || responseDocument.firstChild == undefined) { |
196 var msg = document.createElement("h3"); | 196 var msg = document.createElement("h3"); |
197 msg.textContent = "FATAL ERROR"; | 197 msg.textContent = "FATAL ERROR"; |
198 var span = document.createElement("span"); | 198 var span = document.createElement("span"); |
199 span.textContent = "The project XML was not decoded properly, try refreshing your browser and clearing caches. If the problem persists, contact the test creator."; | 199 span.textContent = "The project XML was not decoded properly, try refreshing your browser and clearing caches. If the problem persists, contact the test creator."; |
200 document.getElementsByTagName('body')[0].innerHTML = null; | 200 document.getElementsByTagName('body')[0].innerHTML = null; |
201 document.getElementsByTagName('body')[0].appendChild(msg); | 201 document.getElementsByTagName('body')[0].appendChild(msg); |
202 document.getElementsByTagName('body')[0].appendChild(span); | 202 document.getElementsByTagName('body')[0].appendChild(span); |
203 return; | 203 return; |
204 } | 204 } |
205 if (responseDocument.children[0].nodeName == "waet") { | 205 if (responseDocument.firstChild.nodeName == "waet") { |
206 // document is a specification | 206 // document is a specification |
207 | 207 |
208 // Perform XML schema validation | 208 // Perform XML schema validation |
209 var Module = { | 209 var Module = { |
210 xml: response, | 210 xml: response, |
236 // Build the specification | 236 // Build the specification |
237 specification.decode(projectXML); | 237 specification.decode(projectXML); |
238 // Generate the session-key | 238 // Generate the session-key |
239 storage.initialise(); | 239 storage.initialise(); |
240 | 240 |
241 } else if (responseDocument.children[0].nodeName == "waetresult") { | 241 } else if (responseDocument.firstChild.nodeName == "waetresult") { |
242 // document is a result | 242 // document is a result |
243 projectXML = document.implementation.createDocument(null,"waet"); | 243 projectXML = document.implementation.createDocument(null,"waet"); |
244 projectXML.children[0].appendChild(responseDocument.getElementsByTagName('waet')[0].getElementsByTagName("setup")[0].cloneNode(true)); | 244 projectXML.children[0].appendChild(responseDocument.getElementsByTagName('waet')[0].getElementsByTagName("setup")[0].cloneNode(true)); |
245 var child = responseDocument.children[0].children[0]; | 245 var child = responseDocument.children[0].children[0]; |
246 while (child != null) { | 246 while (child != null) { |