Open GoogleCodeExporter opened 8 years ago
Original comment by yann.ma...@gmail.com
on 12 Mar 2009 at 2:50
The attached patch creates a new question type: UserPicklist. It's useful when
teachers need to evaluate students, or for employers to evaluate employees, etc.
Entries in the list are displayed as Lastname, Firstname.
By default this question type will create a select box showing all registered
users
in the system. However, that's not always appropriate - you may have 5,000
registered
users but only want to show users who match some criteria (like students from a
particular school year or employees who have completed a workshop). So this
question
type adds a new Custom Query field in the add/edit question view. Enter a
dictionary
of the picklist criteria, e.g.:
{'is_staff':True,'last_name__startswith':'A',}
The dictionary will be stored in the db, then applied to the picklist when it's
rendered.
If you apply this to an existing system you'll need a new field on the question
table:
ALTER TABLE `survey_question` ADD COLUMN `custom_query` VARCHAR(255) CHARACTER
SET
latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `choice_num_min`;
Original comment by scotfhac...@gmail.com
on 19 Mar 2009 at 12:28
Attachments:
Original issue reported on code.google.com by
scotfhac...@gmail.com
on 12 Mar 2009 at 12:42