User Tools

Site Tools


bleeper

This is an old revision of the document!


bleeper - Censor offensive words in text responses

The bleeper function censors offensive words from text responses. It flags responses with offensive words and replaces offensive words with alternative characters (e.g., #). The bleeper function can be used on any type of question that contains text responses. Access to a database of offensive words is included, but alternative sources can be included.

This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.

Set-up Instructions

Survey Header

To make the function available to all questions in the survey, copy the function to the Survey Header inside a script tag: Add the bleeper function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit → and paste the provided bleeper function JS:

<script>/*Paste bleeper function JS here*/</script>

Alternatively, paste the bleeper function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.

Question JavaScript

Add JS to call the bleeper function to apply it to a ranking question as follows:

Qualtrics.SurveyEngine.addOnload(function() {
	bleeper(this);
});

To override the default options, specify the desired options in the second function argument as an object. For example:

Qualtrics.SurveyEngine.addOnload(function() {
	bleeper(this,{});
});

Options

addWords

addWords is an array of offensive words to be censored in addition to the offensive words returned by jsonSource.

Default: “[]”

bleepFlagVar

bleepFlagVar is the name of an embedded data field that captures whether any words were censored by setting its value to 1.

Default: “bleepFlag”

jsonSource

jsonSource is the url of a webservice that returns a json string containing an array of offensive words. The default database contains approximately 470 offensive words.

Default: “https://tgibbons.com/qlib/bleep_words.php

removeWords

removeWords is an array of words that should NOT be censored even though they are included in jsonSource.

Default: “[]”

replace

replace is a boolean the specifies whether censored words should be replaced. If false, offensive words are not replaced but the bleepFlag is set if any offensive words are found.

Default: true

replStr

replStr a string used to replace characters in offensive words.

Default: “#”

selector

selector a css selector specifying the text input fields within the question that the bleeper function should be applied to. selector can be used to enable bleeper on any type of question containing text responses or specific text responses within a question.

Default: “.InputText”

bleeper.1660995606.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki