PoC for answer mechanism of a survey system

  • Status Closed
  • Budget $30 - $250 USD
  • Total Bids 4

Project Description

I have a survey system under development. It's being built by use of proprietary frameworks on the server side and dojo on the client side.

This project is to build a PoC for one of the answers mechanisms. Only one page needs to be created and it must run on Chrome.

In order to get this done, I need a worker strong in Javascript, HTML5 and CSS3 and at least some knowledge in dojo.

Let me explain quickly how I expect the page works:

The questionnarie is loaded from a server side service in json format (just stub for now).

One question at a time and two buttons, Previous and Next, are presented to the user.

When user clicks on Next, the next question in the queue is presented to him/her.

When user clicks on Next, the next question in the queue is presented to him/her.

User is only allowed to click Next if he/she has answered the current question.

Answers are saved using HTML5 local storage and later, when the user is done with the survey, answers are sent in json format to backend through server side service.

A widget may be instantiated and added to the page on the fly when user clicks on Next/Prev, or they all might be created and added to the page at load time and they might just be displayed on the page at the right time.

I don't care which way is better right now.

There are several type of questions, e.g., open questions (user is free to input any text), multiple choice questions and others.

For the scope of this project, only multiple choice questions are needed. They may allow single or multiple options selection.

I already have widgets for them. You must use them to display the questions on the page.

You can find two examples of how to add those widgets to the page in /survey/test/[url removed, login to view] and /survey/dojo/quest/test/[url removed, login to view]

I think the critical point of this project is the dependences handling. The questions have a property called "depex". The value of that property normally is a string with a logical expression.

Depending on the user's answers, some questions may be skipped. A question may be skipped if a expression is evaluated to true or false, depending on the expression type.

Most of the expressions found in "depex" property would match this regular expression:

/^(SHOW|HIDE)\: (Q(.+?) (=|) (.+?) (OR|AND))* (Q(.+?) (=|) (.+?))$/

Below are some examples of expressions:

SHOW: Q2 = a AND (Q5 = b OR Q5 = c)

HIDE: Q3 = 'male'

The number after Q is the question code which is being referenced. For example, say the code of a question is "Gender" and we need show some questions only for males, we could set the depex of those questions to "SHOW: QGender = M".

Evaluation of "depex" could be done using regular expressions to transform the expression into a javascript expression, then evaluate it using eval.

In resume, what I want is the client side of the answer mechanism done, only supporting multiple choice questions, presenting one question at a time to the user, skipping questions according to their "depex" expression and saving the answers to local storage and, at the end, generating a json with all the answers. Code in attachment must be used as starting point.

Get free quotes for a project like this
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online