Grid 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 “Grid” questions.

Grid Questions : You use the Loop question type when you want to repeat questions multiple times changing the text slightly using a brand list or something similar. When displayed a loop question type by default will show the question in the format of a grid, with the grid subjects down the side and the questions being asked along the top . When creating Loop questions to display our question in a grid format we need to follow the following structure in out metadata section

[GridName] [GridText] loop
{
[LoopTextID] [LoopText],
} fields
(
[RepeatingQuestions]
) expand;

Example :

 RatingGrid “Q1. How would you rate the following products” loop
{
     _1 “Product A”,
     _2 “Product B”,
     _3 “Product C”
} fields
(
     Rating “” categorical [1]
    {
     _1 “1 – Good”,
     _2 “2”,
     _3 “3”,
     _4 “4”,
     _5 “5 – Bad”
    };
) expand;

Where :

GridName 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 RatingGrid, 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 the word “product” stand out we could make it bold. To do this we would type “Q1. How would you rate the following products?”

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

LoopTextID is the ID that we want to associate to the loop text. This is like the ResponseName of a categorical question and follows the same rules. For more infomation click here

LoopText is the text that we want to see on the side of the left hand side of the grid repeated.. This is like the ResponseText of a categorical question and follows the same rules. For more infrmation click here

Fields this keyword introduces the question that will be asked against the loop iterations or subjects

RepeatingQuestions are the questions to be used in the grid. We can have mutiple questions and are not limited by just one question.

Expand this keywords tells mrInterview to store the data in a flat format.

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.

RatingGrid.Ask()

This when the survey is run will display the following,

Rating Grid
Rating Grid

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?

RatingGrid.show()

3 thoughts on “Grid Questions”

  1. Please suggest how i can implement a multi header grid with good formatting. Although i know we can implement it using sublist but the formatting is not so good in that case. Is there a good way to implement this.

  2. Can you please tell me how to validate a Ranking grid with answer groups.
    DDL 5.5 has a function for validating Ranking grid without answer groups, i need a validation function that can be used in the Routing section to validate Ranking Grid with answer groups.

Leave a Comment