From: Matthew G. <mat...@gm...> - 2008-01-11 00:55:40
|
I like the idea of a hidden text field question type. Are you planning on making all respondent data available as in a $respondent['foo'] variable? Wonder if a "respondent data question type" with a drop down to select which bit of respondent data you want, would be better? Don't forget to switch from CVS HEAD to SVN trunk. I've committed favicon patch and hopefully the other changes you sent soon. On Thu, 2008-01-10 at 18:19 -0500, Bishop Bettini wrote: > All, > > Suppose you want to cross-tabulate respondent last name versus a > question on your survey, to answer say something like "How many > Smith's said their household income was too low?" > > Right now, you have to ask the user their last name, because the > cross-tabulation works against the survey data, not against the > respondent data. You've already got the user's information, so why > ask for it? > > Yes, this example is contrived. But, this scenario stems from a > particular need of mine, where I'm actually augmenting the respondent > data with age, gender, ethnicity, etc. and I want to be able to use > the built-in cross-tabulation functionality against those metrics: > "How many women answered yes to question 1?" > > The idea I've come up with is to have "hidden" survey fields, similar > to hidden input elements in HTML. The survey would have place holders > for the value, but when the respondent logs in, those input elements > aren't seen but are populated from a data source. > > To implement this, I would add a new type to the question type > drop-down called "hidden". The name would be required, as usual. The > text would either static text or a template variable. > > so, you might have this: > > Name = Q1 > Type = Hidden > Text = foo > > Which would render as > <input type="hidden" name="Q1" value="foo" /> > > For my particular need, I'd put in template variable aliases (a la > Smarty) for respondent, etc. so that data could be accessed: > > Name = Q1 > Type = Hidden > Text = $respondent.gender > > Like executing this: > <input type="hidden" name="Q1" value="<?= $respondent['gender'] ?>" /> > > Yielding after rendering, e.g: > <input type="hidden" name="Q1" value="M" /> > > > Thoughts? > > bishop > |