Checkbox Forums

Help
+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14
  1. #11
    cregan is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default

    Works great. Thanks.

  2. #12
    chamindasomathilaka is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default

    Can anybody post a code that can be use to programaticaly respond to a survey?

    I was able to initiate the response template and by that getting the response object. But I was unable to find a method to respond to each of the items on the response items collection.

  3. #13
    ncushing is offline Administrator
    Join Date
    Mar 2007
    Location
    Prezza Technologies
    Posts
    227

    Default

    To respond to the individual items in the Response, you'll need to know something about the items. All items that have answers implement the Checkbox.Forms.Items.IAnwerable interface.

    Three types of items implement this interface in Checkbox.
    1) Select Items
    2) Text Items
    3) Matrix Items

    You can query an Item object's ItemTypeName property to see what type of item it is, or you can directly check the type. Select items, such as checkboxes, radio buttons, and rating scales all extend the Checkbox.Forms.Items.SelectItem class. Single and multi-line text items extend the Checkbox.Forms.Items.TextItem class.

    To set answers for select items, call the Select(...) method, which accepts a list of selected option ids (which you can get from SelectItem.Options property) as well as any text entered in the "Other" text input.

    //Select multiple options for checkboxes
    ((SelectItem)item).Select(new[] {1002, 1004});

    //Select radio button option and other text
    ((SelectItem)item).Select("Other", new[] {1002, 1004});


    For text items, the answer can be set by calling the SetAnswer(...) method defined by the IAnswerable interface.
    ((TextItem)item).SetAnswer("This is the answer.");

    Matrix questions are only slightly more difficult. A Matrix question is actually a composite item comprised of child Message, Text, and Select items. To provider answers to items within the matrix, you can get the child item by its ID or iterate through the rows and columns to find child items. Once you have a reference to the child item, set its answer as illustrated above.

  4. #14
    chamindasomathilaka is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default

    Thanks for reply. I was able to get this work as you explained. But now I am facing a challenge to implement this functionality in my custom application as I use Microsoft Enterprise library and hence I can not have configuration entries on the web.config which needed by the Chceckbox API.
    Do you know any simple solution or any other methodology that I can use here?
    Thanks.
    Chaminda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.0