Pular para o conteúdo principal
Base de Conhecimento da FocusVision

NoAnswer Tag: An Opt-Out Answer Option

1:  Overview

The <noanswer> element can be added to any question to create a "not applicable" answer option. Each <noanswer> element is shown as a row with a single checkbox spanning across all columns.

When a <noanswer> is selected, all other answers are cleared, disabled, and no validation logic run for the question (e.g. <validate> elements are ignored).

For example:

<radio label="Q1" optional="0">
  <title>Please rate each brand below:</title>
  <row label="r1">Brand 1</row>
  <row label="r2">Brand 2</row>
  <row label="r3">Brand 3</row>
  <col label="c1">1 <br/>Bad</col>
  <col label="c2">2 <br/>Neutral</col>
  <col label="c3">3 <br/>Great</col>
  <noanswer label="r99">Prefer not to answer.</noanswer>
</radio>

The code above produces the following result:

You can have multiple <noanswer> elements in a single question; they are displayed at the end in the order they are entered and are exclusive to each other.

An additional table named "noanswer" will be created in the report data that will contain and show the selection counts for every <noanswer> element in the survey.

2:  Attributes

Attribute Type Description
label string The unique name of the <noanswer> element
alt string The alternative report name for the <noanswer> element

2.1:  label - Set the Name of the NoAnswer

The label attribute controls the name of the <noanswer> element. You can use this attribute to check if the <noanswer> element was selected. For example:

<text label="Q1" optional="0" verify="zipcode">
  <title>What is your ZIP code?</title>
  <noanswer label="r99">Prefer not to say</noanswer>
</text>
<suspend/>

<note>Show Q1 only if noanswer wasn't selected at Q1</note>
<radio label="vQ1" optional="0" cond="not Q1.r99.val">
  <exec>
vQ1.val = getRegionFromZIP(Q1.val)
  </exec>
  <title>AUTOCODE: REGION</title>
  <row label="r1">West</row>
  ...
  ...
</radio>

 

2.2:  alt - Set the Report Name of the NoAnswer

The alt attribute controls the name of the <noanswer> element in the report data. Use this to override the default text shown. For example:

<text label="Q1" optional="0" verify="zipcode">
  <title>What is your ZIP code?</title>
  <noanswer label="r99" alt="NO ZIP CODE">Prefer not to say</noanswer>
</text>

As shown below, instead of displaying "Prefer not to say" for the <noanswer> element above, the report will display "NO ZIP CODE":

3:  Example

Below is an example of the <noanswer> element applied to several different question types:

<radio label="Q1">
  <title>
    Radio
  </title>
  <comment>Please select one</comment>
  <row label="r1">Item 1</row>
  <row label="r2">Item 2</row>
  <row label="r3">Item 3</row>
  <noanswer label="r4">No Answer</noanswer>
</radio>

<checkbox label="Q2" atleast="1">
  <title>
    Checkbox
  </title>
  <comment>Please select all that apply</comment>
  <col label="c1">Item 1</col>
  <col label="c2">Item 2</col>
  <col label="c3">Item 3</col>
  <noanswer label="r4">No Answer 1</noanswer>
  <noanswer label="r5">No Answer 2</noanswer>
</checkbox>

<text label="Q3" optional="0">
  <title>
    Text/Number
  </title>
  <comment>Please be as specific as possible</comment>
  <row label="r1">Item 1</row>
  <row label="r2">Item 2</row>
  <row label="r3">Item 3</row>
  <noanswer label="r4">No Answer</noanswer>
</text>

<textarea label="Q4" optional="0">
  <title>
    Textarea
  </title>
  <comment>Please be as specific as possible</comment>
  <noanswer label="r1">No Answer</noanswer>
</textarea>

<select label="Q5" optional="0">
  <title>
    Select
  </title>
  <comment>Please select one for each selection</comment>
  <row label="r1">Item 1</row>
  <row label="r2">Item 2</row>
  <row label="r3">Item 3</row>
  <choice label="ch1">Choice 1</choice>
  <choice label="ch2">Choice 2</choice>
  <choice label="ch3">Choice 3</choice>
  <noanswer label="r4">No Answer</noanswer>
</select>

Demo

Click here to see the code above in a live demo!

4:  What's Next?

Learn more: Validate Tag: Custom Data Quality Checks