AMD javascript plugin to disable right click / cut / copy paste for Moodle

Following JS file can be included, that can disable

  • Mouse Right Click
  • Opening of developer console in Browser
  • Disable Cut / Copy / Paste

Following is the code

You just need to unzip this. This will show an amd folder. this contains the compiled file as well.

put that folder into plugin

and call this js by putting this php code on any page

// remember : local_poc means you are writing local plugin name as poc, so you will put amd folder in poc directory

//if you are writing block then, 
//$PAGE->requires->js_call_amd('block_poc/disabler', 'init');

$PAGE->requires->js_call_amd('local_poc/disabler', 'init');

for more about javascript in moodle , read following

developerCK

An E-learning Solution Designer, Technical enthusiastic, LAMP Stack Developer - http://about.developerck.com

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *