您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
排除通选学分的绩点计算
当前为
// ==UserScript== // @name cug教务系统学分计算器 // @namespace http://202.114.207.126/jwglxt/xsxy/ // @version 1.1 // @description 排除通选学分的绩点计算 // @author Chunibyo // @match http://202.114.207.126/jwglxt/xsxy/* // @grant none // ==/UserScript== jQuery(function($){ 'use strict'; $(function () { // 总的学分和sum(credit * grade) let sum_gained_credit = 0 let sum_credit = 0 let tmp1, tmp2 // 第一栏的课程 $("div.position_r > ul.treeview > li:first li tbody > tr").each(function (index, item) { if (($(item).find("td:first > div").hasClass("tjxk4")) === true) { tmp1 = parseFloat($(item).find("td[name = 'xf']").html()) // 这门课的学分 tmp2 = parseFloat($(item).find("td:nth-child(12)").html()) if (isNaN(tmp1) || isNaN(tmp2)) tmp1 = 0, tmp2 = 0 sum_credit += tmp1 // 选课的总学分 sum_gained_credit += tmp1 * tmp2 // 获得的总学分 } }) // 展示 let str1 = '<font size="2px">除去通选的学分绩点:<font size="2px" style="color: red;">' + (sum_gained_credit / sum_credit).toFixed(3) + '</font></font>' $("#alertBox br:first").after(str1) // 其他课程(第二栏) $("#kcxxqtkcxfyq tbody > tr").each(function (index, item) { tmp1 = parseFloat($(item).find("td[name = 'xf']").html()) // 这门课的学分 tmp2 = parseFloat($(item).find("td:nth-child(12)").html()) if (isNaN(tmp1) || isNaN(tmp2)) tmp1 = 0, tmp2 = 0 sum_credit += tmp1 // 选课的总学分 sum_gained_credit += tmp1 * tmp2 // 获得的总学分 }) // 展示 let str2 = '<font size="2px"> 供各位校验的计算了通选的GPA:<font size="2px" style="color: red;">' + (sum_gained_credit / sum_credit).toFixed(3) + '</font></font><br>' $("#alertBox > font:nth-child(4)").after(str2) }) });