Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Straightliners and displaying a message

Hello,

I have a request from a client that I’m unsure can even be accomplished, so I thought I would reach out here for help.

I have 15 attributes as rows in a grid question and a 1 - 5 scale and DK for the columns.

My client would like an error message to appear on the screen if a respondent gives the same score for 9 or more of the attributes in the rows.

For example, if a respondent selects a “1” to attributes 1-8 and 15, an error message would appearing saying “You assessed many items with the same score. This does not help us understand the relative importance. Could you please re-evaluate?”

Does anyone know how to accomplish this?  Any help would be greatly appreciated.

Thanks in advance,

Bryan
asked Nov 8, 2018 by Bryan

1 Answer

0 votes
 
Best answer
You can definitely do this.  Just add this custom JavaScript verification to your grid question:

var counts = [0, 0, 0, 0, 0, 0];

for (var row = 1; row <= 15; row++) {
    var value = SSI_GetValue('[% QuestionName() %]_r' + row);
    counts[value - 1]++;
}

for (var column = 1; column <= 6; column++) {
    if (counts[column - 1] >= 9) {
        strErrorMessage = 'You assessed many items with the same score. This does not help us understand the relative importance. Could you please re-evaluate?';
        break;
    }
}


Note that this will prohibit straight lining the don't know column as well as the five main columns.  To permit straight lining the don't know column, replace the "6" on line 8 with a "5."
answered Nov 8, 2018 by Zachary Platinum Sawtooth Software, Inc. (108,875 points)
selected Nov 8, 2018 by Paul Moon
Works great.  Thanks a lot Zachary!
Show message but then let respondent continue
...