[ic] How To Set Up a Rating Style Survey Widget?

Rick Bragg lists at gmnet.net
Sun Jun 19 06:04:02 UTC 2011


On Mon, 2011-05-30 at 11:27 -0700, Thomas J.M. Burton wrote:
> On 5/25/2011 2:03 PM, Thomas J.M. Burton wrote:
> > I'm working on setting up a survey in one of the Interchange sites we 
> > run. What I'd like to be able to have are questions with a 
> > rating-style input, by which I mean having a list of several 
> > questions, words, etc. on separate lines with a few radio button 
> > options to the right. For example:
> >
> > How do you feel about the following things?
> >         Bad    Good    Neutral
> > foo    ( )    ( )    ( )
> > bar    ( )    ( )    ( )
> > etc    ( )    ( )    ( )
> >
> > Where the ( ) represent a radio button. (I hope this translates well 
> > when posted to the list).
> >
> > I've been grepping IC source code and searching the users maillist and 
> > have not yet found reference to something like this existing. If I 
> > want to set up something like this, will I need to write a custom 
> > widget, or is there some other way in the existing IC survey system to 
> > customize things that might give me an output similar to what I'm 
> > looking for?
> 
> Hi again,
> 
> I ended up writing a custom widget and have the front end of this 
> together, though I now need to work out how to get the results into the 
> existing survey system. Here's how I've set up the widget to work:
> 
> Choices/Options settings (stored in the survey::options field) are set 
> by specifying the radio button options first with the value=label 
> format. Following those, lines without an equals sign are recognized as 
> the line-items that are to be rated. For example, input might be 
> something like:
> 
> 1=Not Satisfied
> 2=Slightly Satisfied
> 3=Satisfied
> 4=Highly Satisfied
> Overall Purchase Experience
> Clarity of Product Information
> Product Pricing
> Order Delivery Time
> 
> Which would then build html that looks like this:
> 
> <table cellspacing="0" cellpadding="5" border="0" class="input-rating-grid">
> <tr>
> <th></th>
> <th>Not Satisfied</th>
> <th>Slightly Satisfied</th>
> <th>Satisfied</th>
> <th>Highly Satisfied</th>
> </tr>
> <tr class="input-rating-row">
> <td align="right">Overall Purchase Experience</td>
> <td align="center"><input type="radio" value="1" name="experience-0"></td>
> <td align="center"><input type="radio" value="2" name="experience-0"></td>
> <td align="center"><input type="radio" value="3" name="experience-0"></td>
> <td align="center"><input type="radio" value="4" name="experience-0"></td>
> </tr>
> <tr class="input-rating-row">
> <td align="right">Clarity of Product Information</td>
> <td align="center"><input type="radio" value="1" name="experience-1"></td>
> <td align="center"><input type="radio" value="2" name="experience-1"></td>
> <td align="center"><input type="radio" value="3" name="experience-1"></td>
> <td align="center"><input type="radio" value="4" name="experience-1"></td>
> </tr>
> <tr class="input-rating-row">
> <td align="right">Product Pricing</td>
> <td align="center"><input type="radio" value="1" name="experience-2"></td>
> <td align="center"><input type="radio" value="2" name="experience-2"></td>
> <td align="center"><input type="radio" value="3" name="experience-2"></td>
> <td align="center"><input type="radio" value="4" name="experience-2"></td>
> </tr>
> <tr class="input-rating-row">
> <td align="right">Order Delivery Time</td>
> <td align="center"><input type="radio" value="1" name="experience-3"></td>
> <td align="center"><input type="radio" value="2" name="experience-3"></td>
> <td align="center"><input type="radio" value="3" name="experience-3"></td>
> <td align="center"><input type="radio" value="4" name="experience-3"></td>
> </tr>
> </table>
> 
> 
> As you can see, each line-item's radio buttons have a name with an 
> increment number appended to it.
> 
> Working within the existing IC survey system, what would be the best way 
> for me to have all increments of the survey item's inputs passed into 
> the survey results?
> 
> Hopefully someone can help me with this question. If you need more 
> information than what I've provided, please let me know.
> 
> Thanks,
> Tom
> 
> 
> -- 
> _______________________________
> Global Focus Digital Media, LLC
> www.globalfocusdm.com
> 


I don't know if this addresses the question, but I personally don't use
much from the existing IC "catalog" code like the suvey etc.  I think it
is best to mostly use only the core "Interchage" code and I create
everything I need like surveys etc new.  Anyway, I usually do this kind
of thing with scratch vars like so:

set variable:
[seti this-answer][calc]$Scratch->{experience_[scratch experience_id]} =
1; return; [/calc][/seti]

read variable:
[calc]$Tag->scratch({ name => experience_[scratch experience_id], });
[/calc]

This way you can have a database of N experiences, and set or get them
at will.

Like I said, I don't know if this addresses your question, but it is
really late for me (2AM)
HTH
Rick









More information about the interchange-users mailing list