《首先介绍大家都熟悉的JS版本》
1.拖动右边的链接到浏览器书签栏或添加到书签:一键评教脚本
2.打开教务管理系统的评教页面,进入第一个要评教的老师页面。
3.点击书签栏的“一键评教脚本”,自动评教完毕并跳到下一个老师的评教页面。再次点击,以此类推。
4.所有教师评教完毕后,点击提交。
假如你有6个老师要评教,你只需要点击鼠标7下就完成评教了。妈妈再也不用担心我期末不能录入和查看成绩了!
《PHP版本》
先讲一下原理,在xs_main.aspx获取所有评教的地址,然后用foreach循环一个个的打开,然后检测其项目的个数进行逐个赋值(就是普通界面的选择优秀),把值post回给教务系统,完成保存操作,最后一次保存以后再改一下post的数值,让PHP做完就提交。//前面如何登陆我就不写了
$ch=curl_init("http://jw.luas.edu.cn/xs_main.aspx?xh={$jwid}");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
//curl_setopt ($ch, CURLOPT_HTTPHEADER , $headerArr );
curl_setopt($ch,CURLOPT_REFERER,"http://jw.luas.edu.cn/default2.aspx");
curl_setopt($ch,CURLOPT_COOKIE,$cookies);
$str1=curl_exec($ch);
$info=curl_getinfo($ch);
curl_close($ch);
$pattern = '/xkkh=(.*?)&xh=/i';
preg_match_all($pattern, $str1, $matches);
if(empty($matches[1]))
{
return "你没有需要评教的课程";
}
$i=1;
foreach($matches[1] as $fk){
$ch=curl_init("http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
//curl_setopt($ch, CURLOPT_TIMEOUT,60);
//curl_setopt ($ch, CURLOPT_HTTPHEADER , $headerArr );
curl_setopt($ch,CURLOPT_REFERER,"http://jw.luas.edu.cn/xs_main.aspx?xh={$jwid}");
curl_setopt($ch,CURLOPT_COOKIE,$cookies);
$str2=curl_exec($ch);
$info=curl_getinfo($ch);
curl_close($ch);
$pattern = '//i';
preg_match($pattern, $str2, $matcheaaas);
$view1 = urlencode($matcheaaas[1]);
$pattern = '/
preg_match_all($pattern, $str2, $matcheaafas);
$lianghao=iconv('UTF-8', 'GB2312', '良好');
$youxiu=iconv('UTF-8', 'GB2312', '优秀');
$all="";
foreach($matcheaafas[1] as $num){
$all .="&DataGrid1%3A".urlencode($num)."=".urlencode($youxiu);
}
$all=substr($all,0,-12).urlencode($lianghao);
if($i
$alldata="__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=".$view1.$all."&pjkc=".urlencode($fk)."&pjxx=&txt1=&TextBox1=0&Button1=%B1%A3++%B4%E6";
$ch=curl_init("http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}&gnmkdm=N12141");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch,CUPLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36");
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt ($ch, CURLOPT_HTTPHEADER , $headerArr );
curl_setopt($ch,CURLOPT_REFERER,"http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}&gnmkdm=N12141");
curl_setopt($ch, CURLOPT_POSTFIELDS, $alldata);
curl_setopt($ch,CURLOPT_COOKIE,$cookies);
$str2=curl_exec($ch);
$info=curl_getinfo($ch);
curl_close($ch);
}else{
$alldata="__VIEWSTATE=".$view1.$all."&pjkc=".urlencode($fk)."&TextBox1=0&Button1=%B1%A3++%B4%E6";
$ch=curl_init("http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt ($ch, CURLOPT_HTTPHEADER , $headerArr );
curl_setopt($ch,CURLOPT_REFERER,"http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}");
curl_setopt($ch, CURLOPT_POSTFIELDS, $alldata);
curl_setopt($ch,CURLOPT_COOKIE,$cookies);
$str2=curl_exec($ch);
$info=curl_getinfo($ch);
curl_close($ch);
$alldata="__VIEWSTATE=".$view1.$all."&pjkc=".urlencode($fk)."&TextBox1=0&Button2=+%CC%E1++%BD%BB+";
$ch=curl_init("http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT,60);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt ($ch, CURLOPT_HTTPHEADER , $headerArr );
curl_setopt($ch,CURLOPT_REFERER,"http://jw.luas.edu.cn/xsjxpj.aspx?xkkh={$fk}&xh={$jwid}");
curl_setopt($ch, CURLOPT_POSTFIELDS, $alldata);
curl_setopt($ch,CURLOPT_COOKIE,$cookies);
$str2=curl_exec($ch);
$info=curl_getinfo($ch);
curl_close($ch);
}
$i++;
}