Country, State and Page break questions in eZ Survey
By: Xavier Cousin | April 4, 2011 | eZ Publish add-ons
In addition to the Matrix question type, we have added these question types: Country (dropdown list of countries), State (similar to country but with USA states and Canadian provinces) and Page break (enabling paginated surveys) to the eZ Survey extension.
The Country question type is a dropdown list of countries populated by the default eZ Publish country.ini. The format used to store the country selections can be modified in extension/mugosurvey_addons/settings/mugosurvey.ini.append.php. (The default format is Alpha2.)
The State question type is a dropdown list of USA states and Canadian provinces populated by extension/mugosurvey_addons/settings/mugosurvey.ini.append.php. There is also an extra option "Other State" that enable users to type in a state that is not in the list. At the moment, this question type is not tied to the Country selection.
- In order to support page break functionality, we had to override the ezsurvey datatype template (extension/mugosurvey_addons/design/standard/templates/content/datatype/view/ezsurvey.tpl). This means that if you have already overridden this template, you will have to manually merge your changes with this extension's changes.
- Changing the storage format of the Country question type will make all previous answered surveys unreadable for those questions, so choose a format first and stick to it!
- States and countries are not tied together (and this extension currently only lists USA states and Canadian provinces). This is a feature consideration for a future version.