Double Questions

A while back we noticed that someone searched the website for information about mrInterview questions types, so we have decided that we will add some articles about all the question types you can have in mrInterview. This article is about the numerical double question type.

Double Questions : You use the double question type when you want to allow your respondents to enter numbers that include decimal places. When creating double questions we need to follow the following structure in out metadata section

[QuestionName] [QuestionText] double [Ranges];

Example :

Wage “Q1. How much money did you earn Yesterday?”
double [50.0 .. 200.0];

Where :

QuestionName is the name of the question. There are a few things we should consider when creating our question names and your company may already have some rules that you need to follow, if you don’t have any rules to follow you should think about a few things. In our example we have decided that the question will be called Wages, the reason we have chosen this name is because it describes the question that we are collecting information into and makes it easier for people to understand when it comes to using this data for tabulating or data management.  We could have called our question “Q1” as it is our first question, and for some people this works, but just think about what happens when you have to add a question in before Q1 ?. Thinking a little about this before you start will save you time in the long run.

QuestionText is the text that is displayed to the respondent. You can put whatever text you like in here and if you really need to, you can but html code in this also. For example if you wanted to make a word “Yesterday” stand out we could make it bold. To do this we would type “Q1. How much money did you earn Yesterday?”

Next we have our “Question Type”, in this example we want to have a “Double” type question for more information on question types please click here.

Ranges are the allowable numbers that the respondent can enter. In our example we have “[50.0..200.0]” this means the respondent is allowed to enter a number between fifty and two hundred. The allowable ranges are,  -1.79769313486232e308 to -4.94065645841247eU324 for negative numbers and 4.94065645841247eU324 to 1.79769313486232e308 for positive numbers. To see the different types of ranges that you can have click here.

Additional Keywords :

Precision : This allows us to specify the number of decimal places our question will allow.

Wage “Q1. How much money did you earn Yesterday?”
double [50.0 .. 200.0] precision(2);

In the above example if 75 is the number entered then 75.00 will be stored in the data file.

Scale : This allows us to specify the number of digits that will be stored in the respondent data.

Wage “Q1. How much money did you earn Yesterday?”
double [50.0 .. 200.0] precision(2) scale(6);

In the above example if 75 is the number entered then 075.00 will be stored in the data file. It should be noted that the number used includes the decimal place.

Now that we have our metadata we need to know how to ask the question. To do this we need to put the following code in the routing section of our MDD file.

Wages.Ask()

This when the survey is run will display the following,

Double with ASK
Double with ASK

 

Now that we asked the question we may want to do other things to it, they could be ,

Q: How do I show my question so that it is read only?

Wages.show()

Q: How do I change the size of the box that I enter my number in?

Wages "How much money did you earn yesterday?"
style(
Width = "60px"
)
double [50.0 .. 200.0] precision(2) scale(6);
Double with box size change
Double with box size change

Leave a Comment

%d bloggers like this: