mwasiluk / angular-surveys

Angular survey / form builder inspired by Google Forms
http://mwasiluk.github.io/angular-surveys
Apache License 2.0
241 stars 135 forks source link

Provide optional question code #17

Open vheinitz opened 8 years ago

vheinitz commented 8 years ago

For automatic answer-processing it is useful to have a question code determined by user.

mwasiluk commented 8 years ago

Do you mean an additional optional text field in the question builder? Instead, maybe there should be a new option in the mwFormBuilder directive (like customQuestionSelects option) , eg:

options = {customQuestionFields:  [
   {
       type: 'text', // input type
       key: "code", // question object property name to set
       label: 'Code', 
    }
]}

This way it could be possible to add any custom input field to the question builder.

vheinitz commented 8 years ago

That would be even better! Would it be possible to add many custom fields? Than it would solve my second issue. I consider to make a questionnaire for a doctor. Where possible, the user should click and select. However, if for example one option is missing, or the categorical answer doesn't fit, or needs a comment, I would let the user(patient) write some explanatory text.

mwasiluk commented 8 years ago

Yes, it would support defining list of custom fields available in question builder (Available for the survey creator, not respondent). But, if I understand your second issue correctly, you also want possibility to define (by user - survey creator) additional explanatory field, which would be then available to fill by a survey respondent in the question viewer?

vheinitz commented 8 years ago

Now I realise, the custom fields are "read-only" - ony for displaying/passing additional information, not for filling by survey respondent :-(

Yes. I thought of a long-text field available for all questions, an a check-box for the survey-creator for displaying or hiding this text-input box where sensable while answering the questions. Some answers like age, name, gender, etc don't need much explanation. So the explanation text-area should be hidden. Actually, this could be accomplished by splitting a question into 2 question: 1)"Select from list (will get the chance to add more information)" 2)"Add more information, if available". So it is "nice-to-have"