- Implemented in JavaScript using:
- JavaScriptMVC (JMVC)
- jQuery & jQuery UI
- Bootstrap
- Creates RDF/XML survey definitions as described here
git clone git://github.com/chb/survey_builder.git
cd survey_builder
git submodule init
git submodule update
The quickest way to run the builder (without preview functionality) is to open up survey_builder/surveybuilder/index.html
in your favorite browser. (though Chrome's XMLHttpRequest by default doesn't let you read from the file system anymore, so you can launch it with the flag --allow-file-access-from-files, or use a different browser)
####Enabling Previews
The builder's example data connector is configured by default to read and save to your browser's local storage when retrieving and storing definitions. This setup works well when testing the builder in conjunction with the Indivo Survey Client, which by default is configured to read from browser local storage.
In order to view previews of your survey, you will need to install the Indivo Survey Client and then configure the builder's PREVIEW_PATH
variable in survey_builder/surveybuilder/index.html
to point to where the client is hosted.
Note, since you can't access local storage cross-domain, you will need to host both the builder and client under the same domain (using Apache HTTP Server on your localhost for example) if you want them to use the default local storage setup for saving and loading.
The Indivo Survey Builder saves and retrieves survey definitions using a generic data connector that provides two methods
- save_survey
- passed the RDF/XML definition to save
- get_survey
- retrieves an RDF/XML definition to load
The data connector resides in survey_builder/surveybuilder/index.html
, and replacing the example implementations with ones that communicate with another service is your key to integrating the builder with a persistent store.
###Development v.s. Production Modes By default, the builder will run in development mode, allowing for console logging and easier debugging. To compress the builder for increased performance and a decreased download profile, do the following
- from
survey_builder/
run./steal/js ./surveybuilder/scripts/build.js
- edit
survey_builder/surveybuilder/index.html
and change the existing script tag to point to the new production bundle:
- old
steal('surveybuilder').then(function($) {
- new
steal('surveybuilder/production.js').then(function($) {