PartecsPoll
The poll object plays an important role in Decision Items: it provides all the structured feedback mechanisms. The poll object goes through several states in its lifetime. The poll may be one of three kinds:
- Open Poll -- Poll may be answered and results are immediately displayed (common use case). Users may answer poll again, thus modifying their original responses.
- Private Poll -- Poll may be answered but results are visible to owner and moderators only (poll must be put into Closed state for results to be visible to others). Users may answer poll again.
- Secret Poll -- Similar to Private Poll, but the object does not record per-user responses, merely whether the user answered or not. Users may not answer poll again.
The kind may not be changed once the poll is out of the Draft state. Note that polls are stored directly under Decision Items, not under Drafts. This is because the same poll may be used in different drafts, for example first in Published state, next in Voting state, finally in Closed state.
Poll States
Poll states are managed via portal_workflow(PartecsPollWorkflow):
- Draft -- Initial state, for configuring poll questions. Poll may not be answered in this state.
- Published -- Poll can now be answered, but questions may not be modified.
- Private -- Poll may not be answered anymore. Results are visible only to owner.
- Voting -- Poll may not be answered anymore. Certain poll questions are now open for voting on the collected responses.
- Closed -- Poll may not be answered anymore. Results are visible to all.
States are linked to phases. Changing the phase on the parent object will update all contained objects to a corresponding state. The state-phase relationship is defined in PhasesAndWorkflow.
Object Organisation
The poll object consists of three main types of contents:
- Poll Questions.
- Responses to poll questions, stored as aggregates along with each question.
- Responses to poll questions, stored on a per-user basis. Not stored in the case of the Secret Poll.
Poll Questions
The following types of questions are available:
Single Choice Question
The question comes with several pre-defined answers, and the user is allowed to select only one of them. The HTML interface uses radio buttons, or a single select widget beyond a certain count.
Configuration options: list of choices.
Multiple Choice Question
The question comes with several pre-defined answers, and the user is allowed to select any number of them. The HTML interface uses check boxes, or a multiple select widget beyond a certain count.
The multiple choice question can also optionally allow the user to order their selected items by priority. This is different from voting because voting is on responses, during the special Voting state, while this is during the Published state itself.
Configuration options: list of choices; allow user to order choices by priority.
Scale Question
This is similar to the single choice question, except instead of a list of choices, the owner defines a numeric range. This is commonly used for things like ratings (but this is different from rating as implemented in ContentFlagging? because here there is no object being rated).
Configuration options: minimum number; maximum number; step count.
Single Text Response Question
The question comes with a single or multiline text field (configurable), implemented in HTML with the input text or textarea widgets. The entire textarea is considered as a single item.
Configuration options: voting allowed; single or multiline response.
Multiple Text Response Question
The question comes with a large text area. Responses may be multiple, of type single line or multiline. Single line responses should be written one per line in the textarea, while multiline responses should be separated by a blank line. The user should be clearly instructed on how to write responses.
Alternatively, the interface can use AJAX to add blank fields as they get filled up. This is however not cut-and-paste friendly.
Configuration options: voting allowed; number of responses allowed (default unlimited); single or multiline responses; multiline (textarea) widget with multiline responses separated by blank lines, or AJAX auto-adding widgets.
Table Response Question
This question comes with the option of responding with a table. The owner defines the table fields along with type: single (input text) or multiline (textarea) text, date field (plone widget), number field (input text), currency field (input text; number and currency code).
The user has the option of using multiple fields, with new ones added via AJAX (in case of unlimited responses allowed), or using a single large textarea field where they can paste CSV. With AJAX, there is also the option of dynamically uploading a CSV file into the textarea field.
Configuration options: voting allowed; table fields and types; number of responses allowed (default unlimited); responses via multiple fields or large textarea.
Voting
In the case of Single Text, Multiple Text and Table Response Questions, voting may be optionally turned on. When the poll enters the Voting state, the collected responses to these questions are available for users to vote on. Votes may be cast in various methods. See VotingModule? for details.
Display of Results
(Todo)
(For user entered response types, show usernames along with responses? Not possible with Secret Poll.)
Rating on user responses
Rating on user responses done on Single Text response questions and Multiple Text response questions. There should be configuration setting where the owner of the poll will have an option to set whether the rating on the user responses are allowed or not.
- Implementation procedure : Make the Single Text response question and multiple text response question as a folderish objects. Create an custom content object(rating) to store the user responses and his rating on the question in to this object. Create an PersistentMaping? attribute on responses object that stores the rating on user comments depending on the configurations. Following diagram explains this.
Other Notes
- When a poll question is modified, it discards all the collected answers. This is necessary in case the owner changes state from public, private or closed to draft (though that is technically disallowed) and modifies questions, thereby affecting results. However, in the interest of owners attempting to correct errors in questions, results should be discarded only for modified questions, not the entire poll (except Secret Poll, where questions cannot be modified regardless of state, if any question has had a response).
- In the interest of maintaining a "paper trail", poll objects call a customisable hook function that can maintain a remote log. The poll object internally also records user answers in the exact form the user submitted them, except in the case of the Secret Poll, where per-user records are not maintained and the customisable hook is called but not passed any user identification.
Attachments
- poll-rating-user-reponses.png (15.3 kB) -
rating on user responses.
, added by krishna on 11/28/05 11:02:44.
