Save & Search Quiz By Pak Defndr

The userscript helps you to search your quiz instantly and save your quiz question in text file.No need to see copy paste enable on internet..

  1. // ==UserScript==
  2. // @name Save & Search Quiz By Pak Defndr
  3. // @namespace https://greasyfork.org/en/scripts/26476-copy-paste-bypasser
  4. // @author Pak Defndr
  5. // @version 2.0.1
  6. // @copyright 2017+, Pakdefndr
  7. // @description The userscript helps you to search your quiz instantly and save your quiz question in text file.No need to see copy paste enable on internet..
  8. // @run-at document-start
  9. // @include http://quiz.vu.edu.pk/*
  10. // @include http://quiz.vu.edu.pk*
  11. // @run-at document-start
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. var a = document.createElement('a');
  17. a.setAttribute('href','#');
  18. a.setAttribute('target','_blank');
  19. a.setAttribute('class','btn');
  20. a.setAttribute('id','a');
  21. a.setAttribute('style','margin-right:3px;');
  22. a.innerHTML = 'Save to Disk';
  23. // apend the anchor to the body
  24. // of course you can append it almost to any other dom element
  25. document.getElementsByTagName('td')[0].appendChild(a);
  26. //document.getElementsByTagName('table')[0].innerHTML += '<a href="#">Hello</a>';
  27. var b = document.createElement('a');
  28. textbox0 = document.getElementById('txtQuestion');
  29. b.setAttribute('href','https://www.google.com.pk/search?q='+'"'+textbox0.value+'"');
  30. b.setAttribute('target','_blank');
  31. b.setAttribute('class','btn btn');
  32. b.innerHTML = 'Search In Google';
  33. // apend the anchor to the body
  34. // of course you can append it almost to any other dom element
  35. document.getElementsByTagName('td')[0].appendChild(b);
  36. function download(text, name, type) {
  37. var a = document.getElementById("a");
  38. text = text.replace(/\n/g, "\r\n");
  39. var file = new Blob([text], {type: type});
  40. a.href = URL.createObjectURL(file);
  41. a.download = name;
  42. }
  43. filename = document.getElementById('lblRemainingQs').innerHTML;
  44. SubjectC = document.getElementById('lblCourseCode').innerHTML;
  45. textbox0 = document.getElementById('txtQuestion');
  46. textbox1 = document.getElementById('lblAnswer0');
  47. textbox2 = document.getElementById('lblAnswer1');
  48. textbox3 = document.getElementById('lblAnswer2');
  49. textbox4 = document.getElementById('lblAnswer3');
  50. textbox = SubjectC+"\n"+"Question No."+filename+"\r\n"+textbox0.value+"\r\n"+textbox1.value+"\n"+textbox2.value+"\n"+textbox3.value+"\n"+textbox4.value+"\n"+"\r\n"+">>>>>>Made By Pak Defndr<<<<<<<<<";
  51. download(textbox, 'Question_'+filename+'.txt', 'text/plain');
  52. })();