When a questionnaire is displayed in the browser, respondents can at least save the individual pages locally (directly in the browser or e.g. with the Firefox plug-in “Save Page WE”) or print them out. In principle, this is always possible and is related to the function of the Word Wide Web or HTML/HTTP.
Publishers who offer paid psychological tests are correspondingly concerned about their copyrighted content in online surveys and sometimes demand a certain degree of technical protection. While copying cannot be reliably prevented (anyone can take a photo of the screen with their smartphone and then feed it into OCR software), it can at least be made more difficult for the casual user to copy content from the questionnaire.
A very reliable possibility is to hide certain areas in the questionnaire in the print view. For this, SoSci Survey defines a CSS class noprint
. This is often used in conjunction with the class unselectable
, which also makes it difficult to select for copying.
Put the following HTML code in front of the part you want to protect on the questionnaire page.
<div class="unselectable noprint">
And behind the respective part, the corresponding closing tag.
</div>
These HTML codes must be added to each questionnaire page that you want to protect. Alternatively, you can search for the placeholder %questionnaire%
in the HTML template of the questionnaire layout and anchor the HTML element there.
... <div class="unselectable noprint"> %questionnaire% </div> ...
Please do not lock the right mouse button or the context menu carelessly. By doing so, you could exclude people from the correct use of the questionnaire (e.g. if they need the context menu for a software that allows the barrier-free use of websites in the browser). Likewise, some people like to use the right mouse button for text input – you can indeed block too much copy & paste.
The context menu can be blocked with the following JavaScript.
document.addEventListener("contextmenu", function(evt) { evt.preventDefault(); return false; });
The key combination Ctrl + P to print the page can also be blocked using JavaScript.
document.addEventListener('keydown', function(e) { if((e.ctrlKey || e.metaKey) && (e.key == "p" || e.charCode == 16 || e.charCode == 112 || e.keyCode == 80) ){ e.cancelBubble = true; e.preventDefault(); e.stopImmediatePropagation(); } });
These restrictions can of course be bypassed by disabling JavaScript in the browser.
Tip: If you do not want to include the JavaScript code on every page of the questionnaire (JavaScript in the Questionnaire), then you can also place it in the <head>
area of the questionnaire layout. This can be customized in the layout's HTML template
.
Images that are protected by copyright should generally be uploaded to the “protected file repository”. This way, the images cannot be accessed worldwide directly from SoSci Survey, but only from within an interview.
If you also want to avoid that interviewees simply save the image by right-clicking → “Save image as”, you can embed the image as a background image instead of using <img>
(Media Files in Questionnaires (Audio, Video, Documents)). To do so, you must explicitly specify the dimensions of the image.
<div style="background-image:url(pro://bild.jpg); background-size: cover; width: 420px; height: 200px;"></div>
Be aware that the image can still be copied from the browser cache or via the HTML source code.
Search terms: copy protection, copyright, print function