This is an Indivo app that allows users to take surveys stored on their records using the Indivo Survey Client. Survey state and answers are stored in the user's record, so they can complete the survey at a later time, or review answers they have submitted. If a user does not have any Survey documents on their record, the application will allow them to take an example survey, which does not have its state or answers stored on the record.
-
You will need to have the following installed for a basic setup
-
Ruby 1.8.7
-
Rails 2.3.4+
-
SQLite
-
git
-
clone this repository
-
git clone --recursive git://github.com/chb/indivo_sample_surveys_app.git
-
Instruction from here on will use $APP_HOME to refer to the location you cloned to
-
install required packages
-
sudo apt-get install libsqlite3-0 libsqlite3-dev sqlite3 openssl libssl-dev libxml2 libxml2-dev libxslt1.1 libxslt1-dev
-
install required gems
-
sudo gem install sqlite3 xml-simple libxml-ruby ruby-xslt
-
create config files from sample ones
-
cp $APP_HOME/config/database.yml.sample database.yml
-
cp $APP_HOME/config/indivo.yml.sample indivo.yml
-
Create and migrate the database
$APP_HOME/rake db:migrate
- You will need an instance of Indivo Server and Indivo UI Server installed, and have generated credentials for the Indivo Sample Surveys App. See the Indivo website for more information.
- edit
$APP_HOME/config/indivo.yml
to configure the app's credentials, and the location of your Indivo X and Indivo UI Servers - A sample user app configuration for your Indivo installation bootstrap is
<user_app name='Surveys' email='[email protected]'> <consumer_key>survey_server</consumer_key> <secret>survey_server</secret> <has_ui>True</has_ui> <frameable>True</frameable> <start_url_template>http://mymachine:3000/user/go_add?record_id={record_id}</start_url_template> <callback_url>http://mymachine:3000/user/after</callback_url> <description>Take Surveys</description> </user_app>
- To launch the Sample Surveys App on localhost port 3000, run the following
$APP_HOME/script/server