Greasy Fork

Greasy Fork is available in English.

南大教务网默认好评

快速完成教务网的教学评价,增加默认选项

目前为 2020-06-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         南大教务网默认好评
// @namespace    
// @version      0.1
// @description  快速完成教务网的教学评价,增加默认选项
// @author       LadderOperator
// @include      *://elite.nju.edu.cn/jiaowu/student/evalcourse/courseEval.do?method=currentEvalCourse
// @grant        none
// ==/UserScript==

var getAll
var getMulRadioe
var getQuesRadio
var stateCheck = true

setInterval(fillForm, 100);

function fillForm(e) {
  stateCheck = true
  getAll = document.querySelectorAll("#tbEvalItem form input[type^='radio']")
  getAll.forEach(function(e){
    if (e.checked === true){
      stateCheck = false
    }
  })

  if (stateCheck === true){

    getQuesRadio = document.querySelectorAll("#tbEvalItem form input[name^='ques'][value^='5']")
    getMulRadio = document.querySelectorAll("#tbEvalItem form input[name^='mul'][value^='0']")
    
    getQuesRadio.forEach(function(f){
      f.checked = true
    })
    
    getMulRadio.forEach(function(f){
      f.checked = true
    })

  }



}