Developer Documentation Library > Scripting > mrScriptMetadata User's Guide > mrScriptMetadata reference > Custom message texts
 
Custom message texts
Standard message texts are displayed by the interviewing program when a respondent selects or enters an invalid answer to a question, or when the interview comes to an end. The navigation buttons that appear in the browser when the interview is running also display standard label texts, as do the DK (Don't know), REF (Refused to answer), and NA (No answer) special responses. You can replace one or more of the standard texts by defining your own custom texts in mrScriptMetadata.
Custom texts must be defined in an Info field that has the same name as one of the standard texts. The info fields must be placed in a Block field that has the reserved name StandardTexts. In addition, error messages, navigation labels, and coded-response labels must be put in block fields (within the StandardTexts block field) that have the reserved names Errors, Navigations, and Codes respectively, as shown in the following example:
StandardTexts block fields
(
interview-message1-name "
custom-text
" info;
interview-message2-name "
custom-text
" info;
...

Errors block fields
(
error-message1-name "
custom-text
" info;
error-message2-name "
custom-text
" info;
...
);

Navigations block fields
(
navigation-label1-name "
custom-text
" info;
navigation-label2-name "
custom-text
" info;
...
);

Codes block fields
(
coded-response-label1-name "
custom-text
" info;
coded-response-label2-name "
custom-text
" info;
...
);
);
To apply custom texts to all questions, define the StandardTexts block field as a question within the Metadata section. To apply custom texts to a single question, add the StandardTexts block field to the question as a helper variable, like this:
question-name "
question-text
" question-type
  helperfields
  (
    StandardTexts block fields
    (
      ...
    );
  );
Helper variables can be added to only numeric, text, date, boolean, and categorical questions. See Helper variables for more information.
Custom texts can include standard text insertions, for example, to include the respondent's answer in the message or label. A list of the standard text insertions is included at the end of this topic. To include a standard text insertion in custom text, put the insertion name in braces, for example:
{MINLENGTH}
Response insertions, index insertions, and named insertions (which are all other types of Label text insertion) can not be used in custom texts.
Custom texts can be pre-translated: see Alternative labels for more information.
Examples
1. Custom interview messages
This example specifies text for the EndOfInterview standard message, which has the default text “End of interview. Thank you for your participation.”:
StandardTexts block fields
(
  EndOfInterview "Thank you for taking part in the ACME survey."
  info;
);
2. Custom error messages
This example specifies text for the NotNumeric standard error message, which has the default text “Answer '{ANSWER}' is not numeric”. Like the default text, the custom text uses the standard text insertion called ANSWER to include the respondent's answer in the message:
StandardTexts block fields
(
  Errors block fields (
    NotNumeric "'{ANSWER}' is not a number. Please enter a number."
    info;
  );
);
3. Custom navigation labels
This example specifies text for the Next and Previous buttons that appear in the browser when the interview is run. The Next button contains “Next Question”, and the Previous button contains “Previous Question”:
StandardTexts block fields
(
  Navigations block fields
    (
      Next "Next Question" info;
      Prev "Previous Question" info;
    );
  );
4. Custom coded-response labels
This example specifies custom texts for the DK and REF special responses, which have the default texts “Don't know” and “Refused to answer” respectively.
StandardTexts block fields
(
  Codes block fields
  (
    DK "I don't know the answer to this question" info;
    REF "Sorry, I would prefer not to answer this question" info;
  );
);
5. Applying custom texts to a single question
You can specify custom texts for individual questions by adding the StandardTexts block field as a helper variable, as the following example shows:
Question5 "Question 5: What is your surname?" text
helperfields
(
StandardTexts block fields
(

Errors block fields
(
MissingAnswer "Please enter your surname" info;
);

Navigations block fields
(
Next "Proceed To Question 6" info;
Prev "Back To Question 4" info;
);
);
);
See
Standard texts
Standard text insertions
mrScriptMetadata reference