中华会计继续教育刷课脚本
中华会计继续教育
# 脚本介绍
该油猴脚本用于 中华会计继续教育 的辅助学习,使用JavaScript编写,适配网址:https://jxjy.chinaacc.com
脚本功能如下:
- 智能播放控制 自动检测并播放视频,处理各种播放异常
- 倍速调节功能 支持1.2倍至3倍速调节,可自定义倍速值
- 自动答题系统 支持单选题、多选题、判断题自动作答
- 自动下一课 课程完成后自动跳转至下一课程
- 学习进度记录 实时记录学习进度,避免重复学习
脚本安装地址:
暂时下架
如果不会安装脚本,请按照下面安装教程来操作。
# 代学服务
提示
如需代学,请联系客服,支持闲鱼交易。

微信联系:yizhituziang

QQ联系:2422270452
- img: /img/weixin.jpg
name: 微信联系:yizhituziang
- img: /img/qq.jpg
name: QQ联系:2422270452
# 安装教程
# 1.安装浏览器扩展插件
首先需要给我们的浏览器安装上脚本猫插件,这是运行所有用户脚本的基础,如果浏览器已经安装过了脚本猫或者油猴插件,那么可以跳过这一步。推荐使用edge浏览器,安装插件更方便。
浏览器打开网址:https://docs.scriptcat.org/ (opens new window)
这里用edge浏览器作为示范,点击 "添加到Edge浏览器"

接着点击 "获取"

在右上角弹出的窗口,点击 "添加扩展"

等待几秒钟,会提示已经安装好脚本猫插件了。

# 2.安装刷课脚本
打开脚本安装地址后,在页面点击 "安装脚本" 按钮,接着在弹出的窗口点击 "安装" ,之后就会提示"安装成功"。
# 3.体验脚本功能
安装脚本后,需要重新进入学习站点,如果之前已经打开课程学习页面,那么需要刷新页面后脚本才会生效。
# 核心代码
// 中华会计继续教育辅助脚本
class ChinaAccHelper {
constructor() {
this.config = {
autoPlay: true,
playbackRate: 2.5,
autoMute: true,
autoAnswer: true,
autoNext: true,
simulateActivity: true,
checkInterval: 2500,
activityInterval: 10000,
maxRetryCount: 5
};
this.retryCount = 0;
this.init();
}
log(message) {
console.log(`[中华会计辅助] ${message}`);
}
init() {
this.log('脚本初始化中...');
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => this.start());
} else {
this.start();
}
}
start() {
this.log('脚本已启动');
setInterval(() => {
this.mainLoop();
}, this.config.checkInterval);
if (this.config.simulateActivity) {
setInterval(() => {
this.simulateActivity();
}, this.config.activityInterval);
}
}
getVideoElement() {
const selectors = [
'video',
'.video-player video',
'#myVideo video',
'.video-wrap video',
'.player-container video',
'.acc-video video',
'[class*="video"] video'
];
for (const selector of selectors) {
const video = document.querySelector(selector);
if (video) {
return video;
}
}
return null;
}
setupVideo(video) {
if (!video) return;
if (this.config.autoMute && !video.muted) {
video.muted = true;
this.log('视频已静音');
}
if (video.playbackRate !== this.config.playbackRate) {
video.playbackRate = this.config.playbackRate;
this.log(`播放倍速设置为 ${this.config.playbackRate}x`);
}
video.addEventListener('ratechange', () => {
if (video.playbackRate !== this.config.playbackRate) {
video.playbackRate = this.config.playbackRate;
}
});
}
playVideo(video) {
if (!video) return;
if (video.paused && !video.ended) {
video.play().then(() => {
this.log('视频播放成功');
this.retryCount = 0;
}).catch(err => {
this.log(`播放失败: ${err.message}`);
this.retryCount++;
if (this.retryCount < this.config.maxRetryCount) {
this.log(`尝试点击播放按钮 (${this.retryCount}/${this.config.maxRetryCount})`);
this.clickPlayButtons();
} else {
this.log('重试次数已达上限');
}
});
}
}
clickPlayButtons() {
const selectors = [
'.play-btn',
'.video-play',
'.btn-play',
'.play-button',
'.vjs-big-play-button',
'#playBtn',
'[class*="play"]',
'button[title="播放"]'
];
for (const selector of selectors) {
const btn = document.querySelector(selector);
if (btn && btn.offsetParent !== null) {
btn.click();
this.log(`点击了播放按钮: ${selector}`);
break;
}
}
}
handleQuiz() {
if (!this.config.autoAnswer) return;
const modalSelectors = [
'.quiz-modal',
'.exam-modal',
'.question-box',
'.answer-container',
'.test-dialog',
'[class*="quiz"]',
'[class*="exam"]',
'[class*="question"]'
];
let targetModal = null;
for (const selector of modalSelectors) {
const modal = document.querySelector(selector);
if (modal && !modal.hidden && modal.offsetParent !== null) {
targetModal = modal;
this.log(`检测到答题弹窗: ${selector}`);
break;
}
}
if (!targetModal) return;
const optionSelectors = [
'input[type="radio"]',
'input[type="checkbox"]',
'.option-item',
'.answer-option',
'.choice-item',
'[class*="option"]',
'[class*="choice"]'
];
let optionSelected = false;
for (const selector of optionSelectors) {
const options = targetModal.querySelectorAll(selector);
if (options.length > 0) {
for (let i = 0; i < Math.min(2, options.length); i++) {
options[i].click();
}
this.log('已选择答案选项');
optionSelected = true;
break;
}
}
if (optionSelected) {
setTimeout(() => {
const submitSelectors = [
'.submit-btn',
'.confirm-btn',
'.btn-submit',
'.btn-confirm',
'button:contains("提交")',
'button:contains("确定")',
'[class*="submit"]',
'[class*="confirm"]'
];
for (const selector of submitSelectors) {
const btn = targetModal.querySelector(selector);
if (btn) {
btn.click();
this.log('已提交答案');
break;
}
}
}, 1200);
}
}
goToNextLesson() {
if (!this.config.autoNext) return;
const video = this.getVideoElement();
if (!video || !video.ended) return;
this.log('课程播放完毕,准备跳转下一课');
const nextBtnSelectors = [
'.next-lesson',
'.next-chapter',
'.btn-next',
'.next-btn',
'.chapter-next',
'a[title*="下一课"]',
'a[title*="下一讲"]',
'[class*="next"]'
];
for (const selector of nextBtnSelectors) {
const btn = document.querySelector(selector);
if (btn && btn.offsetParent !== null) {
btn.click();
this.log('已点击下一课按钮');
break;
}
}
}
simulateActivity() {
if (!this.config.simulateActivity) return;
const x = Math.random() * window.innerWidth;
const y = Math.random() * window.innerHeight;
const mouseEvent = new MouseEvent('mousemove', {
view: window,
bubbles: true,
cancelable: true,
clientX: x,
clientY: y
});
document.dispatchEvent(mouseEvent);
const keyEvent = new KeyboardEvent('keydown', {
key: 'Shift',
bubbles: true
});
document.dispatchEvent(keyEvent);
if (Math.random() > 0.7) {
window.scrollBy(0, Math.random() > 0.5 ? 10 : -10);
}
this.log('已模拟用户活动');
}
mainLoop() {
const video = this.getVideoElement();
if (video) {
this.setupVideo(video);
this.playVideo(video);
this.goToNextLesson();
}
this.handleQuiz();
}
}
new ChinaAccHelper();