Index: Dev/trunk/src/client/qed-client/css/model/widgets/MultipleChoiceWidget.less
===================================================================
--- Dev/trunk/src/client/qed-client/css/model/widgets/MultipleChoiceWidget.less	(revision 510)
+++ Dev/trunk/src/client/qed-client/css/model/widgets/MultipleChoiceWidget.less	(revision 511)
@@ -1,5 +1,10 @@
-#rft.claro .qedMultipleChoiceWidget {
-    .subcode {
-        &.dijitTextBox {
+#rft.claro {
+    .qedMultipleChoiceWidget {
+        .openItem {
+            margin-left: 2em;
+        }
+    }
+    .qedMultipleChoiceConfigWidget {
+        .subcode {
             width: 4em;
         }
Index: Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreview.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreview.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreview.js	(revision 511)
@@ -18,13 +18,13 @@
             });
         },
-        createListElement: function(id, item) {
+        createListElement: function(id, item, fromDrop) {
             var previewItem = new QuestionEditorPreviewItem({
                 id: id,
                 value: item
             });
-            previewItem.showEdit();
+            previewItem.startup();
+            if ( fromDrop ) { previewItem.showEdit(); }
             this.own(previewItem.on('destroy',
                                     lang.hitch(this,'removeItem',id,true)));
-            previewItem.startup();
             return previewItem;
         }
Index: Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreviewItem.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreviewItem.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreviewItem.js	(revision 511)
@@ -148,4 +148,7 @@
         _destroyInnerWidget: function() {
             if ( this.innerWidget !== null ) {
+                if ( this._editing === true ) {
+                    this._onChange();
+                }
                 this.removeChild(this.innerWidget);
                 this.innerWidget.destroyRecursive();
Index: Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js	(revision 511)
@@ -4,7 +4,8 @@
     "dojo/_base/array",
     "dojo/_base/declare",
+    "dojo/_base/lang",
     "dojo/dom-construct",
     "dojo/text!./templates/SurveyRenderWidget.html"
-], function(_ComplexValueWidget, QuestionWidgetFactory, array, declare, domConstruct, template) {
+], function(_ComplexValueWidget, QuestionWidgetFactory, array, declare, lang, domConstruct, template) {
     return declare([_ComplexValueWidget],{
         templateString: template,
@@ -31,4 +32,18 @@
                 },this);
             },this);
+        },
+        _getValueAttr: function() {
+            var newValue = {};
+            array.forEach(this._getDescendantFormWidgets(),function(widget){
+                lang.mixin(newValue,widget.get('value'));
+            },this);
+            this.value = newValue;
+            return this.value;
+        },
+        _setValueAttr: function(value) {
+            array.forEach(this._getDescendantFormWidgets(),function(widget){
+                widget.set('value',value);
+            },this);
+            this.value = value;
         }
     });
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/Factory.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/Factory.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/Factory.js	(revision 511)
@@ -9,6 +9,4 @@
     "./ScaleInputConfigWidget",
     "./ScaleInputWidget",
-    "./SingleChoiceInputConfigWidget",
-    "./SingleChoiceInputWidget",
     "./StringInputConfigWidget",
     "./StringInputWidget",
@@ -19,5 +17,5 @@
     "dijit/_WidgetBase",
     "dojo/_base/declare"
-], function(objectFuns, HeaderConfigWidget, HeaderWidget, MultipleChoiceInputConfigWidget, MultipleChoiceInputWidget, NumberInputConfigWidget, NumberInputWidget, ScaleInputConfigWidget, ScaleInputWidget, SingleChoiceInputConfigWidget, SingleChoiceInputWidget, StringInputConfigWidget, StringInputWidget, TextConfigWidget, TextInputConfigWidget, TextInputWidget, TextWidget, _WidgetBase, declare) {
+], function(objectFuns, HeaderConfigWidget, HeaderWidget, MultipleChoiceInputConfigWidget, MultipleChoiceInputWidget, NumberInputConfigWidget, NumberInputWidget, ScaleInputConfigWidget, ScaleInputWidget, StringInputConfigWidget, StringInputWidget, TextConfigWidget, TextInputConfigWidget, TextInputWidget, TextWidget, _WidgetBase, declare) {
     
     var DividerWidget = declare([_WidgetBase], {
@@ -34,6 +32,8 @@
         TextInput: TextInputWidget,
         NumberInput: NumberInputWidget,
-        MultipleChoiceInput: MultipleChoiceInputWidget,
-        SingleChoiceInput: SingleChoiceInputWidget,
+        MultipleChoiceInput: declare([MultipleChoiceInputWidget],
+                                     {allowMultiple:true}),
+        SingleChoiceInput: declare([MultipleChoiceInputWidget],
+                                   {allowMultiple:false}),
         ScaleInput: ScaleInputWidget
     };
@@ -44,6 +44,8 @@
         TextInput: TextInputConfigWidget,
         NumberInput: NumberInputConfigWidget,
-        MultipleChoiceInput: MultipleChoiceInputConfigWidget,
-        SingleChoiceInput: SingleChoiceInputConfigWidget,
+        MultipleChoiceInput: declare([MultipleChoiceInputConfigWidget],
+                                     {allowMultiple:true}),
+        SingleChoiceInput: declare([MultipleChoiceInputConfigWidget],
+                                   {allowMultiple:false}),
         ScaleInput: ScaleInputConfigWidget
     };
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputConfigWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputConfigWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputConfigWidget.js	(revision 511)
@@ -19,6 +19,7 @@
     
     return declare([_ComplexValueWidget],{
-        baseClass: 'qedMultipleChoiceWidget',
+        baseClass: 'qedMultipleChoiceConfigWidget',
         templateString: template,
+        allowMultiple: false,
         buildRendering: function() {
             this.inherited(arguments);
@@ -36,4 +37,6 @@
                 id: id,
                 value: item,
+                _valueOrSubcode: this.allowMultiple ? 'subcode' : 'value',
+                _valueOrSubcodeName: this.allowMultiple ? 'Subcode' : 'Value',
                 onDestroy: lang.hitch(this,function(evt){
                     this.itemsWidget.removeItem(id,true);
@@ -54,4 +57,37 @@
             if ( evt ) { event.stop(evt); }
             return false;
+        },
+        _setDisabledAttr: function() {
+            this.inherited(arguments);
+            this._handleOpenItemChange();
+        },
+        _setReadOnlyAttr: function() {
+            this.inherited(arguments);
+            this._handleOpenItemChange();
+        },
+        _getValueAttr: function() {
+            var value = this.inherited(arguments);
+            if ( value.lastItemIsOpen[0] ) {
+                value.lastItemIsOpen = {
+                    subcode: value.openItemSubcode
+                };
+            } else {
+                delete value.lastItemIsOpen;
+            }
+            delete value.openItemSubcode;
+            return value;
+        },
+        _setValueAttr: function(value) {
+            if ( value.lastItemIsOpen ) {
+                value.openItemSubcode = value.lastItemIsOpen.subcode;
+                value.lastItemIsOpen = ["on"];
+            }
+            this.inherited(arguments);
+        },
+        _handleOpenItemChange: function() {
+            var enabled = !(this.readOnly || this.disabled) &&  
+                          this.openItemCheckBox.get('value')[0];
+            this.openItemSubcodeTextBox.set('disabled',!enabled);
+            this.openItemSubcodeTextBox.set('readOnly',!enabled);
         }
     });
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/MultipleChoiceInputWidget.js	(revision 511)
@@ -1,26 +1,31 @@
 define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
+    "../../../widgets/_ComplexValueWidget",
     "dijit/form/CheckBox",
+    "dijit/form/RadioButton",
+    "dijit/form/TextBox",
     "dojo/_base/array",
     "dojo/_base/declare",
+    "dojo/_base/lang",
     "dojo/dom-construct",
     "dojo/text!./templates/MultipleChoiceInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, CheckBox, array, declare, domConstruct, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+], function(_ComplexValueWidget, CheckBox, RadioButton, TextBox, array, declare, lang, domConstruct, template) {
+    return declare([_ComplexValueWidget],{
         templateString: template,
+        baseClass: 'qedMultipleChoiceWidget',
+        allowMultiple: false,
         startup: function() {
             if ( this._started ) { return; }
             this.inherited(arguments);
 
+            var Ctor = this.allowMultiple ? CheckBox : RadioButton;
+
+            var input;
             domConstruct.empty(this.domNode);
             array.forEach(this.items, function(item){
                 var div = domConstruct.create("div", {
                 }, this.domNode, "last");
-                var input = new CheckBox({
-                    name: this.code + item.subcode,
-                    value: 1
+                input = new Ctor({
+                    name: this.code + (this.allowMultiple?item.subcode:this.subcode),
+                    value: this.allowMultiple ? 1 : item.value
                 }).placeAt(div);
                 var label = domConstruct.create("label",{
@@ -29,4 +34,37 @@
                 }, div);
             }, this);
+            
+            if ( this.lastItemIsOpen && input ) {
+                this.lastItem = input;
+                var openItemDiv = domConstruct.create("div", {
+                }, this.domNode, "last");
+                this.openItemTextBox = new TextBox({
+                    name: this.code + this.lastItemIsOpen.subcode,
+                    disabled: true,
+                    readOnly: true,
+                    'class': 'openItem'
+                });
+                this.openItemTextBox.placeAt(openItemDiv);
+                this.own(this.lastItem.on(
+                    'change',lang.hitch(this,'_handleOpenItemChange')));
+            }
+        },
+        _setDisabledAttr: function() {
+            this.inherited(arguments);
+            this._handleOpenItemChange();
+        },
+        _setReadOnlyAttr: function() {
+            this.inherited(arguments);
+            this._handleOpenItemChange();
+        },
+        _handleOpenItemChange: function() {
+            if ( this.lastItem ) {
+                var value = this.allowMultiple ?
+                            this.lastItem.get('value') :
+                            this.lastItem.get('value')[0];
+                var enabled = !(this.readOnly || this.disabled) && value;
+                this.openItemTextBox.set('disabled',!enabled);
+                this.openItemTextBox.set('readOnly',!enabled);
+            }
         }
     });
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/NumberInputWidget.js	(revision 511)
@@ -1,11 +1,8 @@
 define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
+    "../../../widgets/_ComplexValueWidget",
     "dojo/_base/declare",
     "dojo/text!./templates/NumberInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+], function(_ComplexValueWidget, declare, template) {
+    return declare([_ComplexValueWidget],{
         templateString: template,
         text: '',
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/ScaleInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/ScaleInputWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/ScaleInputWidget.js	(revision 511)
@@ -1,7 +1,5 @@
 define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
+    "../../../widgets/_ComplexValueWidget",
+    "dijit/form/CheckBox",
     "dijit/form/RadioButton",
     "dojo/_base/array",
@@ -11,6 +9,6 @@
     "dojo/dom-construct",
     "dojo/text!./templates/ScaleInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, RadioButton, array, declare, lang, domAttr, domConstruct, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+], function(_ComplexValueWidget, CheckBox, RadioButton, array, declare, lang, domAttr, domConstruct, template) {
+    return declare([_ComplexValueWidget],{
         templateString: template,
         baseClass: "qedScaleWidget",
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/SingleChoiceInputConfigWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/SingleChoiceInputConfigWidget.js	(revision 510)
+++ 	(revision )
@@ -1,58 +1,0 @@
-define([
-    "../../../widgets/ListWidget",
-    "../../../widgets/_ComplexValueWidget",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
-    "dojo/_base/declare",
-    "dojo/_base/event",
-    "dojo/_base/lang",
-    "dojo/dom-construct",
-    "dojo/text!./templates/SingleChoiceInputConfigRowWidget.html",
-    "dojo/text!./templates/SingleChoiceInputConfigWidget.html"
-], function(ListWidget, _ComplexValueWidget, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, event, lang, domConstruct, rowTemplate, template) {
-
-    var Row = declare([_ComplexValueWidget],{
-        templateString: rowTemplate,
-        onDestroy: function(evt) {}
-    });
-    
-    return declare([_ComplexValueWidget],{
-        baseClass: 'qedMultipleChoiceWidget',
-        templateString: template,
-        buildRendering: function() {
-            this.inherited(arguments);
-            this.itemsWidget = new ListWidget({
-                name: "items",
-                type: "SingleChoiceItem",
-                skipForm: true,
-                delay: 5,
-                createListElement: lang.hitch(this, "_createRow"),
-                createAvatar: lang.hitch(this, "_createAvatar")
-            }, this.itemsNode);
-        },
-        _createRow: function(id, item) {
-            var widget = new Row({
-                id: id,
-                value: item,
-                onDestroy: lang.hitch(this,function(evt){
-                    this.itemsWidget.removeItem(id,true);
-                    if ( evt ) { event.stop(evt); }
-                    return false;
-                })
-            });
-            widget.startup();
-            return widget;
-        },
-        _createAvatar: function(id, item) {
-            return domConstruct.create("div", {
-                innerHTML: item.text || "(empty)"
-            });
-        },
-        onAddItem: function(evt) {
-            this.itemsWidget.appendItem({},true);
-            if ( evt ) { event.stop(evt); }
-            return false;
-        }
-    });
-});
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/SingleChoiceInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/SingleChoiceInputWidget.js	(revision 510)
+++ 	(revision )
@@ -1,33 +1,0 @@
-define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
-    "dijit/form/RadioButton",
-    "dojo/_base/array",
-    "dojo/_base/declare",
-    "dojo/dom-construct",
-    "dojo/text!./templates/SingleChoiceInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, RadioButton, array, declare, domConstruct, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
-        templateString: template,
-        startup: function() {
-            if ( this._started ) { return; }
-            this.inherited(arguments);
-
-            domConstruct.empty(this.domNode);
-            array.forEach(this.items, function(item){
-                var div = domConstruct.create("div", {
-                }, this.domNode, "last");
-                var input = new RadioButton({
-                    name: this.code + this.subcode,
-                    value: item.value
-                }).placeAt(div);
-                var label = domConstruct.create("label",{
-                    'for': input.id,
-                    innerHTML: item.text
-                }, div);
-            }, this);
-        }
-    });
-});
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/StringInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/StringInputWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/StringInputWidget.js	(revision 511)
@@ -1,11 +1,8 @@
 define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
+    "../../../widgets/_ComplexValueWidget",
     "dojo/_base/declare",
     "dojo/text!./templates/StringInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+], function(_ComplexValueWidget, declare, template) {
+    return declare([_ComplexValueWidget],{
         templateString: template,
         text: '',
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/TextInputWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/TextInputWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/TextInputWidget.js	(revision 511)
@@ -1,11 +1,8 @@
 define([
-    "dijit/_Container",
-    "dijit/_TemplatedMixin",
-    "dijit/_WidgetBase",
-    "dijit/_WidgetsInTemplateMixin",
+    "../../../widgets/_ComplexValueWidget",
     "dojo/_base/declare",
     "dojo/text!./templates/TextInputWidget.html"
-], function(_Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, declare, template) {
-    return declare([_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
+], function(_ComplexValueWidget, declare, template) {
+    return declare([_ComplexValueWidget],{
         templateString: template,
         text: '',
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigRowWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigRowWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigRowWidget.html	(revision 511)
@@ -1,9 +1,7 @@
 <form>
-  <div data-dojo-type="dijit/form/CheckBox"
-       data-dojo-props="disabled: true, readOnly: true"></div>
   <div data-dojo-type="dijit/form/ValidationTextBox"
-       data-dojo-props="required: true, placeholder: 'Subcode'"
+       data-dojo-props="required: true, placeholder: '${_valueOrSubcodeName}'"
        class="subcode"
-       name="subcode"></div>
+       name="${_valueOrSubcode}"></div>
   <div data-dojo-type="dijit/form/ValidationTextBox"
        data-dojo-props="required: true, placeholder: 'Item text'"
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputConfigWidget.html	(revision 511)
@@ -1,6 +1,26 @@
 <form class="${baseClass}">
+  <div>
+    <label class="qedLabel" for="subcode">Subcode</label>
+    <input data-dojo-type="dijit/form/ValidationTextBox"
+           data-dojo-props="required:true,placeHolder:'Subcode'"
+           class="subcode"
+           name="subcode"/>
+  </div>
   <div data-dojo-attach-point="itemsNode">
   </div>
   <div data-dojo-type="dijit/form/Button"
        data-dojo-attach-event="onClick:onAddItem">Add item</div>
+  <div>
+    <label class="qedLabel" for="lastItemIsOpen">Last option is open</label>
+    <input data-dojo-type="dijit/form/CheckBox"
+           class="qedField"
+           name="lastItemIsOpen"
+           data-dojo-attach-point="openItemCheckBox"
+           data-dojo-attach-event="onChange:_handleOpenItemChange"/>
+    <input data-dojo-type="dijit/form/ValidationTextBox"
+           data-dojo-props="required:true,disabled:true,placeHolder:'Subcode'"
+           data-dojo-attach-point="openItemSubcodeTextBox"
+           class="subcode"
+           name="openItemSubcode"/>
+  </div>
 </form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/MultipleChoiceInputWidget.html	(revision 511)
@@ -1,2 +1,2 @@
-<div>
-</div>
+<form class="${baseClass}">
+</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/NumberInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/NumberInputWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/NumberInputWidget.html	(revision 511)
@@ -1,3 +1,3 @@
-<div>
+<form>
   <p>${text}</p>
   <div class="qedField"
@@ -5,3 +5,3 @@
        data-dojo-type="dijit/form/NumberTextBox"
        name="${code}${subcode}"></div>
-</div>
+</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/ScaleInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/ScaleInputWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/ScaleInputWidget.html	(revision 511)
@@ -1,3 +1,3 @@
-<div class="${baseClass}">
+<form class="${baseClass}">
   <table>
     <thead>
@@ -12,3 +12,3 @@
     </tbody>
   </table>
-</div>
+</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputConfigRowWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputConfigRowWidget.html	(revision 510)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<form>
-  <div data-dojo-type="dijit/form/RadioButton"
-       data-dojo-props="disabled: true, readOnly: true"></div>
-  <div data-dojo-type="dijit/form/ValidationTextBox"
-       data-dojo-props="required: true, placeholder: 'Value'"
-       class="subcode"
-       name="value"></div>
-  <div data-dojo-type="dijit/form/ValidationTextBox"
-       data-dojo-props="required: true, placeholder: 'Item text'"
-       name="text"></div>
-  <div data-dojo-type="dijit/form/Button"
-       data-dojo-attach-event="onClick:onDestroy">X</div>
-</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputConfigWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputConfigWidget.html	(revision 510)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<form class="${baseClass}">
-  <div>
-    <label for="subcode">Subcode</label>
-    <div class="subcode"
-         data-dojo-type="dijit/form/ValidationTextBox"
-         data-dojo-props="required: true, placeholder: 'Subcode'"
-         name="subcode"></div>
-  </div>
-  <div data-dojo-attach-point="itemsNode">
-  </div>
-  <div data-dojo-type="dijit/form/Button"
-       data-dojo-attach-event="onClick:onAddItem">Add item</div>
-</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/SingleChoiceInputWidget.html	(revision 510)
+++ 	(revision )
@@ -1,2 +1,0 @@
-<div>
-</div>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/StringInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/StringInputWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/StringInputWidget.html	(revision 511)
@@ -1,5 +1,5 @@
-<div>
+<form>
   <p>${text}</p>
   <div data-dojo-type="dijit/form/TextBox"
        name="${code}${subcode}"></div>
-</div>
+</form>
Index: Dev/trunk/src/client/qed-client/model/widgets/questions/templates/TextInputWidget.html
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/questions/templates/TextInputWidget.html	(revision 510)
+++ Dev/trunk/src/client/qed-client/model/widgets/questions/templates/TextInputWidget.html	(revision 511)
@@ -1,3 +1,3 @@
-<div>
+<form>
   <p>${text}</p>
   <textarea class="qedField"
@@ -5,3 +5,3 @@
             data-dojo-type="dijit/form/Textarea"
             name="${code}${subcode}"></textarea>
-</div>
+</form>
Index: Dev/trunk/src/client/qed-client/widgets/ListWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/widgets/ListWidget.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/widgets/ListWidget.js	(revision 511)
@@ -26,4 +26,5 @@
         _onChangeActive: false,
         _onChangeHandle: null,
+        _fromDrop: true,
         buildRendering: function() {
             this.inherited(arguments);
@@ -52,5 +53,5 @@
             lang.mixin(sourceParams, {
                 accept: [this.type],
-                creator: lang.hitch(this, "creator"),
+                creator: lang.hitch(this,"creator"),
                 dropParent: this.containerNode
             });
@@ -82,5 +83,5 @@
             } else {
                 if ( this.createListElement ) {
-                    nodeOrWidget = this.createListElement(id,item);
+                    nodeOrWidget = this.createListElement(id,item,this._fromDrop);
                 } else {
                     return this.source.defaultCreator(item, hint);
@@ -98,5 +99,5 @@
         },
         createAvatar: null, /*function(id,item){},*/
-        createListElement: null, /* function(id,item){},*/
+        createListElement: null, /* function(id,item,fromDrop){},*/
         _getValueAttr: function() {
             this.value = array.map(this.source.getAllNodes(),function(node){
@@ -145,10 +146,14 @@
         },
         appendItems: function(items,forceEvent) {
+            this._fromDrop = false;
             this.source.insertNodes(false,items);
             if ( forceEvent ) { this._handleDrop(); }
+            this._fromDrop = true;
         },
         appendItem: function(item,forceEvent) {
+            this._fromDrop = false;
             this.source.insertNodes(false,[item]);
             if ( forceEvent ) { this._handleDrop(); }
+            this._fromDrop = true;
         },
         removeItem: function(key,forceEvent) {
@@ -200,5 +205,5 @@
             this._onChange();
         },
-        _onChange: function(){
+        _onChange: function() {
             if ( this._onChangeActive &&
                  !(this.readOnly || this.disabled) ) {
Index: Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js
===================================================================
--- Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js	(revision 510)
+++ Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js	(revision 511)
@@ -92,26 +92,12 @@
         },
         focus: function() {
-            var children = this._getDescendantFormWidgets();
+            /*var children = this._getDescendantFormWidgets();
             if ( children.length > 0 ) {
                 children[0].focus();
-            }
+            }*/
         },
         _handleChange: function(evt) {
             if ( evt.target !== this.domNode ) {
-                if ( this._onChangeActive &&
-                     !(this.readOnly || this.disabled) ) {
-                    if ( this._onChangeHandle ) {
-                        this._onChangeHandle.cancel();
-                    }
-                    this._onChangeHandle = this.defer(function(){
-                        this._onChangeHandle = null;
-                        on.emit(this.domNode,'change',{
-                            target: this.domNode,
-                            value: this.get('value'),
-                            bubbles: true,
-                            cancellable: true
-                        });
-                    });
-                }
+                this._onChange();
                 if ( evt ) { event.stop(evt); }
                 return false;
@@ -133,4 +119,21 @@
             if (evt) { event.stop(evt); }
             return false;
+        },
+        _onChange: function() {
+            if ( this._onChangeActive &&
+                 !(this.readOnly || this.disabled) ) {
+                if ( this._onChangeHandle ) {
+                    this._onChangeHandle.cancel();
+                }
+                this._onChangeHandle = this.defer(function(){
+                    this._onChangeHandle = null;
+                    on.emit(this.domNode,'change',{
+                        target: this.domNode,
+                        value: this.get('value'),
+                        bubbles: true,
+                        cancellable: true
+                    });
+                });
+            }
         }
     });
Index: Dev/trunk/src/server/config/couchdb-schema.json
===================================================================
--- Dev/trunk/src/server/config/couchdb-schema.json	(revision 510)
+++ Dev/trunk/src/server/config/couchdb-schema.json	(revision 511)
@@ -214,11 +214,10 @@
               "additionalProperties": false
           } },
-          "otherItem": {
-              "type": "object",
-              "properties": {
-                  "text": { "$ref": "#/definitions/nonEmptyString" },
-                  "value": { "$ref": "#/definitions/nonEmptyString" }
-              },
-              "required": ["subcode","value"],
+          "lastItemIsOpen": {
+              "type": "object",
+              "properties": {
+                  "subcode": { "$ref": "#/definitions/codeString" }
+              },
+              "required": ["subcode"],
               "additionalProperties": false
           },
@@ -235,17 +234,16 @@
               "type": "object",
               "properties": {
-                  "subcode": { "$ref": "#/definitions/codeString" },
-                  "text": { "$ref": "#/definitions/nonEmptyString" }
+                "subcode": { "$ref": "#/definitions/codeString" },
+                "text": { "$ref": "#/definitions/nonEmptyString" }
               },
               "required": ["subcode","text"],
               "additionalProperties": false
           } },
-          "otherItem": {
-              "type": "object",
-              "properties": {
-                  "subcode": { "$ref": "#/definitions/codeString" },
-                  "text": { "$ref": "#/definitions/nonEmptyString" }
-              },
-              "required": ["subcode","text"],
+          "lastItemIsOpen": {
+              "type": "object",
+              "properties": {
+                "subcode": { "$ref": "#/definitions/codeString" }
+              },
+              "required": ["subcode"],
               "additionalProperties": false
           }
