comparison core.js @ 1326:9941539aa52b

MUSHRA operating on new core / specification
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Wed, 06 Jan 2016 12:56:29 +0000
parents d30cc402e6fa
children c1c696ccd6f9
comparison
equal deleted inserted replaced
1325:d30cc402e6fa 1326:9941539aa52b
513 console.log("Question Response: "+ textArea.value); 513 console.log("Question Response: "+ textArea.value);
514 node.response = textArea.value; 514 node.response = textArea.value;
515 } 515 }
516 } else if (node.specification.type == 'checkbox') { 516 } else if (node.specification.type == 'checkbox') {
517 // Must extract checkbox data 517 // Must extract checkbox data
518 console.log("Checkbox: "+ node.statement); 518 console.log("Checkbox: "+ node.specification.statement);
519 var inputs = this.popupResponse.getElementsByTagName('input'); 519 var inputs = this.popupResponse.getElementsByTagName('input');
520 node.response = []; 520 node.response = [];
521 for (var i=0; i<node.specification.options.length; i++) { 521 for (var i=0; i<node.specification.options.length; i++) {
522 node.response.push({ 522 node.response.push({
523 name: node.specification.options[i].name, 523 name: node.specification.options[i].name,
524 text: node.specification.options[i].text, 524 text: node.specification.options[i].text,
525 checked: inputs[i].checked 525 checked: inputs[i].checked
526 }); 526 });
527 console.log(node.specification.options[i].name+": "+ inputs[i].checked);
527 } 528 }
528 } else if (node.specification.type == "radio") { 529 } else if (node.specification.type == "radio") {
529 var optHold = this.popupResponse; 530 var optHold = this.popupResponse;
530 console.log("Radio: "+ node.specification.statement); 531 console.log("Radio: "+ node.specification.statement);
531 node.response = null; 532 node.response = null;
2857 break; 2858 break;
2858 case "checkbox": 2859 case "checkbox":
2859 for (var i=0; i<node.response.length; i++) 2860 for (var i=0; i<node.response.length; i++)
2860 { 2861 {
2861 var checkNode = this.parent.document.createElement('response'); 2862 var checkNode = this.parent.document.createElement('response');
2862 child.setAttribute('name',node.response.name); 2863 checkNode.setAttribute('name',node.response.name);
2863 child.setAttribute('checked',node.response.checked); 2864 checkNode.setAttribute('checked',node.response.checked);
2864 child.textContent = node.response.text; 2865 surveyresult.appendChild(checkNode);
2865 surveyresult.appendChild(child);
2866 } 2866 }
2867 break; 2867 break;
2868 } 2868 }
2869 }; 2869 };
2870 }; 2870 };