+ Reply to Thread
Results 1 to 10 of 10
Thread: Response Extraction
-
08-08-2007 02:58 AM #1alanjc45 Guest
Response Extraction
I'm looking for possible solutions to extract the responses.
1. Use Developer API - I don't see enough documentation to use the IAnswerData interface yet. Are there other API options I should look at?
2. Extract XML in an automated way and feed it to the alternate repository. Is there an automated way provided by Checkbox (a hook?)
3. Put an after trigger on the ckbx_Response table that selects the ckbx_ResponseAnswers into the alternate repository when the ckbx_Response.IsComplete becomes true.
4. Live with the split data store and make calls directly against the Checkbox database ckbx_Response & ckbx_ResponseAnswer tables.
Can anyone help flush out the viability of these options or offer their idea?
Thanks.
-
08-10-2007 10:15 AM #2
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
What data are you trying to extract? Is it all of the answers for a given response, or answers to a specific question?
To load a specific response, you can follow the following steps, though you'll need to know the response guid.
*Caveat: I haven't built and tested this code...
Code://Get a response template ResponseTemplate rt = ResponseTemplateManager.GetResponseTemplateFromResponseGUID(responseGuid); //Create a response Response r = rt.CreateResponse(languageCode); //Language code most likely = en-US //Load the response r.Restore(responseGuid); //Loop and get answers ReadOnlyCollection
responsePages = r.RespronsePages foreach(ResponsePage page in responsePages) { List - items = page.Items foreach(Item item in items) { if(item is IAnswerable) { //Get answer text string answer = ((IAnswerable)item).GetAnswer(); //Get item and answer in XML format string itemXml = item.ToString("xml"); } } }
-
08-13-2007 05:32 PM #3alanjc45 Guest
All Responses for a ResponseTemplate
Thanks. The code snipet was helpful, but I would like all responses.
I see that the Response table has all the respond Guids, but I don't see
a method exposed in ResponseTemplateManager to fish them out. I don't
see a sproc to do this either.
I just need a Guid[] and I can go from there.
I'll post working code once this problem is solved. Thanks.
-
08-13-2007 07:09 PM #4alanjc45 Guest
Stored Procedure
Actually, I do see a stored procedure, ckbx_Response_GetForRT, but it is out of sync with the ckbx_Response table. In particular, it selects a UserID in the sproc when that field is not in the table.
FYI, I'm dealing with version 4.2.0 according to ckbx_ProductInfo
-
08-13-2007 07:16 PM #5
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
To list responses for a given survey, you can call the static ResponseManager.GetResponseList(...) method. Visual Studio is updating itself, so I don't have access to the code just yet, but intellisense should give you the method signature.
The method takes quite a few arguments including the database ID of the survey to list responses for. To list all responses, pass negative numbers for the results per page and page number parameters, and null or empty strings for the searching and sorting parameters.
-
02-05-2008 06:46 PM #6
Junior Member
- Join Date
- Feb 2008
- Posts
- 5
Assemblies
What assembly needs to bew referenced to use the above code?
-
02-05-2008 07:39 PM #7
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
The ResponseManager class is in the Checkbox.Forms namespace which is contained in the Checkbox assembly.
-
02-05-2008 08:35 PM #8
Junior Member
- Join Date
- Feb 2008
- Posts
- 5
Thanks. Is this kind of thing an accepted way of intereacting with the tool. If so is there documentation for it? How does it differ from the Web Services?
-
02-06-2008 01:38 PM #9
Administrator
- Join Date
- Mar 2007
- Location
- Prezza Technologies
- Posts
- 227
This is indeed an accepted way of interacting with the tool. Documentation and more support channels are available to customers who have purchased the Developer Kit. To obtain the documentation or the developer kit, please contact Prezza Support or Sales respectively.
The major difference between accessing the API (what I call the "Core" API) this way and accessing it via web services is that to run the "Core" API you are essentially hosting an instance of the Checkbox application in your custom code. As a result, you must have an app.config and all configuration files properly set up for the code to run. It's a bit more work to get started and you have less of a clearly defined API. You also don't need to worry so much about internals of the application, such as always making sure to call UserManager.Initialize() before authenticating users or calling methods that perform security checks.
To use the web services, you simply need a reference to the WebServicesProxy.dll and you're off and running. The web services wrap common functionality in simpler method calls and are also more consistent in terms of arguments and naming conventions.
In addition, the web services methods allow your API code to access a remote server. For example, we have a couple customers that host Checkbox on our servers, but use web services to synchronize user information that is maintained on their servers.
Finally, the web service methods and parameters are less likely to change than some Core API methods or other public methods exposed by Checkbox objects.
-
02-06-2008 02:04 PM #10
Junior Member
- Join Date
- Feb 2008
- Posts
- 5
Thank you for the information. We do have a copy of the developers kit, but I have only found documentation on the web services.


LinkBack URL
About LinkBacks
Reply With Quote
