2. 在控制台运行以下脚本:
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;
break;
}
} else {
if (tempValue == '优秀') {
ops[j].selected = true;
break;
}
}
}
}
var textarea = innerDoc.getElementById("pjxx");
textarea.value = "老师教学认真负责,讲课条理清晰,举例充分恰当";
var btn_save = innerDoc.getElementById('Button1');
btn_save.click();
注意:
- 如果你的评教系统的下拉列表为‘A’、‘B’、‘C’等,请修改上面的‘优秀’、‘良好’为‘A’、‘B’、‘C’。
- 未测试一门课程多位老师的情况
- 目前需要手动选择每一门课程,然后执行以上脚本