教务系统自动评教_PHP版正方教务系统一键评教(已修改BUG)

本文介绍了使用PHP编写的一键自动评教脚本,通过正方教务系统获取评教地址,利用curl模拟登录和POST数据,实现逐个教师的评教,并在最后提交评价。只需简单操作,即可快速完成教务系统评教任务。
摘要由CSDN通过智能技术生成

《首先介绍大家都熟悉的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++;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值