comparison core.js @ 620:e0934138c676 Dev_main

Fixed test creator <surveyentry> options. Updated interface-specs for ABX.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 16 Mar 2016 15:17:04 +0000
parents c99d334d8534
children 2930218004f5
comparison
equal deleted inserted replaced
619:c99d334d8534 620:e0934138c676
2026 var node = doc.createElement('surveyentry'); 2026 var node = doc.createElement('surveyentry');
2027 node.setAttribute('type',this.type); 2027 node.setAttribute('type',this.type);
2028 var statement = doc.createElement('statement'); 2028 var statement = doc.createElement('statement');
2029 statement.textContent = this.statement; 2029 statement.textContent = this.statement;
2030 node.appendChild(statement); 2030 node.appendChild(statement);
2031 if (this.type != "statement") { 2031 node.id = this.id;
2032 node.id = this.id; 2032 if (this.name != undefined) { node.setAttribute("name",this.name);}
2033 if (this.name != undefined) { node.setAttribute("name",this.name);} 2033 if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);}
2034 if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);} 2034 node.id = this.id;
2035 switch(this.type) 2035 if (this.name != undefined) {node.setAttribute("name",this.name);}
2036 { 2036 switch(this.type)
2037 case "question": 2037 {
2038 if (this.boxsize != undefined) {node.setAttribute("boxsize",this.boxsize);}
2039 break;
2040 case "number":
2041 if (this.min != undefined) {node.setAttribute("min", this.min);}
2042 if (this.max != undefined) {node.setAttribute("max", this.max);}
2043 break;
2044 case "checkbox": 2038 case "checkbox":
2045 case "radio": 2039 case "radio":
2046 for (var i=0; i<this.options.length; i++) 2040 for (var i=0; i<this.options.length; i++)
2047 { 2041 {
2048 var option = this.options[i]; 2042 var option = this.options[i];
2049 var optionNode = doc.createElement("option"); 2043 var optionNode = doc.createElement("option");
2050 optionNode.setAttribute("name",option.name); 2044 optionNode.setAttribute("name",option.name);
2051 optionNode.textContent = option.text; 2045 optionNode.textContent = option.text;
2052 node.appendChild(optionNode); 2046 node.appendChild(optionNode);
2053 } 2047 }
2048 case "number":
2049 if (this.min != undefined) {node.setAttribute("min", this.min);}
2050 if (this.max != undefined) {node.setAttribute("max", this.max);}
2051 case "question":
2052 if (this.boxsize != undefined) {node.setAttribute("boxsize",this.boxsize);}
2053 if (this.mandatory != undefined) {node.setAttribute("mandatory",this.mandatory);}
2054 default:
2054 break; 2055 break;
2055 }
2056 } 2056 }
2057 return node; 2057 return node;
2058 }; 2058 };
2059 }; 2059 };
2060 this.decode = function(parent,xml) { 2060 this.decode = function(parent,xml) {