• Stars
    star
    752
  • Rank 60,353 (Top 2 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 16 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Rails gem that lets you code surveys, questionnaires, quizzes, etc... and add them to your app.

Status

Gem Version Build Status Code Climate

Why surveyor?

Surveyor is a developer tool to deliver surveys in Rails applications. Surveys are written in the surveyor DSL (Domain Specific Language). A DSL makes it significantly easier to import long surveys (one of the motivations for building surveyor was copy/paste fatigue). It enables non-programmers to write out, edit, and review surveys.

If your Rails app needs to asks users questions as part of a survey, quiz, or questionnaire then you should consider using surveyor. This gem was designed to deliver clinical research surveys to large populations, but it can be used for any type of survey.

Surveyor is a Rails engine distributed as a ruby gem, meaning it is straightforward to override or extend its behaviors in your Rails app without maintaining a fork.

Requirements

Surveyor works with:

  • Ruby 2.0.0 and 2.1.1
  • Rails 3.2 and 4.0

In keeping with the Rails team maintenance policy we no longer support Rails 3.1 (stick with v1.4.0 if you need Rails 3.1) or Ruby 1.9.3 (stick with v1.4.0 if you need Ruby 1.8.7 or 1.9.3).

Some key dependencies are:

  • HAML
  • Sass
  • Formtastic

A more exhaustive list can be found in the gemspec.

Install

Add surveyor to your Gemfile:

gem "surveyor"

Bundle, install, and migrate:

bundle install
script/rails generate surveyor:install
bundle exec rake db:migrate

Parse the "kitchen sink" survey (kitchen sink means almost everything)

bundle exec rake surveyor FILE=surveys/kitchen_sink_survey.rb

Start up your app, visit /surveys, compare what you see to kitchen_sink_survey.rb and try responding to the survey.

Customize surveyor

Surveyor's controller, helper, models, and views may be overridden by classes in your app folder. To generate a sample custom controller and layout run:

script/rails generate surveyor:custom

and read the instructions generated in surveys/EXTENDING_SURVEYOR.MD

Upgrade surveyor

To get the latest version of surveyor, bundle, install and migrate:

bundle update surveyor
script/rails generate surveyor:install
bundle exec rake db:migrate

and review the changelog for changes that may affect your customizations.

What surveyor does and doesn't do

Does do

  • use a DSL to parse large surveys without hours of copy/paste into a gui builder
  • support complex, rule-based dependencies (skip-logic)
  • JSON export of both surveys and response sets
  • allow customization of all models, views, and controller, as well as helpers and routes
  • follow semantic versioning
  • exclusive checkboxes - a checkbox that when checked, unchecks all the others

Doesn't do

  • Enforce mandatory questions... yet (although it does have some1 methods2 on ResponseSet to support that)
  • Dependencies within repeaters... yet #235
  • Validations within the UI... yet #34, although it does have model support and database representations
  • GUI creating, editing, deleting and administration of surveys... yet #414
  • Consistently support HTML tags in title, text, help_text attributes. We intend to move to markdown support #413 so that same survey definition can be used with nu_surveyor.

Users of spork

There is an issue with spork and custom inputs in formatstic (#851). A workaround (thanks rmm5t!):

Spork.prefork do
  # ...
  surveyor_path = Gem.loaded_specs['surveyor'].full_gem_path
  Dir["#{surveyor_path}/app/inputs/*_input.rb"].each { |f| require File.basename(f) }
  # ...
end

Follow master

If you are following pre-release versions of surveyor using a :git source in your Gemfile, be particularly careful about reviewing migrations after updating surveyor and re-running the generator. We will never change a migration between two released versions of surveyor. However, we may on rare occasions change a migration which has been merged into master. When this happens, you'll need to assess the differences and decide on an appropriate course of action for your app. If you aren't sure what this means, we do not recommend that you deploy an app that's locked to surveyor master into production.

Support

For general discussion (e.g., "how do I do this?"), please send a message to the surveyor-dev group. This group is moderated to keep out spam; don't be surprised if your message isn't posted immediately.

For reproducible bugs, please file an issue on the GitHub issue tracker. Please include a minimal test case (a detailed description of how to trigger the bug in a clean rails application). If you aren't sure how to isolate the bug, send a message to surveyor-dev with what you know and we'll try to help.

For build status see our continuous integration page.

Take a look at our screencast (a bit dated now).

Contribute, test

To work on the code, fork this github project. Install bundler if you don't have it, then bundle, generate the app in testbed, and run the specs and features

$ bundle update
$ bundle exec rake testbed
$ bundle exec rake spec

Copyright (c) 2008-2013 Brian Chamberlain and Mark Yoon, released under the MIT license

More Repositories

1

ladle

Ladle dishes out steaming helpings of lightweight directory access (LDAP) for use in testing with rspec, cucumber, or any other ruby test framework.
Ruby
59
star
2

bcdatabase

Server-central database configuration for ruby (including rails) apps
Ruby
39
star
3

LatticeGrid

A biomedical collaboration assessment and visualization tool
JavaScript
18
star
4

nu_surveyor

an iOS port of surveyor, designed for secure offline use
Objective-C
16
star
5

shenandoah

Adds support for command-line and in-browser JavaScript unit tests in your buildr, rails, or other rake-using project
JavaScript
10
star
6

dagnabit

Directed acyclic graph plugin for ActiveRecord
Ruby
9
star
7

coldfusion-cas-client

Coldfusion CAS client based on the code written by John Watson.
ColdFusion
8
star
8

buildr-gemjar

A buildr extension for packaging a gem and its deps into a JAR for use with JRuby
Ruby
6
star
9

schema_qualified_tables

Logical schema to actual schema name mappings for ActiveRecord models
Ruby
4
star
10

surveyor_warehouse

Transform surveyor responses into a more friendly table structure
Ruby
4
star
11

bering

A tool for database schema creation and refactoring. It is is modeled on Ruby on Rails' ActiveRecord migrations and is designed for use with java projects.
Java
3
star
12

psc.rb

A ruby client for Patient Study Calendar's RESTful API
Ruby
3
star
13

Printer

Command line utility to send files to a windows printers
C++
3
star
14

jartools

A command-line utility for examining Java Archives (JARs and WARs)
Ruby
3
star
15

ncs_staff_portal

The staff expenses and outreach activities tracking application for NCS Navigator
Ruby
2
star
16

castanet

A small, snappy CAS client library
Ruby
2
star
17

ncs_signup

A signup page (aka PII page) for the NCS project
Ruby
2
star
18

psc-mirror

A git mirror of Patient Study Calendar's canonical subversion repository
Java
2
star
19

ncs_navigator_configuration

Shared configuration reader for NCS Navigator suite applications
Ruby
2
star
20

abstractor

Abstractor is a Rails engine gem for deriving and curating discrete data points from narrative text via natural language processing (NLP).
Ruby
2
star
21

ncs_navigator_authority

Authorization module for NCS Navigator
Ruby
2
star
22

bundle-recorder-jenkins-plugin

A Jenkins CI plugin that records your bundler-using ruby application's dependencies at each build and shows you changes
Ruby
2
star
23

ncs_navigator_core

Case management and instrument administration for NCS Navigator
Ruby
2
star
24

cf_case_check

A utility which walks a ColdFusion application's source and determines which includes, custom tags, etc., will not work with a case-sensitive filesystem
Ruby
2
star
25

discerner

Discerner is an engine for Rails that provides basic search UI, search reqults export UI and allows to configure available search parameters/values. Discerner is not aimed to be a SQL-generator, but it allows the host application to access stored search conditions and provide search results.
Ruby
2
star
26

CDSI_docker_example

Ruby
1
star
27

nubic.github.com

NUBIC
JavaScript
1
star
28

katas

Samples from weekly code kata
Ruby
1
star
29

omniauth_configure

Centralize OmniAuth strategy configurations on the server.
Ruby
1
star
30

vivo-vl

VIVO - Visualization Library
JavaScript
1
star
31

aker-rails

Easy Rails integration for the Aker security framework.
Ruby
1
star
32

interleave

An application for managing longitudinal clinical research databases and registries that is based on the OHDSI / OMOP Common Data Model.
Ruby
1
star
33

methodshark

Ruby
1
star
34

ncs_navigator_field

Objective-C
1
star
35

eNOTIS

Northwestern Trial Information System
Ruby
1
star
36

vivo-sparql

A place to house sample SPARQL queries to use in VIVO
1
star
37

aker

A flexible security framework for Rack (and Rails) apps. Good for integration with legacy systems, CAS SSO (including proxying), machine and interactive authentication, and much more.
Ruby
1
star
38

ncs_mdes

A Ruby API for extracting information from the NCS Master Data Element Specification
Ruby
1
star
39

nitro-competitions

NITRO Competitions is a web-based application for managing institutional funding competitions.
Ruby
1
star
40

enotis_pluggable_auth

PSC pluggable auth for eNOITS
Ruby
1
star
41

suite_authorization_source.rb

Support for writing PSC authorization plugins in ruby
Java
1
star
42

ncs_navigator_schema

JSON schema and validation tools for NCS Navigator Core <-> field client communication
Ruby
1
star
43

github-mirrorer

A cron-suitable script for keeping a local mirror of all an org's repos
Ruby
1
star
44

ctms-commons-mirror

A git mirror of ctms-common's canonical subversion repository
Java
1
star
45

ncs_navigator_deployment

Chef recipes, Vagrantfiles, and other devoppy stuff for the NCS Navigator suite
Ruby
1
star
46

ncs_mdes_warehouse

Scripts and other tools for building the MDES reporting warehouse for NCS Navigator
Ruby
1
star