# HG changeset patch # User Nicholas Jillings # Date 1506421367 -3600 # Node ID ae0950bc1c99e018cddb3ed29d7c34a92bc0c44f # Parent 1620cbee911124ffd8d6139b85d6e3cadf1b872c Close #218. Added to test_create. diff -r 1620cbee9111 -r ae0950bc1c99 js/specification.js --- a/js/specification.js Tue Sep 26 10:15:39 2017 +0100 +++ b/js/specification.js Tue Sep 26 11:22:47 2017 +0100 @@ -704,8 +704,12 @@ AHNode.appendChild(this.audioElements[i].encode(root)); } // Create - for (i = 0; i < this.commentQuestions.length; i++) { - AHNode.appendChild(this.commentQuestions[i].encode(root)); + if (this.commentQuestions.length > 0) { + var node = root.createElement("commentquestions"); + for (i = 0; i < this.commentQuestions.length; i++) { + node.appendChild(this.commentQuestions[i].encode(root)); + } + AHNode.appendChild(node); } AHNode.appendChild(this.preTest.encode(root)); @@ -804,6 +808,7 @@ throw ("Unknown type " + this.type); } node.id = this.id; + node.setAttribute("mandatory", this.mandatory); node.setAttribute("type", this.type); if (this.name !== undefined) { node.setAttribute("name", this.name); diff -r 1620cbee9111 -r ae0950bc1c99 test_create.html --- a/test_create.html Tue Sep 26 10:15:39 2017 +0100 +++ b/test_create.html Tue Sep 26 11:22:47 2017 +0100 @@ -933,6 +933,15 @@
+ Type: + +
+
Unique ID:
@@ -940,6 +949,10 @@ Common Name:
+
+ Mandatory: + +
Minimum: