From: Bishop B. <ph...@id...> - 2008-01-10 23:19:49
|
All, Suppose you want to cross-tabulate respondent last name versus a =20 question on your survey, to answer say something like "How many =20 Smith's said their household income was too low?" Right now, you have to ask the user their last name, because the =20 cross-tabulation works against the survey data, not against the =20 respondent data. You've already got the user's information, so why =20 ask for it? Yes, this example is contrived. But, this scenario stems from a =20 particular need of mine, where I'm actually augmenting the respondent =20 data with age, gender, ethnicity, etc. and I want to be able to use =20 the built-in cross-tabulation functionality against those metrics: =20 "How many women answered yes to question 1?" The idea I've come up with is to have "hidden" survey fields, similar =20 to hidden input elements in HTML. The survey would have place holders =20 for the value, but when the respondent logs in, those input elements =20 aren't seen but are populated from a data source. To implement this, I would add a new type to the question type =20 drop-down called "hidden". The name would be required, as usual. The =20 text would either static text or a template variable. so, you might have this: Name =3D Q1 Type =3D Hidden Text =3D foo Which would render as <input type=3D"hidden" name=3D"Q1" value=3D"foo" /> For my particular need, I'd put in template variable aliases (a la =20 Smarty) for respondent, etc. so that data could be accessed: Name =3D Q1 Type =3D Hidden Text =3D $respondent.gender Like executing this: <input type=3D"hidden" name=3D"Q1" value=3D"<?=3D $respondent['gender'] ?>" = /> Yielding after rendering, e.g: <input type=3D"hidden" name=3D"Q1" value=3D"M" /> Thoughts? bishop --=20 Bishop Bettini ideacode, Inc. (main) +1 919 341 5170 / (fax) +1 919 521 4100 Visit us on the web at: ideacode.com Professional software research and development reviewmysoftware.com Improve sales! Review your software before you release bytejar.com Solutions to those annoying development problems |