方正教务系统一键完成教师评价
var iframe = document.getElementById('iframeautoheight'); var innerDoc = iframe.contentDocument || iframe.contentWindow.document; var selects = innerDoc.getElementsByTagName('select'); var scorelist = []; // 找到下拉菜单列表 for (var i = 0; i < selects.length; i++) { if (selects[i].id.indexOf("DataGrid1__") > -1) { scorelist.push(selects[i]); } } //产生随机数 var rid = Math.floor(Math.random() * scorelist.length); // 选取下拉菜单项 for (var i = 0; i < scorelist.length; i++) { var ops = scorelist[i].options; for (var j = 0; j < ops.length; j++) { var tempValue = ops[j].value; if (i == rid) { if (tempValue == '较好') { ops[j].selected = true; } } else { if (tempValue == '很好') { ops[j].selected = true; } } } } var btn_save = innerDoc.getElementById('Button1'); btn_save.click();
打开教务系统,按F12键打开控制台,点击Console,把代码复制粘贴进去即可!