Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a question by a description #261

Open
wasade opened this issue Oct 6, 2014 · 0 comments
Open

Add a question by a description #261

wasade opened this issue Oct 6, 2014 · 0 comments

Comments

@wasade
Copy link
Member

wasade commented Oct 6, 2014

This will be very useful for adding surveys, notably the animal survey. The proposed description of a question is:

# json
{"survey": int,  # required, which survey, currently no "english" description. Human is 1.
 "group": str,  # required, the corresponding question group the question is associated wtih
 "order": int,  # optional, the display index of the question
 "question_type": str,  # required, one of ['SINGLE', 'MULTIPLE', 'TEXT', 'STRING']
 "question": {  
    "american": str,  # required, can be anything. All questions are relative the american version of a question
    ...},
 "responses": {  # required, all keys must exist in "question" and vice versa
    "american": [str],  # required, can be anything
    ...},
 "triggers": [{  # optional, any questions that are triggered if any of a set of responses are selected
    "triggered_question": str,  # the american version of the question to be triggered
    "triggering_responses": [str]  # the responses of self that can trigger "triggered_question"
    ]}
}

This structure allows for validation against the database. Triggered questions need to be added prior. This format allows for existing questions to be serialized if needed as well.

@wasade wasade added this to the Priority items milestone Oct 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant