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
  #11 (permalink)  
Old 04-29-2008, 05:02 PM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

Quote:
Originally Posted by ncushing View Post
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.
I have been using the sample website, but have noticed that the save feature isn't working quite right. When I click the save button, the page says that answers have been successfully updated, but when I leave and then come back to the survey, or view the results in the checkbox app, the answers have not been changed.

Any idea what I need to update/change in the same app to get that to update correctly?

Thanks
Reply With Quote
  #12 (permalink)  
Old 05-02-2008, 11:04 AM
toolbox toolbox is offline
Junior Member
 
Join Date: Mar 2008
Posts: 12
Default

Here is the code in the app for saving the new results:

//Reload the current response, which is necessary because the response object does not have a lifecycle
// beyond the a single postback in the application. This will eventually change, but for now the
// response must be reloaded to prevent item IsValid states from getting confused.
LoadCurrentResponse();

bool valid = true;

if (_itemRenderers != null)
{
foreach (ItemRenderer renderer in _itemRenderers)
{
//Update the model
renderer.UpdateModel();

if (renderer.Model is ResponseItem)
{
valid = valid & ((ResponseItem)renderer.Model).Valid;
}

//Rebind the renderer to the model to cause the validation errors to show
// current state of the Model.
renderer.BindModel();
}

_answersUpdatedLbl.Visible = valid;
_validationErrorLbl.Visible = !_answersUpdatedLbl.Visible;

//Save the response state
CurrentResponse.SaveCurrentState();
}

After trying several things, I found that if I commented out the LoadCurrentResponse(); the new answers were saved correctly, and everything else still appears to work.
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 09:45 PM.


Search Engine Friendly URLs by vBSEO 3.0.0 RC8