OneStepSCUPJ

一键评教

  1. // ==UserScript==
  2. // @name OneStepSCUPJ
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.5
  5. // @description 一键评教
  6. // @author Justin Song
  7. // @require https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js
  8. // @match http://zhjw.scu.edu.cn/student/teachingEvaluation/*
  9. // @grant GM_notification
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. var pjtextList = [
  15. "老师讲课重点突出,授课条理清晰,认真负责,严谨,耐心,内容丰富,涉及内容十分广泛。课堂气氛很好,总是能够把授课内容和社会实际结合起来,授课内容通俗易懂。对于同学提出的建议能够认真的采纳。",
  16. "老师讲课十分投入,内容纲举目分,条理性很强,而且特别善于举例,让同学们理论联系实际,学习起来十分轻松,而且印象深刻,收到良好的效果。老师为人和蔼,课堂能与同学们互动,营造温馨的课堂气氛。",
  17. "老师上课时备课充分,语言流畅,思路清晰,课堂上有许多生动的案例分析,课堂互动时间也很多。",
  18. "对学生辅导十分耐心,真正做到传道授业解惑",
  19. "老师在课堂上不但讲课本上的知识,还给我们补充了许多课外知识,包括物理学发展过程中一些新奇的想法和前沿的科技技术,使枯燥的物理学力学变得很生动有趣,课堂气氛很是活跃。老师对他所讲的每一个知识点都十分谨慎,使每一个细节都不出差错。对作业的批改也十分认真.",
  20. "上课很负责,思路清晰,并且关心我们的学习和心理.",
  21. "教学生动有趣,治学严谨,有学者风范.",
  22. "举例生动,上课风趣有不失严谨,常能启发学生."
  23. ]
  24. var pendingList = [];
  25.  
  26. function mainPJ(){
  27. var info = document.createElement('div');
  28. var text = document.createElement('p')
  29. text.textContent = "等待10s后开始评教"
  30. info.appendChild(text);
  31. info.className = "pjtips";
  32. info.style.cssText = "position: fixed;top: 20px;right: 30px;height: 50px;width: 200px;text-align: center;z-index: 10000;background-color: white;border-radius: 10px;display: flex;justify-content: center;align-items: center;box-shadow: 0px 0px 12px 2px rgba(0,0,0,.1);transition:opacity 0.3s ease;opacity:0;"
  33. document.body.appendChild(info);
  34. setTimeout(()=>{
  35. $(info).css('opacity',1);
  36. },0)
  37. setTimeout(()=>{
  38. $(info).fadeOut(function(){
  39. document.body.removeChild(info);
  40. const nodeList = document.querySelectorAll("input.ace")
  41. nodeList.forEach((el,idx)=>{
  42. if(idx%5===0){
  43. el.click();
  44. }
  45. })
  46. const textArea = document.querySelector('.form-control')
  47. textArea.value = pjtextList[Math.floor(Math.random()*pjtextList.length)];
  48. document.querySelector('#buttonSubmit').click();
  49. });
  50. },10000)
  51. }
  52.  
  53. function initInIndex(){
  54. pendingList = [...document.querySelectorAll('#jxpgtbody button')].filter((el)=>el.innerText!=="查看");
  55. if(pendingList.length===0){
  56. return;
  57. }
  58. localStorage.setItem('pendingList',JSON.stringify(pendingList));
  59. if(pendingList.length>0){
  60. const curProc = pendingList.shift();
  61. curProc.click();
  62. }else {
  63. delete localStorage.pendingList;
  64. alert("Done");
  65. return;
  66. }
  67. }
  68.  
  69. window.onload = function(){
  70. if(location.href==="http://zhjw.scu.edu.cn/student/teachingEvaluation/evaluation/index"){
  71. //index页
  72. this.console.log('回到首页');
  73. initInIndex();
  74. }else if(location.href==="http://zhjw.scu.edu.cn/student/teachingEvaluation/teachingEvaluation/evaluationPage"){
  75. let plist = localStorage.getItem('pendingList');
  76. if(plist){
  77. mainPJ();
  78. }else {
  79. alert("需要先回到首页进行初始化")
  80. location.href = "http://zhjw.scu.edu.cn/student/teachingEvaluation/evaluation/index";
  81. }
  82. }
  83. }
  84. })();