# HG changeset patch # User Nicholas Jillings # Date 1457535619 0 # Node ID 08fab304c10e7ca1b817ec01666832d4295dab1b # Parent 9abb207d2f6ac1b91c16949bd9d5e1ec13f40187 Updated specification object to reflect schema changes diff -r 9abb207d2f6a -r 08fab304c10e core.js --- a/core.js Wed Mar 09 14:40:12 2016 +0000 +++ b/core.js Wed Mar 09 15:00:19 2016 +0000 @@ -1917,6 +1917,7 @@ this.type = undefined; this.schema = specification.schema.getAllElementsByName('surveyentry')[0]; this.id = undefined; + this.name = undefined; this.mandatory = undefined; this.statement = undefined; this.boxsize = undefined; @@ -1972,34 +1973,32 @@ var statement = doc.createElement('statement'); statement.textContent = this.statement; node.appendChild(statement); - switch(this.type) - { - case "statement": - break; - case "question": + if (this.type != "statement") { node.id = this.id; + if (this.name != undefined) { node.setAttribute("name",this.name);} if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);} - if (this.boxsize != undefined) {node.setAttribute("boxsize",this.boxsize);} - break; - case "number": - node.id = this.id; - if (this.mandatory != undefined) { node.setAttribute("mandatory",this.mandatory);} - if (this.min != undefined) {node.setAttribute("min", this.min);} - if (this.max != undefined) {node.setAttribute("max", this.max);} - break; - case "checkbox": - case "radio": - node.id = this.id; - for (var i=0; i