Survey Software by Prezza Technologies - survey software, web surveys, online surveys, online survey, customer feedback forms, survey hosting

Go Back   CHECKBOX® Online Community > Checkbox® > CHECKBOX® Developer Kit

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-19-2008, 05:54 PM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default Getting HTML for selected Questions

I am currently working a c#.net page where I can allow a user to review a survey outside of the checkbox web app. I need to do this because the this is a mult-page survey and I don't want to make the reviewer go through page by page. Here is what I need to do:

1. Get a list of all the users response answers
2. Loop through these response answers and using the API, get the HTML each question would render in the checkbox web app. or an instance of the control I can add to my page.
3. Then after review, I will need to be able to save any changes
Reply With Quote
  #2 (permalink)  
Old 03-20-2008, 11:27 AM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

Thank you for your inquiry. I know there are others looking for similar information, so I'll try to make this an in-depth post. I'll gather the information I need on my end and update this thread later today.
Reply With Quote
  #3 (permalink)  
Old 03-21-2008, 12:28 PM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

Quote:
Originally Posted by ncushing View Post
Thank you for your inquiry. I know there are others looking for similar information, so I'll try to make this an in-depth post. I'll gather the information I need on my end and update this thread later today.
Any progress on this? Thanks for the help in advance.
Reply With Quote
  #4 (permalink)  
Old 03-21-2008, 03:20 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

I'll have to do this in multiple parts, since I'll be building and testing things on my end to go with this. To get started, I assume that you will be hosting this logic in a web application other than the Checkbox web application. If so, the first step will be to add the following sections from the Checkbox web.config to the web.config for the application that will be hosting the custom code:

Code:
    <configSections>
        <section name="securityConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="cacheConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="loggingConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="exceptionHandlingConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="identityProviderConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="globalizationConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="databaseConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
        <section name="messagingConfiguration" type="Prezza.Framework.Configuration.ConfigurationSectionHandler,Prezza.Framework" />
    </configSections>
    <!-- Configuration File Locations and Loaders -->
    <securityConfiguration filePath="[YOUR_APP_PATH]\config\Security.xml" configDataType="Prezza.Framework.Security.Configuration.SecurityConfiguration,Prezza.Framework" />
    <cacheConfiguration filePath="[YOUR_APP_PATH]\config\Cache.xml" configDataType="Prezza.Framework.Caching.Configuration.CacheConfiguration,Prezza.Framework" />
    <loggingConfiguration filePath="[YOUR_APP_PATH]\config\Logging.xml" configDataType="Prezza.Framework.Logging.Configuration.LoggingConfiguration,Prezza.Framework" />
    <exceptionHandlingConfiguration filePath="[YOUR_APP_PATH]\config\ExceptionHandling.xml" configDataType="Prezza.Framework.ExceptionHandling.Configuration.ExceptionHandlingConfiguration,Prezza.Framework" />
    <identityProviderConfiguration filePath="[YOUR_APP_PATH]\config\CheckboxSecurity.xml" configDataType="Checkbox.Security.Configuration.SecurityConfiguration,Checkbox" />
    <globalizationConfiguration filePath="[YOUR_APP_PATH]\config\GlobalizationConfiguration.xml" configDataType="Checkbox.Globalization.Configuration.GlobalizationConfiguration,Checkbox" />
    <databaseConfiguration filePath="[YOUR_APP_PATH]\config\DatabaseConfiguration.xml" configDataType="Prezza.Framework.Data.DatabaseConfiguration,Prezza.Framework" />
    <messagingConfiguration filePath="[YOUR_APP_PATH]\config\Messaging.xml" configDataType="Checkbox.Messaging.Configuration.MessagingConfiguration,Checkbox" />

    <connectionStrings>
        <add name="DefaultConnectionString" connectionString="[YOUR_CONN_STRING]" />
    </connectionStrings>


You will need to replace [YOUR_APP_PATH] with the actual physical location of the web application (e.g. c:\inetpub\wwwroot\myapp) and will need to update the connection string to point to your Checkbox database.

Next, you'll need to copy all files from the Config folder of your Checkbox installation to your new application location, then modify any filePath attributes in the XML configuration files to point to your new application location. The following list shows the files that need to be updated.
  • BackingStore.xml (1 Change)
  • Cache.xml (10 Changes)
  • CheckboxSecurity.xml (1 Change)
  • ExceptionHandling.xml (5 Changes)
  • GlobalizationConfiguration.xml (1 Change)
  • Logging.xml (4 Changes)
  • Messaging.xml (1 Change)
  • Security.xml (10 Changes)

To be continued...
Reply With Quote
  #5 (permalink)  
Old 03-24-2008, 09:48 AM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

Thanks for the help so far, looking forward to the next step.
Reply With Quote
  #6 (permalink)  
Old 03-24-2008, 02:10 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

Toolbox,

Rather than paste bits of code into the message, I created a sample web application that shows a list of surveys and responses. Upon selection of a response, all answerable questions are displayed on a single page along with their current answers. The user can then change the answers and save those changes.

To run the application, extract the files to a folder, then create a virtual directory in IIS to point to the folder . Then you'll need to update the connection string in the web.config and will need to update the web.config and all config files to replace [APP_PATH] with the physical location of the folder containing the application (e.g. C:\WebRoot\OnePageSurvey\) so that the various configuration files are referenced by their full paths.

Hopefully this will be a good start for you to adapt to your needs. If you have any questions, please let me know.
Attached Files
File Type: zip OnePageSurvey.zip (904.6 KB, 4 views)
Reply With Quote
  #7 (permalink)  
Old 03-26-2008, 02:33 PM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

Thanks for the help on this. That application is great. I have just one question. How do I display some hidden items I have on that survey. They are returned in the surveypage.Items collection, but they appear to not have an item appearance when calling the AppearanceDataManager.GetAppearanceDataForItem()

Thanks for your help.
Reply With Quote
  #8 (permalink)  
Old 03-26-2008, 02:41 PM
pwiesner pwiesner is offline
Senior Member
 
Join Date: Mar 2007
Posts: 125
Default

It is not possible to display hidden items, it is for this reason that AppearanceDataManager.GetAppearanceDataForItem() returns no value for them.
Reply With Quote
  #9 (permalink)  
Old 03-26-2008, 03:43 PM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

I know that the system will hide them while someone is taken a survey, but when using the checkbox web application, and reviewing a survey, all the hidden values are displayed. If this functionality is not available in the API, I would agree that it isn't possible to display them. However, if the same functionality is available in the API as is used in the application, there must be a way to display them.
Reply With Quote
  #10 (permalink)  
Old 03-31-2008, 08:35 AM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 160
Default

Hidden items are essentially the same as open-ended questions, except that they read the values from query string, session, or cookie instead of a text input.

To display these items and allow a user to edit them, you would have to manually create a text box and populate it with the hidden item value. On postback, you would then update the hidden item (HiddenItem object) with the value of the textbox at the same times you call UpdateModel(...).
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:53 PM.


Search Engine Friendly URLs by vBSEO 3.0.0 RC8