Archive

Archive for the ‘Survey Logic’ Category

How To Add Validation Rules

May 22, 2012 Leave a comment

Overview

SurveyToGo fully supports scripting and usage of validation rules.
From the simplest ones, to the most complicated.


A Validation rule is a script that is added to a question and will be checked each time the question is being advanced forward.
If the script is valid, it will proceed to checking the jump rule (if there is one), and continue to the next question.
If it is not valid, it would prompt a custom message, and will not allow continuing.

Step 1: Add a new instance of a validation rule.

Step 2: Configuring The validation rule’s condition.

Step 3: Configuring the Validation Rule’s Custom Message.

Adding a new instance of a validation rule.

In order to add a validation rule to a question, you should go to the questions ‘Rules’ tab.
Then, you should click the button for creating a new instance of a validation rule:

Configuring The validation rule’s condition

Now let’s add the condition:

Let’s say, for this example that the current question asks about:
“How many of your kids like chocolate?”

And that question number 2 asks:
“How many kids do you have?”

So this validation rule basically checks if the answer of the current question is greater than the answer of question 2, which is not reasonable – as if a person says he has 3 kids, but he answers that 5 of his kids like chocolate, it does not make sense.
Therefore the validation rule comes in hand.

Configuring the Validation Rule’s Custom Message.

Now, let’s add an error message to prompt:

This message will prompt if the answer would be greater than the answer of question 2 and will not allow continuing, as the validation rule says.

That’s it!

Visit us at: http://www.dooblo.net

How To Add Entrance Rules (Skip Rules)?

May 22, 2012 Leave a comment

Overview

SurveyToGo fully supports scripting and usage of entrance rules (Skip Rules).
From the simplest ones, to the most complicated.

An entrance rule is a script that runs before a question is entered and decides whether this question will be asked or skipped.
If the script is valid, the question will be asked, if not, it would skip it.

Write your Entrance Rule.

You can find the entrance rule text box in each questions ‘Rules’ tab:

Now we can add an entrance rule as we wish.
For example:

This rule, will show the specific question, only if the answer of question 5 is answer 2.

You can add much more complicated rules and even use functions.
Further more, you can use the ‘Create Rule’ Wizard, however, it is more limited then writing your script on your own.

That’s it!

Visit us at: http://www.dooblo.net

How To: Create Branch Rules

May 14, 2012 Leave a comment

Overview

SurveyToGo fully supports scripting and usage of branch rules (Jump rules).
From the simplest ones, to the most complicated.

In this ‘How to’ I will show you the simple steps in order to start implementing your branch rules (Jump rules).

Step 1: Add a new instance of a Jump Rule.

Step 2: Configuring The Branch rule’s condition.

Step 3: Configuring the Branch Rules Action & Target.

 

Step 1: Adding a new instance of a Jump rule.

A Branch rule is a condition that will be checked once a question was finished, if the condition is valid, the action configured would be executed:

First of all, you should go into the desired question’s Rules Tab and create a new instance of a branch rule, as the following picture:

Step 2: Configuring the Branch Rule’s condition.

If you click the ‘<Set condition>’ text box, you would be able to enter your own script for the condition, for example:
‘Answer(CurrQues)==2′

Any script that eventually returns a true\false value is valid here.

Step 3: Configuring the Branch Rules Action & Target.

By clicking on the ‘<Set Action>’ text box, you would be able to set the desired action:

And the same for the ‘Target’ text box, for example:

This branch rule, will go to question index 3, if the answer of the current question is 2.

That’s it !

Visit us at: http://www.dooblo.net

SurveyToGo – Built-In Functions Hand Book

May 14, 2012 Leave a comment

Overview

SurveyToGo contains an enormous set of built-in functions ready to use.
We have assembled all of them in one file – a useful handbook for scripting surveys.
Please see this link for the download:

http://www.dooblo.net/downloads/SurveyToGoCommands.zip

It contains all the functions but in a more raw form. We are in the process of moving them from this file to a more elegant web manual. The beta version of the web manual is here: http://stg.dooblo.net/ULDocs – but it is only in beta so please expect things to be a bit weird with it.

We strongly recommend having this, Very Handful!

Visit us at: http://www.dooblo.net

How To: Creating Custom Action Buttons

May 13, 2012 Leave a comment

Overview

SurveyToGo Studio enables you to script custom actions that will appear in your survey as buttons!
Anything you have in mind that is scriptable, you can script to an action button.

This ‘How-To’ will show you how to do it with a few simple steps:
Step 1: Add a new Custom Action.
Step 2: Write the code you want.
Step 3: Test it!

Here it is:

Step 1: Adding a new Custom Action

Go to the ‘Survey Properties’ tab.

Then, after clicking ‘Edit Custom Actions’, you should add a ‘New Action’ and choose its name:

Step 2: Writing the action button script:

Now you can write your own script in the ‘Action Code’ text-box, for example:

Please disregard the ‘Action Available’ text-box.

Step 3: Testing your action button:

First, enter a survey and run it.
Now, if you click your devices settings button (Each device the button looks different) you would get the menu which you would see the ‘Actions’ Button:

After clicking it, you would see the actions you configured:

By clicking it, the script you wrote in the ‘Action Code’ text-box will run once.
As you can see, I scripted it to prompt a message box, here it is:

That’s it !

Visit us at: http://www.dooblo.net

How To: Edit The Survey’s Texts

February 20, 2012 Leave a comment

Overview

SurveyToGo allows you to modify most of the survey texts!
By texts I mean: Error messages, Main Menu messages, Question UI Texts, Survey messages, etc’.
This allows YOU to decide what text will show on Errors, Messages and in the UI!

How To Edit Survey Texts:

  • Click on your survey root and go under the ‘Survey Texts’ tab.
    Then you will see the next menu:
  • Those marked in Purple are the subjects.
  • Those marked in Orange are names of the texts place.
  • The area marked in Black is where you input the text.
  • The area marked in Green is the description.

That’s it!
Now you can try changing the texts in your survey !


Visit us at: http://www.dooblo.net

How To: Work with QRef’s & Short ID’s

January 9, 2012 Leave a comment

Overview

Working with QRef’s and Short ID’s is one of the most basic methods for keeping your survey organized, readable and correctly indexed.
Those methods are easy to use and will help preventing scripting errors that might be caused.

QRef
Let’s say for example that we have the following script written somewhere in our survey:
Answer(15)==1
If we add\remove more questions\chapters or move questions places, that scripts index might not index any more to the right question.
Therefore QRef
method should be used.
For example:
Answer(QRef(15))==1
If the script is written like that, no matter what changes will be made, the index will follow the correct question it was indexed on.
In conclusion, getting used to add QRef’s regularly is easy, quick and saves a lot of time in case of index errors.

Short ID’s
In order to index our questions in the most elegant way; we have the Short ID method.
If you go to the survey properties tab and check the ‘ShortID as Question Index’ & ‘Show Question Index’:

Then, if you go to the variables tab of a question, you can choose its ID:


After choosing it’s ID, you will notice that the short ID will appear as following:

And when the survey will run, it will appear like that:


This is an easy, quick and elegant way to organize all your questions with their index’s.

That’s it, two simple methods, but highly important.

Visit us at: http://www.dooblo.net

How To: Use basic scripting operators

December 6, 2011 Leave a comment

Overview

In order to script correctly, calculate and use functions with our complex scripting engine – basic knowledge of programming operators is needed.
The following ‘How To’ will summarize all the common used operators syntax and their truth tables.

Logic Operators:

‘AND’ Operator:
The ‘AND’ operator is represented as ‘&&’ in code and its truth table is the following:

A

B

A && B

FALSE

FALSE

FALSE

FALSE

TRUE

FALSE

TRUE

FALSE

FALSE

TRUE

TRUE

TRUE

‘OR’ Operator:

The ‘OR’ operator is represented as ‘||’ in code and its truth table is the following:

A

B

A || B

FALSE

FALSE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

TRUE

TRUE

TRUE

TRUE

‘NOT’ Operator:

The ‘NOT’ operator is represented as ‘ ! ‘ in code and its truth table is the following:

A

!A

FALSE

TRUE

TRUE

FALSE

XOR’ Operator:

The ‘XOR’ operator is represented as ‘ ^ ‘ in code and its truth table is the following:

A

B

A ^ B

FALSE

FALSE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

TRUE

TRUE

TRUE

FALSE


Mathematical Operators:

‘GREATER THAN’ Operator:

The ‘GREATER THAN’ operator is represented as ‘ > ‘ in code. (Return’s TRUE or FALSE)

‘GREATER THAN OR EQUALS TO’ Operator:

The ‘GREATER THAN OR EQUALS TO’ operator is represented as ‘ >=’ in code. (Return’s TRUE or FALSE)

‘SMALLER THAN’ Operator:

The ‘GREATER THAN’ operator is represented as ‘ < ‘ in code. (Return’s TRUE or FALSE)

‘SMALLER THAN OR EQUALS TO’ Operator:

The ‘GREATER THAN’ operator is represented as ‘ <= ‘ in code. (Return’s TRUE or FALSE)

‘EQUALS TO’ Operator:

The ‘EQUALS TO operator is represented as ‘ == ‘ in code. (Return’s TRUE or FALSE)
* Please note that using ‘=’ operator will assign the right value to the left and NOT check if they are equal.

‘NOT EQUALS TO’ Operator:

The ‘NOT EQUALS TO operator is represented as ‘ != ‘ in code. (Return’s TRUE or FALSE)

Mathematical methods:

‘+’ is used for adding.

‘-’ is used for subtracting.

‘/’ is used for dividing. (Remnant is dismissed).

‘%’ is used for getting the remnant from dividing by ‘x’.
‘*’ is used for multiplying.

‘+=’ is used to do the following: ‘x += 2′ is a short way to write: ‘x = x + 2′. (the same for the rest of the operators).

This is a summary of most of the commonly used operators.

Visit us at: http://www.dooblo.net

Categories: FAQ, Survey Logic

(Survey Logic) Chapter 5 – Built-In Functions

February 13, 2011 Leave a comment

Back to Table Of Contents
Back to Chapter 4 – Jump (Branch) Rules

About Built-In Functions

SurveyToGo includes many built-in functions to help you accomplish as many tasks as possible with easy.

You can get a complete list of functions by sending an email to support@dooblo.net.

Partial list of Built-In Functions

Question types: T/F – True False, N – Numeric, A – Any, D – Date, S – Text

Function Description T Parameters Example
Questions
Equals(QuesIdx, Value) The answer to question QuesIdx is Value T/F QuesIdx – Index of question

Value – The value to check

Equals (5,4)

Checks if the answer to question 5 was 4.

Equals (5,“good”)

Checks if the answer to question 5 was “good”.

Answered(QuesIdx) Question QuesIdx was answered and not skipped. T/F QuesIdx – Index of the question. Answered(5)

Question 5 has an answer.

NotAnswered(QuesIdx) There is no answer for QuesIdx. T/F QuesIdx – Index of the question. NotAnswered(QuesIdx)

Question 5 has no answer.

Contains(QuesIdx, Value) Answer to question QuesIdx contains the value Value. This function can be applied to either FreeText, MultiTopics, Matrix or MultiSelect questions. T/F QuesIdx – Index of question

Value – The value to check

Contains(5, “good”)

Answer to question 5 contains the word “good”.

Contains(5, 3)

MultiTopics/Matrix: The 3rd option was selected in at least one topic.

MultiSelect: The 3rd option was selected among others.

NotContains(QuesIdx,
Value)
The exact opposite of the Contains function T/F See the Contains function See the Contains function
NumOfChoices(QuesIdx) The number of choices chosen in QuesIdx. Applies to MultiSelect questions. N QuesIdx – Index of question. NumOfChoices(5)>2

The number of selected options in the MultiSelect question 5, is bigger than 2.

AnswerChoice(QuesIdx, ChoiceIdx) The answer index to the topic ChoiceIdx in question QuesIdx. Applies to MultiTopic questions. N/S QuesIdx – Index of question.

ChioceIdx – Topic index.

AnswerChoice(5,3)==7

The answer index to topic 3 of question 5 was 7.

ContainsSpecificRate(QuesIdx, Value, TopicIdx) The answer index to the topic TopicIdx is Value. Applies to MultiTopic or Rating questions. T/F QuesIdx – Index of question.

Value – Value to check.

TopicIdx – Index of the topic.

ContainsSpecificRate(5, 7, 3)

The answer index to topic 3 of question 5 was 7

NotContainsSpecificRate(QuesIdx, Value, TopicIdx) The exact opposite of NotContainsSpecificRate T/F See the NotContainsSpecificRate function. See the NotContainsSpecificRate function.
Answer(QuesIdx) Returns the value of the answer to question QuesIdx. Applies to FreeText, Numeric, DateTime and MultiChoice questions. A QuesIdx – Index of the question. Answer(5) == “good”

Answer to question 5 is “good”.

Answer(5) == 3

MultiChoice: Index of answer to question 5 is 3.

Numeric: Answer to question 5 is 3.

Answer(5) > 3

MultiChoice: Index of answer to question 5 is greater than 3.

Numeric: Answer to question 5 is greater than 3.

AnswerText(QuesIdx, AnswerIdx) The text label of the answer index AnswerIdx of question QuesIdx.

Applies to MultiChoice or MultiTopic questions.

S QuesIdx – Index of the question.

AnswerIdx – Index of the answer/topic.

AnswerText(5, 3)

MultiChoice: The text of the 3rd option in question 5.

MultiTopics: The text of the 3rd topic in question 5.


CurrQues Returns the index of the current question. Useful for writing cleaner expressions that refer to the current question, instead of using the actual question index. N Answer(CurrQues)

Returns the answer to the current question. Refer to the Answer function for more info.

FilterAnswersByAnswers(TargetQuestionIdx, SourceQuestionIdx) The answers of the question TargetQuestion are filtered based on the answers of question SourceQuestion.

Note both questions have to have the same answers

S TargetQuesIdx – Index of the target question.

SourceQuesIdx – Index of the source question

FilterAnswersByAnswers(CurrQues, 3)

MultiSelect: The answers of this question will only be the answers chosen in Q3.


Subject
SubjectProp(PropName) Returns the subject property with the name of PropName. A PropName – Name of the subject property. SubjectProp(“Gender”) == “Male”

The value of the subject property named “Gender” equals to “Male”.

SubjectProp(“Age”) >= “Male”

The value of the subject property named “Age” is greater or equal to 18.

ExternParam(ParamName) Returns the value of the external parameter ParamName. A ParamName – The external parameter.
ExternParam(“Age”) < 18

The value external parameter “Age” is less than 18.

Utility

Date(Date) Returns a date type value of the supplied Date. Mostly used when comparing values of functions that return dates. D Date – The date you want to represent.
Answer(5) > Date(“5/5/2005″)

The answer to the date question 5, is a date that is greater than 5/5/2005.

Today Returns the date of today. D Answer(5) > Date(Today)

The answer to the date question 5, is a date that is greater than the date of today.

Now Returns the current time. D Now > Date (“22:04″)

The current time is greater than 22:04.

IsPlatform(Platform) Returns whether the current platform running the survey is Platform. Mostly used to run certain questions only on certain platforms for surveys that are being run on multiple platforms. T/F Platform – The platform to check. Can be any of the following:

ePlatform.Web

ePlatform.PC

ePlatform.PDA

ePlatform.Mobile

ePlatform.All

IsPlatform(ePlatform.PDA)

Returns whether the current platform running the survey is the PDA.

Visual
SetText(QuesIdx, Value) Sets the text of the question QuesIdx. Applies to all questions. QuesIdx – Index of the question.

Value – The text to set as the question text.

SetText(5, “What is your name?”)

Sets the text of question 5 to be “What is your name”.

SetTextFormat(QuesIdx,Value1[,Value2,Value3,…]) Set the text of the placeholders inside the question text. The list of values should match corresponding {0}, {1},{2}… elements inside the question text.

Applies to all questions.

QuesIdx – Index of the question.

Value1 – The text to set instead of the “{0}” found in the question.

Value2 – The text to set instead of the “{1}” found in the question.

Value3 – The text to set instead of the “{2}” found in the question.

SetTextFormat(5,”John”,”Smith”)

If the text of question 5 was “Hello {0} {1}” then the text of question 5 will become: “Hello John Smith”.

SetAnswer(QuesIdx,Value) Sets the answer of a text question to be Value. Applies to FreeText questions. Can be used to set the default answer to the question. QuesIdx – Index of the question.

Value – The text to set as the answer text.

SetAnswer(5,”ABC”)

Sets the answer to question 5 to be “ABC”.

SetAnswer(QuesIdx,Value1[,Value2,Value3,…]) Sets the answer(s) of MultiChoice, Numeric, MultiSelect or MultiTopic questions. QuesIdx – Index of the question.

Value1 – The option to set.

Value2 – The option to set.

Value3 – The option to set.

SetAnswer(5,3)

Numeric: Sets the answer to question 5 to be 3.

MultiChoice: Sets the 3rd option in question 5.

MultiSelect: Selects the 3rd option in question 5.

SetAnswer(5,3,7,8)

MultiSelect: Selects the 3rd , 7th and 8th option in question 5.

MultiTopics: Sets the 3rd option of topic 1, the 7th option of topic 2 and the 8th option in topic 3.

TopBanner.Text =
Value
Sets the text of the top banner in the survey Value – Text to be set as the top banner text. TopBanner.Text =
“Satisfaction Survey”

Sets the text of the top banner to “Satisfaction Survey”.

TopBanner.Color =
Value
Sets the color of the top banner in the survey Value – The color of the top banner. Can be one of the colors mentioned in Appendix A – Colors. TopBanner.Color =
Color.Blue

Sets the color of the top banner text to blue.

TopBanner.BackColor =
Value
Sets the background color of the top banner in the survey Value – The background color of the top banner. Can be one of the colors mentioned in Appendix A – Colors. TopBanner.BackColor =
Color.White

Sets the background color of the top banner text to White.

TopBanner.FontName =
Value
Sets the font of the text of the top banner in the survey Value – Font name to use. TopBanner.FontName =
“Tahoma”

Sets the font of the top banner to be “Tahoma”.

TopBanner.FontSize =
Value
Sets the font size of the top banner text in the survey Value – The actual size of the font. TopBanner.FontSize =
8

Sets the font size to 8.

TopBanner.FontStyle =
Value
Sets the font style of the top banner. Value – Style to use. Can be one of the following:

FontStyle.Bold

FontStyle.Italic

FontStyle.Regular

FontStyle.Strikeout

FontStyle.Underline

TopBanner.FontStyle =
FontStyle.Bold

Sets the font style of the top banner to bold.

TopBanner.Visible =
Value
Controls whether the top banner is visible or not. Value – Set to either True or False. TopBanner.Visible =
True

Makes the top banner visible.

 

 

Back to Table Of Contents

Visit us at: http://www.dooblo.net

Categories: Survey Logic

(Survey Logic) Chapter 4 – Jump (Branch) Rules

February 13, 2011 Leave a comment

Back to Table Of Contents
Back to Chapter 3 – Validation Rules

About jump rules (Also known as branch rules)

Jump rules are used to control the branching of the survey. When adding a jump rule to a question you also specify where the survey should jump to if the jump rule evaluates to true.

A question can have more than one jump rule, and a jump rule can be either a basic expression or a sophisticated one. When more than one jump rule is added to a question, SurveyToGo will evaluate all the jump rules one by one and the first jump rule that evaluates to true will be applied.

Jump rules can force the survey to take the following actions:

  1. Jump to a specific question anywhere in the survey
  2. Jump to a specific chapter anywhere in the survey
  3. Cancel the survey (stops the survey and deletes the answers)
  4. Filter out the survey (stops the survey but keeps the information collected up until the filter)
  5. Submit the survey

Adding jump rules

Adding jump rules is done by:

  1. Select the question you wish to add a validation rule for
  2. Switch to the “Rules” tab
  3. Click the “new” icon on the jump rules grid toolbar
  4. Write the rule expression
  5. Select the action you would like to take when the rule evaluates to true.

Sample jump rules

The following sections are sample snippets that will help you to perform the most common jump rules.

(1) Branch from Q1 to Q2,Q3 or Q4 based on a specified answer

Survey Snippet

[Q1]: “Which beer brand do you like most?” [Corona, Amstel, Becks]

[Q2]: “You chose Corona!” [empty]

[Q3]: “You chose Amstel!” [empty]

[Q4]: “You chose Becks!” [empty]

Requirement

Branch from Q1 to the relevant question based on the answer to Q1.

Solution

Add the following jump rules to Q1:

[condition] Answer (CurrQues) == 1 [action] Go to Q2

[condition] Answer (CurrQues) == 2 [action] Go to Q2

[condition] Answer (CurrQues) == 3 [action] Go to Q2

Explanation

Each jump rule is checked. The one that evaluates to TRUE will be the one applied and its action will be carried out.


Go To Chapter 5 – Built-In Functions

Back to Table Of Contents

Visit us at: http://www.dooblo.net

Categories: Survey Logic
Follow

Get every new post delivered to your Inbox.