comparison analyse.html @ 610:babcc4ac48eb multiple-tests-concatenation

Tentatively addresses #1663
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 12 Mar 2016 16:30:56 +0000
parents 0256f3748b27
children
comparison
equal deleted inserted replaced
609:34d8bca65edc 610:babcc4ac48eb
22 *************/ 22 *************/
23 // folder where to find the XML files 23 // folder where to find the XML files
24 xmlFileFolder = "saves"; 24 xmlFileFolder = "saves";
25 // array of XML files 25 // array of XML files
26 // THIS IS WHERE YOU SPECIFY RESULT XML FILES TO ANALYSE 26 // THIS IS WHERE YOU SPECIFY RESULT XML FILES TO ANALYSE
27 var xmlFiles = ["3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-3d3k50w774sw0cgc4800o8o8kwk0gk84.xml", 27 var xmlFiles = ['test-2.xml'];
28 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-5t0z46181s0cwoso8480800ockk0wkww.xml",
29 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-8veul9kqv40gksgk8soso0wsws48s8o4.xml",
30 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-hxvv3zp9jk80wswgckscgc000wskkws4.xml",
31 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-i7wn9tydpckg8os48ccocsk40k8s0scc.xml",
32 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-qjbkqelkz4ssocgkgc04w8go8o8cww4o.xml",
33 "3b8692e2f7827594a2cf283ebc7ba79ba4f29149-save-w6jxem0ow004ks0o84g0kgw4wsw40k0w.xml"];
34 28
35 29
36 //TODO: make retrieval of file names automatic / drag files on here 30 //TODO: make retrieval of file names automatic / drag files on here
37 31
38 /**************** 32 /****************
308 302
309 // get root of XML file 303 // get root of XML file
310 root = xml.getElementsByTagName('waetresult')[0]; 304 root = xml.getElementsByTagName('waetresult')[0];
311 305
312 // get subject ID, add to array if not already there 306 // get subject ID, add to array if not already there
313 pretestSurveyResult = root.getElementsByTagName('surveyresult')[0]; 307 var pretestSurveyResult = root.getElementsByTagName('surveyresult')[0];
314 subjectID = pretestSurveyResult.getElementsByTagName('comment')[0]; 308 var subjectIdTextContent = undefined;
315 if (subjectID){ 309 if(typeof(pretestSurveyResult) !== "undefined"){
316 if (subjectID.getAttribute('id')!='sessionId') { // warning in console when not available 310 var subjectID = pretestSurveyResult.getElementsByTagName('comment')[0];
317 console.log(xmlFiles[fileIndex]+': no SessionID available'); 311 if (subjectID){
318 } 312 if (subjectID.getAttribute('id')==='sessionId') { // warning in console when not available
319 if (subjectArray.indexOf(subjectID.textContent) == -1) { // if not already in array 313 subjectIdTextContent = subjectID.textContent;
320 subjectArray.push(subjectID.textContent); // append to array 314 }
321 } 315 }
322 } 316 }
323 317 if(typeof(subjectIdTextContent) !== "undefined"){
318 if (subjectArray.indexOf(subjectIdTextContent) == -1) { // if not already in array
319 subjectArray.push(subjectIdTextContent); // append to array
320 }
321 } else {
322 console.log(xmlFiles[fileIndex]+': no sessionId available');
323 }
324
324 // go over all audioholders, add to array if not already there 325 // go over all audioholders, add to array if not already there
325 audioholderNodes = root.getElementsByTagName('audioholder'); 326 audioholderNodes = root.getElementsByTagName('audioholder');
326 // go over audioholderNodes and append audioholder name when not present yet 327 // go over audioholderNodes and append audioholder name when not present yet
327 for (audioholderIndex = 0; audioholderIndex < audioholderNodes.length; audioholderIndex++) { 328 for (audioholderIndex = 0; audioholderIndex < audioholderNodes.length; audioholderIndex++) {
328 audioholderName = audioholderNodes[audioholderIndex].getAttribute('id'); 329 audioholderName = audioholderNodes[audioholderIndex].getAttribute('id');