# HG changeset patch # User Nicholas Jillings # Date 1457535619 0 # Node ID f04d8ababef750902ec892a51b81e9042f9c2e52 # Parent 3c083ee1b743f11dc994c59d4acd12149dcf5964 Updated specification object to reflect schema changes diff -r 3c083ee1b743 -r f04d8ababef7 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