Greasy Fork

Greasy Fork is available in English.

中国大学慕课mook评价脚本

自动评价mook上同学的互评以及自评

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         中国大学慕课mook评价脚本
// @namespace    lwsy
// @version      1.9.12
// @description 自动评价mook上同学的互评以及自评
// @author       菁华如梦
// @match        https://www.icourse163.org/learn/*
// @match        http://www.icourse163.org/learn/*
// @match        http://www.icourse163.org/spoc/learn/*
// @match        https://www.icourse163.org/spoc/learn/*
// @grant        unsafewindow
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @run-at       document-start
// ==/UserScript==
(function() {
    'use strict';
    var button = document.createElement('div');
    document.body.appendChild(button);
    button.setAttribute('style','position:fixed;right:120px;bottom:120px;font-family: inherit;display: inline-block;line-height: 1;white-space: nowrap;cursor: pointer;background: #fff;border: 1px solid #dcdfe6;color: #606266;text-align: center;box-sizing: border-box;outline: none;margin: 0;font-weight: 500;padding: 12px 20px;font-size: 14px;border-radius: 4px;');
    button.innerText='自动评价';
    button.onclick = function(){
        console.log('click')
        var setPointAll=document.querySelectorAll('.detail .s');
        for(var i=0;i<setPointAll.length;i++){
            var child=setPointAll[i].children;
            console.log(child,setPointAll[i])
            child[getRandom(child.length - 3,child.length - 1)].firstElementChild.setAttribute('checked',true)
        }
        var visible=document.getElementsByClassName('answerVisible');
        for(i=0;i<visible.length;i++){
            visible[i].firstElementChild.setAttribute('checked',false)
        }
        var input=document.querySelectorAll('.j-textarea.inputtxt');
        var EVALUATES=['写的好','同学需要继续努力','写的不错','很好']
        for(i=0;i<input.length;i++){
            input[i].value=EVALUATES[getRandom(0,EVALUATES.length-1)]
        }
        var checkbox=document.querySelectorAll('.av .j-acb');
        for(i=0;i<checkbox.length;i++){
            checkbox[i].checked=false;
        }
        scroll(0,document.body.scrollHeight)
    }
    function getRandom(min,max){
        return Math.round(Math.random()*(max-min))+min
    }
    // Your code here...
})();