comparison js/specification.js @ 2464:75bd7b5dc522

Implemented #5
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 23 Jun 2016 13:44:17 +0100
parents 0ff4a9925597
children af42b5492f46
comparison
equal deleted inserted replaced
2463:fda7ee7bb914 2464:75bd7b5dc522
212 this.boxsize = undefined; 212 this.boxsize = undefined;
213 this.options = []; 213 this.options = [];
214 this.min = undefined; 214 this.min = undefined;
215 this.max = undefined; 215 this.max = undefined;
216 this.step = undefined; 216 this.step = undefined;
217 this.conditions = [];
217 218
218 this.decode = function(parent,child) 219 this.decode = function(parent,child)
219 { 220 {
220 var attributeMap = this.schema.getAllElementsByTagName('xs:attribute'); 221 var attributeMap = this.schema.getAllElementsByTagName('xs:attribute');
221 for (var i in attributeMap){ 222 for (var i in attributeMap){
250 text: children[i].textContent 251 text: children[i].textContent
251 }); 252 });
252 } 253 }
253 } 254 }
254 } 255 }
256 var conditionElements = child.getElementsByTagName("conditional");
257 for (var i=0; i<conditionElements.length; i++) {
258 var condition = conditionElements[i];
259 var obj = {
260 check: condition.getAttribute("check"),
261 value: condition.getAttribute("value"),
262 jumpToOnPass: condition.getAttribute("jumpToOnPass"),
263 jumpToOnFail: condition.getAttribute("jumpToOnFail")
264 }
265 this.conditions.push(obj);
266 }
255 }; 267 };
256 268
257 this.exportXML = function(doc) 269 this.exportXML = function(doc)
258 { 270 {
259 var node = doc.createElement('surveyentry'); 271 var node = doc.createElement('surveyentry');