<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Game g = new Game(); &#187; survey</title>
	<atom:link href="http://thomasschweitzer.com/tag/survey/feed/" rel="self" type="application/rss+xml" />
	<link>http://thomasschweitzer.com</link>
	<description>Nerdy thoughts</description>
	<lastBuildDate>Tue, 12 Apr 2011 13:33:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Integrating a survey tool in your web application</title>
		<link>http://thomasschweitzer.com/2009/01/23/integrating-a-survey-tool-in-your-web-application/</link>
		<comments>http://thomasschweitzer.com/2009/01/23/integrating-a-survey-tool-in-your-web-application/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 09:48:18 +0000</pubDate>
		<dc:creator>tom</dc:creator>
				<category><![CDATA[technics]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[interceptor]]></category>
		<category><![CDATA[limesurvey]]></category>
		<category><![CDATA[survey]]></category>

		<guid isPermaLink="false">http://thomasschweitzer.com/?p=129</guid>
		<description><![CDATA[Facing the question how to implement a basic survey functionality within a web application, I had several options: Implementing a new system from scratch Linking to an external hosted system Integrating an existing 3rd party survey tool into the web application The survey features were important, but would not justify a big amount of workload, [...]]]></description>
			<content:encoded><![CDATA[<p>Facing the question how to implement a basic survey functionality within a web application, I had several options:</p>
<ul>
<li>Implementing a new system from scratch</li>
<li>Linking to an external hosted system</li>
<li>Integrating an existing 3rd party survey tool into the web application</li>
</ul>
<p>The survey features were important, but would not justify a big amount of workload, so implementing a new system from scratch (that would give enough flexibilty to support different types of question types and complex ways of analyzing results) was out of the question.</p>
<p>The downside of this decision was that the survey administration will not be integrated into the rest of the administration interface, but we could live with that.</p>
<p>Linking to an external hosted system (like <a href="http://www.surveymonkey.com/">SurveyMonkey</a> or <a href="http://www.surveygizmo.com/">SurveyGizmo</a>) sounded nice, but I needed to be able to control access to the survey via tokens &#8211; so that a single user could answer a certain survey only once by using a token issued to him by me.</p>
<p>Most of the external hosted survey tools have no problem using tokens, but I needed to dynamically generate this token within my web application right before I send the user the invitation to answer the survey, so I needed to be able to insert new tokens <em>at runtime</em> from my application &#8211; and could not figure out how to do that using a hosted system.</p>
<p>By integrating an existing solution, I would be able to have direct access to the (local) database, inserting tokens on the fly.</p>
<p>What I ended up doing was using the open source <a href="http://www.limesurvey.org/">LimeSurvey</a>. It&#8217;s a standard PHP/mySQL application, and seems like the defacto standard solution for surveys on the web.</p>
<p>LimeSurvey can serve all sorts of question types, and &#8211; most importantly &#8211; use tokens to control access to restricted, non-anonymous surveys.</p>
<p>These tokens are stored in DB tables named <strong>tokens_&lt;SURVEYID&gt;</strong> whereas &lt;SURVEYID&gt; is (you guessed it) the numerical ID of the survey.</p>
<p>Now, if you construct the SQL update statement manually, it&#8217;s pretty easy to concat the survey ID into the statement string, but since I was already using <a href="http://www.hibernate.org/">Hibernate</a>, I wanted to refrain from hardcoding SQL in my application.</p>
<p>After some <a href="http://java.dzone.com/articles/hibernate-dynamic-table-routin">research</a>, I implemented a custom Hibernate Interceptor, which allowed me to insert the surveyID into the SQL-string on the fly without any other hassle.</p>
<p>I will write more about how we use and trigger the survey invitations in a later post.</p>
]]></content:encoded>
			<wfw:commentRss>http://thomasschweitzer.com/2009/01/23/integrating-a-survey-tool-in-your-web-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

