0

I am using blackboard in my university. My students will have an exam online next month.

I am trying to prevent them to use copy, paste, select, right-click during the exam. I saw a lot of solutions using javascript.

When I used onpaste and oncopy it is work. whereas, adding the onselectstart and oncontextmenu to the code not work.

Could you please help me.

Thanks

<script type="text/javascript"> document.oncopy=new Function("return false");  document.onpaste = new Function("return false");  document.onselectstart = new Function("return false"); document.oncontextmenu = new Function ("return false"); </script>
Yasser
  • 1
  • 1

1 Answers1

0

Make your HTML body tag like this-

<body oncopy="return false;" oncut="return false;" onpaste="return false;" oncontextmenu="return false;">
....
</body>

<body oncopy="return false;" oncut="return false;" onpaste="return false;" oncontextmenu="return false;">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt natus optio odit sequi, vero, soluta inventore similique laudantium incidunt qui voluptatibus unde quod blanditiis ut facilis molestias necessitatibus, repudiandae eveniet.</p>
  <textarea rows="5" cols="30"></textarea>
</body>
Sajeeb Ahamed
  • 6,070
  • 2
  • 21
  • 30