Node Package: Online Survey


The survey node can be used in a variety of situations, whether you want to gather data which is pertinent to your marketing strategy "How did you hear about us?", or whether you are simply trying to engage your user with a quiz or poll, this node is perfect.

Setting up the survey node comes in two (2) basic flavours:

  1. Poll - Users are posed a question and can choose from a select group of answers. Results are displayed as a percentage.
  2. Quiz - Create a series of questions and multiple choice answers, specifying what the correct answer is. Users submit their answers and are scored on right / wrong answers. Comments can be provided based on scaled results. Eg. 1 - 5 correct = "Whoa, better luck next time!", 6 - 10 correct = "You're a pro!".

Results of the survey must be stored in a database.

This package requires a dbconnector node to be present.

Screen Shots

Online Survey 

Online Survey
 

Online Survey 

Online Survey
 

Online Survey 

Online Survey
 

Sample Nodes for Download

  • To download any of the below sample nodes, select the code example field, press Ctrl-A to select-all, then press Ctrl-C to copy. Identify the correct parent node in your WebPal client. Right-click on the parent node, then select "Paste". To view the results, simply preview the chapter.



wpSurvey

This survey node is generally inserted into a layoutbox in a design. The end result is a question with a series of 3 or 4 answers which can be selected via radio-button input. On-submit the results are stored in a database and results are displayed based on type.

Note that this node includes code which will allow only one answer per IP address to prevent spamming.

Where to use this node

Attributes

NameUseValueHelp
name required This is used as the id and name of the form node
title optional The title of the poll/quiz. This will appear on the results page in a <h1> tag
type oneof poll, quiz Select between making a poll or making a quiz. Details are listed above.
lang oneof any, en, fr, de, es Determines what language the poll is for
status optional live, archived, hidden Determines the status of the poll. If it is live then it will display on the website, archive will show only results of the poll, and hidden will keep the poll hidden
display-result-bar oneof yes, no If you want a bar to display on the results page as a visual repesentation of the results
results-on-same-page oneof no, yes Displays the results in the same area as the poll.
printerfriendly-design optional Select the design used for the printer friendly page.
max-bar-length optional The maximum width of the results bar.
submit-button optional The text that will appear on the submit button
alert-message optional The text that will appear in a javascript alert when a question is not answer.

Sub Nodes

NameTypeHelp
button-image wpImage This gives you the option to upload a button image instead of using the standard form button.
question wpSurveyQuestion This is the node used to add a question to your poll/quiz
style wpRaw Insert custom css code with this node.
score_text wpSurveyScore Used for survey type='quiz'. Specify a message for each score value

Sample

wpSurveyQuestion

This is the question that is posed to users. This could be a multiple choice question or a simple yes/no question.

Where to use this node

Attributes

NameUseValueHelp
name required This value is used as class names and form element names for a question.
text optional The text of the question. This is saved in the database and, displayed on the poll and results page.

Sub Nodes

NameTypeHelp
results_text wpHtml Extra information that will be added to the results page.
option wpSurveyOption The node that inserts options for each question.

Sample

wpSurveyOption

These options will create radio buttons that a user can choose from when answering the question.

Where to use this node

Attributes

NameUseValueHelp
value required The value to be used in the value attribute of the option form node. This value is also stored in the database if selected.
text optional Used as the label form node and the text for that option. Appears on the poll/quiz and the results page.
correct_answer oneof no, yes Used in type = 'quiz'. Way to specify the correct answer
column oneof left, right Determines what column the options will appear in.

Sample

wpSurveyScore

This is used in type = quiz. Depending on what score the user gets, different text will appear.

Example:

score_text(1) - max_score = 10

score_text(2) - max_score = 5

If a user gets a score between 0 - 5 score_text(2) will appear on the results page, if a user gets a score between 6 - 10 score_text(1) will appear. (Each correct answer is worth 1 point.)

Inherits from:

Where to use this node

Attributes

NameUseValueHelp
max_score required Used for type = 'quiz'. This is the maximum value a user needs to get to receive that score.

Sample

More Information

Quick Navigation

| More

 

Search Site