comparison core.js @ 820:7b0ce3a9ddc1

Merge from branch "WAC2016"
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 23 Nov 2015 09:13:12 +0000
parents 2ac1cb304fdc
children e266584705fc
comparison
equal deleted inserted replaced
819:bf38bba18886 820:7b0ce3a9ddc1
188 case 'huge': 188 case 'huge':
189 textArea.cols = "50"; 189 textArea.cols = "50";
190 textArea.rows = "10"; 190 textArea.rows = "10";
191 break; 191 break;
192 } 192 }
193 document.onkeydown=function(){
194 if(window.event.keyCode=='13'){ // when you hit enter
195 window.event.preventDefault(); // don't make newline
196 popup.proceedClicked(); // go to the next window (or start the test or submit)
197 }
198 }
193 this.popupResponse.appendChild(textArea); 199 this.popupResponse.appendChild(textArea);
194 textArea.focus(); 200 textArea.focus();
195 } else if (node.type == 'checkbox') { 201 } else if (node.type == 'checkbox') {
196 this.popupTitle.textContent = node.statement; 202 this.popupTitle.textContent = node.statement;
197 var optHold = this.popupResponse; 203 var optHold = this.popupResponse;
666 xmlhttp.onreadystatechange = function() { 672 xmlhttp.onreadystatechange = function() {
667 console.log(xmlhttp.status); 673 console.log(xmlhttp.status);
668 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) { 674 if (xmlhttp.status != 200 && xmlhttp.readyState == 4) {
669 createProjectSave(null); 675 createProjectSave(null);
670 } else { 676 } else {
671 popup.showPopup(); 677 if (xmlhttp.responseXML == null)
672 popup.popupContent.innerHTML = null; 678 {
673 popup.popupContent.textContent = "Thank you for performing this listening test"; 679 return createProjectSave(null);
680 }
681 var response = xmlhttp.responseXML.childNodes[0];
682 if (response.getAttribute('state') == "OK")
683 {
684 var file = response.getElementsByTagName('file')[0];
685 console.log('Save OK: Filename '+file.textContent+','+file.getAttribute('bytes')+'B');
686 popup.showPopup();
687 popup.popupContent.innerHTML = null;
688 popup.popupContent.textContent = "Thank you!";
689 } else {
690 var message = response.getElementsByTagName('message')[0];
691 errorSessionDump(message.textContent);
692 }
674 } 693 }
675 }; 694 };
676 xmlhttp.send(file); 695 xmlhttp.send(file);
677 } 696 }
678 } 697 }