Greasy Fork

Greasy Fork is available in English.

三亚学院新教务评教

借鉴了南昌航空大学教务处一键评教

当前为 2021-05-17 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         三亚学院新教务评教
// @namespace    http://tampermonkey.net/
// @version      0.3
// @author       初七
// @description  借鉴了南昌航空大学教务处一键评教
// @include      http://jwxt.sanyau.edu.cn/syxy_jsxsd/xspj/xspj_list.do*
// @include      http://jwxt.sanyau.edu.cn/syxy_jsxsd/xspj/xspj_edit_syxy.do*
// @grant        unsafeWindow
// @grant        window
// @reqire       http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js

// ==/UserScript==

(function() {
var markPosition=1
var flag1=0;
var href=document.location.href;
if(href.search('jwxt.sanyau.edu.cn/syxy_jsxsd/xspj/xspj_list.do')!=-1){//判断是否为加载网页
    hook();
    addBtn()
}else {
    remark();
}
function hook() {
    unsafeWindow.JsMod = function (htmlurl, tmpWidth, tmpHeight) {
        htmlurl = getRandomUrl(htmlurl);
        var newwin = window.open(htmlurl, window, "dialogWidth:" + tmpWidth + "px;status:no;dialogHeight:" + tmpHeight + "px")
        if (newwin == "refresh" || newwin == "ok") {
            if (getOs() == "chrome") {
                alert(getOs());
                window.location.reload();// 谷歌浏览器要用此方法刷新
            } else {
                window.location.reload()
                //window.location.href = window.location.href;
            }
        }

    }
}
function remarkAll() {
        $('#dataList a').each(function (index) {
            var a = $('#dataList a')[index]
            a.click()
        })
}
function remark() {
    //hookRemark();
    //hookAlert()
    //执行评分
   var length=$("input[type='radio']").length;
    $("input[type='radio']").each(function (index) {
        //if(length-1-index<4){
            var position=3;
            if((length-1)-index==position){
                $(this).attr('checked','checked')
            }
        /*}else*/ if(index%5==0){
            $(this).attr('checked','checked')
        }
    })
    $('textarea').val('老师的课很好听');
    document.getElementById("issubmit").value = "1";
    $.ajax({
        async: false,
        type: "POST",
        url:'/syxy_jsxsd/xspj/xspj_save_syxy.do',
        contentType : "application/x-www-form-urlencoded; charset=utf-8",
        data:$("#Form1").serialize(),
        success: function () {
            window.close()
        },
        error: function () {
            alert('error')
        }
    })
}
function addBtn() {
    var btn="<input type=\"button\" id=\"btnRemarkAll\" value=\"一键评分\"  class=\"button\" style='margin-left:20px'>"
    $('#dataList a').attr("target", "_blank")
    $('#btnShenshen').after(btn);
    $('#btnRemarkAll').click(function () {
        var isConfirm=confirm('是否一键评分')
        if(isConfirm){
            remarkAll();
        }else{
            return;
        }
    })
}




})();