├── image ├── PixPin_2024-11-25_09-20-08.jpg └── PixPin_2024-11-25_09-21-14.jpg ├── README.md └── DUT_TeacherEvaluation_Auto_Submit_Tool.js /image/PixPin_2024-11-25_09-20-08.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lentinel/DUT_TeacherEvaluation_Auto_Submit_Tool/HEAD/image/PixPin_2024-11-25_09-20-08.jpg -------------------------------------------------------------------------------- /image/PixPin_2024-11-25_09-21-14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lentinel/DUT_TeacherEvaluation_Auto_Submit_Tool/HEAD/image/PixPin_2024-11-25_09-21-14.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DUT_TeacherEvaluation_Auto_Submit_Tool 2 | 实现 大连理工大学教务系统学生总结性评教问卷 的 一键自动填写及提交 的 油猴脚本工具 3 | 4 | 参考了 [Nouchi-Kousu 的项目](https://github.com/Nouchi-Kousu/Dlut_auto-StudentSummativeEvaluation)。感谢 [@ylin314](https://github.com/ylin314) 和 [@Nouchi-Kousu](https://github.com/Nouchi-Kousu) 对本项目的贡献。 5 | 6 | 目前实现的功能是:进入每位老师的问卷页面后,点击页面左下角按钮实现一键自动填写并提交。暂时没有一键提交所有教师的问卷的功能,可能以后会加吧。 7 | 8 | 有同学反馈,1 分钟疑似只能交最多 4 份问卷,超出后教务系统会报错,大家使用时请慢点交。 9 | 10 | 由于大工教务系统的 URL 的路由规则非法,脚本会在进入教务系统首页就启动,目前无解,不影响脚本功能。 11 | 12 | 未来**问卷系统**或**问卷题目**可能**出现变化**,如果本工具出现问题,欢迎提 issue。 13 | 14 | 2025.5.20注:新版代码似乎会导致莫名其妙的 500 错误,现已回退上个版本。至于为什么会出问题等我有空再好好看看,现在没啥时间= = 15 | 16 | *** 17 | 18 | 本工具为 Tampermonkey 油猴脚本,使用前要先开启浏览器扩展的**开发人员模式**/**开发者模式**。 19 | 20 | 脚本安装方法见下: 21 | 22 | 以 暴力猴 为例,添加自定义脚本,直接把脚本的 JavaScript 代码粘贴进去保存即可: 23 | 24 | ![PixPin_2024-11-25_09-21-14](./image/PixPin_2024-11-25_09-21-14.jpg) 25 | ![PixPin_2024-11-25_09-20-08](./image/PixPin_2024-11-25_09-20-08.jpg) 26 | -------------------------------------------------------------------------------- /DUT_TeacherEvaluation_Auto_Submit_Tool.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 大连理工教师评教问卷自动提交工具 3 | // @namespace https://github.com/Lentinel/DUT_TeacherEvaluation_Auto_Submit_Tool 4 | // @version 1.6 5 | // @description DUT_TeacherEvaluation_Auto_Submit_Tool 6 | // @author Lentinel 7 | // @match *://jxgl.dlut.edu.cn/evaluation-student-frontend/* 8 | // @icon https://www.dlut.edu.cn/images/favicon.ico 9 | // @grant none 10 | // @license WTFPL 11 | // @downloadURL https://update.greasyfork.org/scripts/518819/%E5%A4%A7%E8%BF%9E%E7%90%86%E5%B7%A5%E6%95%99%E5%B8%88%E8%AF%84%E6%95%99%E9%97%AE%E5%8D%B7%E8%87%AA%E5%8A%A8%E6%8F%90%E4%BA%A4%E5%B7%A5%E5%85%B7.user.js 12 | // @updateURL https://update.greasyfork.org/scripts/518819/%E5%A4%A7%E8%BF%9E%E7%90%86%E5%B7%A5%E6%95%99%E5%B8%88%E8%AF%84%E6%95%99%E9%97%AE%E5%8D%B7%E8%87%AA%E5%8A%A8%E6%8F%90%E4%BA%A4%E5%B7%A5%E5%85%B7.meta.js 13 | // ==/UserScript== 14 | 15 | (function (global, doc) { 16 | 'use strict'; 17 | function showAutoCloseAlert(message, duration = 3000) { 18 | const alertBox = document.createElement('div'); 19 | alertBox.innerHTML = message; 20 | Object.assign(alertBox.style, { 21 | position: 'fixed', 22 | top: '20px', 23 | left: '50%', 24 | transform: 'translateX(-50%)', 25 | background: 'rgba(0, 0, 0, 0.8)', 26 | color: 'white', 27 | padding: '10px 20px', 28 | borderRadius: '5px', 29 | zIndex: '1000', 30 | boxShadow: '0 2px 5px rgba(0, 0, 0, 0.3)', 31 | fontSize: '14px', 32 | textAlign: 'center', 33 | opacity: '1', 34 | transition: 'opacity 0.5s ease', 35 | }); 36 | document.body.appendChild(alertBox); 37 | setTimeout(() => { 38 | alertBox.style.opacity = '0'; 39 | setTimeout(() => alertBox.remove(), 500); 40 | }, duration); 41 | } 42 | 43 | setTimeout(function () { 44 | showAutoCloseAlert('请在进入教师评教问卷页面后再点击“点我评教!”按钮。

1分钟内最多只能提交4份问卷,请慢点交!

请不要在问卷页面刷新网页,如需刷新,请关闭当前页面后重新从教务系统进入问卷,否则会导致问卷无法提交!', 10000); 45 | 46 | const containerDiv = doc.querySelector('div[class="main-container"]'); 47 | if (!containerDiv) return; 48 | 49 | const newButton = doc.createElement('button'); 50 | newButton.className = "el-button el-button--primary el-button--small"; 51 | newButton.innerHTML = '点我评教!'; 52 | containerDiv.appendChild(newButton); 53 | 54 | newButton.addEventListener('click', function () { 55 | console.log("Starting evaluation..."); 56 | 57 | const radioButtons = doc.querySelectorAll('input[type="radio"]'); 58 | const targetText = { 59 | "教师对学生是否存在过于严厉、对考核要求过于严格的现象?": "否", 60 | "您会向学弟学妹推荐该老师的课程吗?": "是", 61 | "教师讲解(理论课)": "老师讲解问题非常清晰透彻,重点非常突出。", 62 | "教师讲解": "老师注重因材施教,对我指导非常到位。", 63 | "引导帮助": "老师非常善于启发我的思维,总是对我的问题给予及时、有帮助的反馈,让我对这门课程产生浓厚兴趣。", 64 | "课程内容": "课程内容对我非常有用,课程所学对我今后学习、工作和生活有很大价值。", 65 | "教学设计": "教学设计精心,教学组织非常好,师生互动非常活跃,老师讲课或指导有方。", 66 | "课程资源": "课程资源丰富全面,教材教辅资源齐备,课内外资源互补,很好地满足学习需求。", 67 | "学习目标": "我非常清楚该课程的学习目标。", 68 | "学习产出": "我能很好地掌握该课程的知识和能力要点,能运用课程所学分析解决复杂问题,综合能力得到很好的训练和提升。", 69 | "老师在授课过程中是否有效地融入了思政元素?": "是", 70 | "教师是否存在放松考核要求,有意诱导学生评教结果?": "否", 71 | "您对这门课的喜爱度。": "非常喜欢" 72 | }; 73 | 74 | radioButtons.forEach(function (radio) { 75 | const questionText = radio.closest('.item_in').querySelector('.title_str')?.innerText; 76 | if (targetText[questionText] && radio.value === targetText[questionText]) { 77 | radio.click(); 78 | } 79 | 80 | const questionElement = radio.closest('.item_in')?.querySelector('.title_str'); 81 | const optionText = radio.closest('label')?.innerText.trim(); 82 | if (questionElement) { 83 | const questionText = questionElement.innerText.trim(); 84 | if (targetText[questionText] === optionText) { 85 | radio.click(); 86 | } 87 | } 88 | //无视题目直接选择“优秀” 89 | if (optionText === "优秀") { 90 | radio.click(); 91 | console.log("已选择:优秀"); 92 | } 93 | }); 94 | 95 | setTimeout(function () { 96 | const scoreInput = doc.querySelector('input.el-input__inner[placeholder="请选择"]'); 97 | if (scoreInput) { 98 | scoreInput.click(); 99 | 100 | setTimeout(function () { 101 | const scoreOption = doc.querySelector('ul.el-scrollbar__view > li.el-select-dropdown__item:last-child'); 102 | if (scoreOption) { 103 | scoreOption.click(); 104 | console.log('已选择 100 分'); 105 | } else { 106 | console.error('评分选项未找到'); 107 | } 108 | }, 150); 109 | } else { 110 | console.error('评分输入框未找到'); 111 | } 112 | }, 300); 113 | 114 | const textareaElement = doc.querySelector('textarea'); 115 | if (textareaElement && textareaElement.value === "") { 116 | textareaElement.value = "非常喜欢这门课!"; 117 | textareaElement.dispatchEvent(new InputEvent("input")); 118 | } 119 | 120 | const submitButton = document.querySelector('button.el-button--primary'); 121 | if (submitButton) { 122 | submitButton.scrollIntoView({ 123 | behavior: 'smooth', 124 | block: 'center', 125 | inline: 'nearest' 126 | }); 127 | console.log("滚动到提交按钮处"); 128 | } else { 129 | console.error("未找到提交按钮"); 130 | } 131 | 132 | setTimeout(function () { 133 | const submitButton = doc.querySelector('button.el-button--primary'); 134 | if (submitButton) { 135 | console.log("Submitting evaluation..."); 136 | submitButton.click(); 137 | } 138 | }, 1000); 139 | }); 140 | 141 | }, 2000); 142 | })(window, document); 143 | --------------------------------------------------------------------------------