Zu Hauptinhalten wechseln

FV Decipher Unterstützung

Alle Themen, Ressourcen für FV Decipher benötigt.

 
decipher

Monitor and Terminate Straightliners

1:  Overview

A straightliner is anyone who selects the same answer for every row in a question.

For example:

straightliners_base.png

It is common to perform data validation checks to ensure that respondents aren't speeding through the survey like this. A respondent who answers questions like the example above can be terminated from the survey like this:

<term cond="Q1.c1.all or Q1.c2.all or Q1.c3.all or Q1.c4.all or Q1.c5.all">Q1: STRAIGHTLINED</term>

The .all function used above is a vector logic function.

2:  Examples

Instead of the explict logic written above, we can use a hidden question variable to store whether a respondent has straightlined or not.

2.1:  Straightlining a 2D Single-Select Question

Given the single-select question below:

<radio label="Q1" type="rating" values="order" shuffle="rows">
  <title>Please rate the following items:</title>
  <row label="r1">Item 1</row>
  <row label="r2">Item 2</row>
  <row label="r3">Item 3</row>
  <row label="r4">Item 4</row>
  <row label="r5">Item 5</row>
  <col label="c1">1</col>
  <col label="c2">2</col>
  <col label="c3">3</col>
  <col label="c4">4</col>
  <col label="c5">5</col>
  <col label="c6">6</col>
  <col label="c7">7</col>
  <col label="c8">8</col>
  <col label="c9">9</col>
  <col label="c10">10</col>
</radio>
<suspend/>

The code above generates the following question:

straightliners_ex1_base1.png

We can create a hidden question to track whether a respondent straightlined this question and terminate them if they did:

<exec>
for eachCol in Q1.cols:
    if eachCol.all:
        Q1_SL.r1.val = 1
        break
</exec>
<checkbox label="Q1_SL" where="execute">
  <title>HIDDEN: STRAIGHTLINED Q1?</title>
  <row label="r1">Yes</row>
</checkbox>
<suspend/>

<html label="DID_SL" cond="Q1_SL.r1" where="survey">
    YOU STRAIGHTLINED!
</html>

<html label="DIDNT_SL" cond="not Q1_SL.r1" where="survey">
    You did not straightline.
</html>
<suspend/>

<term cond="Q1_SL.r1">Q1: STRAIGHTLINED</term>

Result

The code above produces the following result:

Ex1 Demo

Demo

Click here to see the code above applied to a live survey!

2.2:  Straightlining a 2D Multi-Select Question

Given the following multi-select question below:

<checkbox label="Q2" atleast="1" shuffle="rows">
  <title>Please select all that apply:</title>
  <row label="r1">Item 1</row>
  <row label="r2">Item 2</row>
  <row label="r3">Item 3</row>
  <row label="r4">Item 4</row>
  <row label="r5">Item 5</row>
  <col label="c1">Brand 1</col>
  <col label="c2">Brand 2</col>
  <col label="c3">Brand 3</col>
  <col label="c4">Brand 4</col>
  <col label="c5">Brand 5</col>
</checkbox>

The code above generates the following question:

straightline_ex2_base.png

We can create a hidden question to track whether a respondent straightlined this question in any dimension and terminate them ifi they did:

<exec>
for eachRow in Q2.rows:
    if eachRow.all:
        Q2_SL.r1.val = 1
        break

for eachCol in Q2.cols:
    if eachCol.all:
        Q2_SL.r2.val = 1
        break
</exec>
<checkbox label="Q2_SL" where="execute">
  <title>
    HIDDEN: STRAIGHTLINED Q2?
  </title>
  <row label="r1">Yes - Straightlined a row</row>
  <row label="r2">Yes - Straightlined a col</row>
</checkbox>
<suspend/>

<html label="DID_SL" where="survey" cond="Q2_SL.any">
    [pipe: Q2_SL]
</html>
<html label="DIDNT_SL" where="survey" cond="not Q2_SL.any">
    You did not straightline.
</html>
<suspend/>

<term cond="Q2_SL.any">Q2: STRAIGHTLINED</term>

Result

The code above produces the following result:

Ex2 Demo

Demo

Click here to see the code above applied to a live survey!

2.3:  Set a Marker for Respondents Who Straightline

If you just wish to monitor respondents who straightlined a question, you can set a marker using the <marker> element and the hidden questions created above.

For example:

<marker name="Q1_STRAIGHTLINED" cond="Q1_SL.r1">Straightlined Q1</marker>
<marker name="Q2_STRAIGHTLINED" cond="Q2_SL.r1">Straightlined Q2</marker>

(Optional) For Q1, we can add the straightline logic directly into the <marker> element itself:

<marker name="Q1_STRAIGHTLINED" cond="len(set([row.val for row in Q1.rows if row.val != None])) == 1"/>

(Optional) For Q2, we can use the setMarker() function to set a marker for straightliners:

<exec>
for eachRow in Q2.rows:
    if eachRow.all:
        setMarker('Q2_STRAIGHTLINED_ROW')
        break

for eachCol in Q2.cols:
    if eachCol.all:
        setMarker('Q2_STRAIGHTLINED_COL')
        break
</exec>
  • War dieser Artikel hilfreich?