====== Restrict Print Function ====== 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. ===== Customise Print View ===== 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.
And behind the respective part, the corresponding closing tag.
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 [[:en:create:layout|questionnaire layout]] and anchor the HTML element there. ...
%questionnaire%
...
===== Disable Context Menu ===== 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 [[:en:create:javascript|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 ([[:en:create:javascript]]), then you can also place it in the '''' area of the [[:en:create:layout#complete_customization|questionnaire layout]]. This can be customized in the layout's ''HTML template''. ===== Complicating the Saving of Images ===== 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 '''' ([[:en:create:media]]). To do so, you must explicitly specify the dimensions of the image.
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