Project: survey
Task (moderate): Class SingleSelectionQuestion (file 'common/SingleSelectionQuestion.js') inherits from Question. Its constructor params are: title (string), name (string), preview (boolean), options (string array). Use radio as selection control whose value is the options index. Options are rendered in '.q-body'. Add a button (class 'add-single') in 'common/SurveyDesign.js', and click it to create a SingleSelectionQuestion (random title, unique name, 3 random options) whose root is prepended to the form. Click config panel button (class 'add-option') to add an option. In design page each option row (class 'option') in '.q-body', user can click button (class 'remove-option') to remove an option, click option text (class 'option-text') to edit it (contenteditable=true) in place.