index_section.php 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366
  1. <style>
  2. /*切换选择*/
  3. .tab-con{
  4. position: relative;
  5. height: 30px;
  6. width: 200px;
  7. background: #F2F2F2;
  8. border: 1px solid #01B677;
  9. border-radius: 15px;
  10. }
  11. .sel-opt{
  12. width: 50%;
  13. position: relative;
  14. color: #01B677;
  15. line-height: 30px;
  16. text-indent: 6px;
  17. cursor: pointer;
  18. }
  19. .sel-opt:after{
  20. content: '';
  21. border-left: 6px solid transparent;
  22. border-right: 6px solid transparent;
  23. border-top: 8px solid #01B677;
  24. position: absolute;
  25. right: 12px;
  26. top: 12px;
  27. }
  28. .xdsoft_datetimepicker{
  29. z-index:99999999!important;
  30. }
  31. // .sel-opt select{
  32. // width: 100%;
  33. // height: 30px;
  34. // background: #F2F2F2;
  35. // color: #01B677;
  36. // text-indent: 6px;
  37. // font-size: inherit;
  38. // border-top-right-radius: 15px;
  39. // border-bottom-right-radius: 15px;
  40. // cursor: pointer;
  41. // }
  42. // .sel-opt select option{
  43. // position: relative;
  44. // }
  45. .points{
  46. position: absolute;
  47. top: -2px;
  48. right: 0;
  49. width: 10px;
  50. height: 10px;
  51. background: #F01516;
  52. border-radius: 50%;
  53. }
  54. .sel-cons{
  55. border: 1px solid #01B677;
  56. width: 50%;
  57. position: absolute;
  58. right: 0;
  59. top: 30px;
  60. text-indent: 10px;
  61. display: none;
  62. }
  63. .sc-lis{
  64. line-height: 30px;
  65. cursor: pointer;
  66. }
  67. .sc-lis span{
  68. position: relative;
  69. }
  70. .sc-lis .points{
  71. top: 2px;
  72. right: -16px;
  73. }
  74. .click-sc:focus {
  75. color: #fff;
  76. }
  77. .click-sc:hover {
  78. color: #fff;
  79. }
  80. .create-third{
  81. position: absolute;
  82. right: 6px;
  83. top: 10px;
  84. }
  85. .tab-con-btn{
  86. height: 31px;
  87. width: 210px;
  88. background: #F2F2F2;
  89. border: 1px solid #01B677;
  90. border-radius: 15px;
  91. display: inline-block;
  92. text-align: center;
  93. }
  94. .tab_btn{
  95. display: inline-block;
  96. width:100px;
  97. padding: 0;
  98. border: 0;
  99. outline:none;
  100. margin:0;
  101. background: #F2F2F2;
  102. border-radius: inherit;
  103. }
  104. .has-sel{
  105. background: #01B677;
  106. color: #fff;
  107. width: 50%;
  108. height: 30px;
  109. border-top-left-radius: 15px;
  110. border-bottom-left-radius: 15px;
  111. text-align: center;
  112. line-height: 30px;
  113. }
  114. .has-sel-1{
  115. background: #01B677;
  116. color: #fff;
  117. width: 50%;
  118. height: 30px;
  119. border-top-right-radius: 15px;
  120. border-bottom-right-radius: 15px;
  121. text-align: center;
  122. line-height: 30px;
  123. }
  124. .layer-upload{padding:10px 20px; display:none;}
  125. .layer-upload p{line-height:20px;color:#aaa;}
  126. .upload-btn{color:#76c289}
  127. .layer-upload ul{padding:10px;line-height:30px; border:1px solid #ccc;}
  128. .layer-upload li{border-bottom:1px solid #ccc;}
  129. .layer-upload li span{width:40%;}
  130. .layer-upload li em{width:20%;font-size:26px;text-align:center;cursor:pointer}
  131. .tooltip {
  132. position: absolute;
  133. display: none;
  134. z-index: 9900000;
  135. outline: none;
  136. padding: 5px;
  137. border-width: 1px;
  138. border-style: solid;
  139. border-radius: 5px;
  140. -moz-border-radius: 5px 5px 5px 5px;
  141. -webkit-border-radius: 5px 5px 5px 5px;
  142. border-radius: 5px 5px 5px 5px;
  143. }
  144. .table-hover>tbody>tr:hover {
  145. background-color: #E6F1EC
  146. }
  147. .selectSendType{width:180px;height:100px;border:1px solid #ccc;display: inline-block;text-align: center;line-height: 100px;cursor:pointer;border-radius:5px;}
  148. .selected{background:#aaa; }
  149. </style>
  150. <script src="/js/jquery.datetimepicker.js"></script>
  151. <link rel="stylesheet" href="/css/jquery.datetimepicker.css" />
  152. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  153. <link rel="stylesheet" href="/css/alert.css"/>
  154. <link rel="stylesheet" href="/fonts/shangchuan/iconfont.css" />
  155. <script language="javascript" src="<?php echo Yii::app()->params['static_url_js']; ?>/js/MaskUtil.js?<?php echo Yii::app()->params['static_version']; ?>"></script>
  156. <div class="main-content-inner">
  157. <!-- 导航栏开始-->
  158. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  159. <!-- 导航栏结束-->
  160. <div class="page-content">
  161. <div class="row" style="margin:0px;">
  162. <div class="col-xs-12">
  163. <!-- PAGE CONTENT BEGINS -->
  164. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  165. <div class="row">
  166. <form method="get" id="form1" action="<?php echo $this->createUrl("third/index");?>">
  167. <div class="col-xs-12">
  168. <div class="dataTables_length margin-zy">
  169. <div class="tab-con-btn">
  170. <?php
  171. if(isset($list_type) && $list_type==1):
  172. ?>
  173. <button class="tab_btn " >阅卷试卷</button>
  174. <button class="tab_btn has-sel-1" >导入成绩试卷</button>
  175. <?php
  176. else:
  177. ?>
  178. <button class="tab_btn has-sel" >阅卷试卷</button>
  179. <button class="tab_btn " >导入成绩试卷</button>
  180. <?php
  181. endif;
  182. ?>
  183. </div>
  184. <input type="hidden" name="list_type" value="<?php if(isset($list_type)){echo $list_type;}else{echo 0;}?>" />
  185. <input type="hidden" name="type" value="<?php echo $printType;?>" />
  186. <input type="checkbox" name="display" style="margin: -1px 2px 0 0;display:inline-block;vertical-align: middle;width:15px;height:15px;" value="1" <?php if($display === '1') echo "checked";?>>显示隐藏试卷
  187. <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41,42)))
  188. {
  189. ?>
  190. <select class="form-control" id="labelled" name="labelled">
  191. <option value="">标注状态</option>
  192. <option value="0" <?php if($labelled === '0') echo "selected";?> >未发送</option>
  193. <option value="2" <?php if($labelled == 2) echo "selected";?> >已发送</option>
  194. <option value="1" <?php if($labelled == 1) echo "selected";?>>已标注</option>
  195. <option value="3" <?php if($labelled === 3) echo "selected";?> >标注中</option>
  196. <option value="4" <?php if($labelled == 4) echo "selected";?> >已取消</option>
  197. <option value="5" <?php if($labelled == 5) echo "selected";?>>补题中</option>
  198. </select>
  199. <?php } ?>
  200. <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
  201. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  202. </div>
  203. </div>
  204. </form>
  205. <button class="label-primary-s bth-s create-third" data-button="red">创建试卷</button>
  206. </div>
  207. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  208. <thead>
  209. <tr>
  210. <th>名称</th>
  211. <th>创建日期</th>
  212. <th>考试日期</th>
  213. <th>是否创建答题卡</th>
  214. <th>选择题量</th>
  215. <th>填空题量</th>
  216. <th>解答题量</th>
  217. <th>选做题量</th>
  218. <th>阅卷方式</th>
  219. <th>主阅老师</th>
  220. <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41))): ?>
  221. <th >状态</th>
  222. <?php endif;?>
  223. <th >操作</th>
  224. </tr>
  225. </thead>
  226. <tbody>
  227. <?php if(!empty($printList)):foreach($printList as $cl):?>
  228. <tr>
  229. <td style="max-width:260px">
  230. <?php
  231. if($cl['is_new']==0)
  232. {
  233. echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
  234. }
  235. if($cl['homework']==1)
  236. {
  237. echo "<span style='color: #fff;font-weight: bold;display:inline-block;background: #337ab7;padding:0 5px;'> 作业 </span>";
  238. }
  239. ?>
  240. <a href="<?php echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id'],'is_third'=>1))?>"><?php echo $cl['exam_name'];?></a>
  241. </td>
  242. <td><?php if(!empty($cl['create_time'])){ echo date('Y-m-d',$cl['create_time']);}?></td>
  243. <td><?php if(!empty($cl['examDate'])){ echo date('Y-m-d',$cl['examDate']);}?></td>
  244. <td>
  245. <?php
  246. if(isset($exam_sheets[$cl['exam_group_id']]) ){
  247. echo '已创建';
  248. if($exam_sheets[$cl['exam_group_id']]==1){
  249. echo '(在线答题卡)';
  250. }
  251. }else{
  252. echo "未创建";
  253. }
  254. ?>
  255. </td>
  256. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  257. echo $sheet_rs[$cl['exam_group_id']]->ke_topic_num;
  258. }else{echo 0;}?></td>
  259. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  260. echo $sheet_rs[$cl['exam_group_id']]->tian_topic_num;
  261. }else{echo 0;}?></td>
  262. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  263. echo $sheet_rs[$cl['exam_group_id']]->zu_topic_num;
  264. }else{echo 0;}?></td>
  265. <td><?php if(isset($sheet_rs[$cl['exam_group_id']]) && !empty($sheet_rs[$cl['exam_group_id']])){
  266. echo $sheet_rs[$cl['exam_group_id']]->xuan_topic_num;
  267. }else{echo 0;}?></td>
  268. <td>
  269. <?php
  270. $txt='';
  271. if($cl['import_score_type']>0){
  272. $txt='导入成绩';
  273. }elseif ($cl['mark_type'] == 0) {
  274. $txt='线下阅卷';
  275. }elseif($cl['mark_type'] == 4){
  276. $txt='班级单独阅卷';
  277. }elseif($cl['mark_type']==3){
  278. $txt='混合阅卷';
  279. }
  280. if ($cl['upload_status'] > 0 || $cl['homework']==1 || $cl['import_score_type']) {
  281. echo $txt;
  282. }else{
  283. echo '<a href="javascript::void()" class="maskType" is_show="' . $cl['upload_status'] . '" examId="' . $cl["exam_group_id"] . '" tpl_index="' . $cl["tpl_index"] . '" mark_type="' . $cl["mark_type"] . '" >'.$txt.'</a>';
  284. }
  285. ?>
  286. </td>
  287. <td><?php if($teachers && isset($teachers[$cl['teacher_id']])){ echo $teachers[$cl['teacher_id']];}else{echo "";}?></td>
  288. <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41)))
  289. {
  290. ?>
  291. <td>
  292. <?php if($cl['is_answersheet']==1){
  293. if($cl["is_labelled"] == 1){
  294. echo "<span style='color:green;font-weight:normal;'>已标注</span>";
  295. }else if($cl["is_labelled"] == 2 ){
  296. echo "<span style='color:orange;font-weight:normal;'>已发送</span>";
  297. }else if($cl["is_labelled"] == 3 ){
  298. echo "<span style='color:orange;font-weight:normal;'>标注中</span>";
  299. }else if($cl["is_labelled"] == 4 ){
  300. echo "<span style='color:orange;font-weight:normal;'>已取消</span>";
  301. }else if($cl["is_labelled"] == 5){
  302. echo "<span style='color:orange;font-weight:normal;'>补题中</span>";
  303. }
  304. if($cl["is_labelled"] == 0 && $cl['tw_status']==2){?>
  305. <span class="iconfont click-sc addbx sendLabelTask" isAnswerSheet="1" type="send" examId="<?php echo $cl["exam_id"];?>" examName="<?php echo $cl["exam_name"];?>" subjectId="<?php echo $cl["subject_id"];?>" createTime="<?php echo $cl["examDate"];?>" aria-hidden="true" title="发送试题标注">&#xe71f;</span>
  306. <?php }elseif($cl['is_labelled']==4){?>
  307. <span class="iconfont click-sc addbx sendLabelTask"
  308. examId="<?php echo $cl["exam_id"];?>"
  309. examName="<?php echo $cl["exam_name"];?>"
  310. subjectId="<?php echo $cl["subject_id"];?>"
  311. createTime="<?php echo $cl["create_time"];?>"
  312. status = '2'
  313. <?php
  314. if (isset($exam_sheets[$cl['exam_group_id']]) ) {
  315. echo ' isAnswerSheet=1 ';
  316. }else{
  317. echo ' isAnswerSheet=0 ';
  318. }
  319. ?>
  320. type="resend"
  321. aria-hidden="true" title="重新发送">&#xe71f;</span>
  322. <?php }elseif($cl['is_labelled']==2 || $cl['is_labelled']==3){
  323. ?>
  324. <span class="iconfont click-sc addbx sendLabelTask" isAnswerSheet="1" status="4" type="cancel" examId="<?php echo $cl["exam_id"];?>" examName="<?php echo $cl["exam_name"];?>" subjectId="<?php echo $cl["subject_id"];?>" createTime="<?php echo $cl["examDate"];?>" aria-hidden="true" title="取消试题标注"><i class="fa fa-reply"></i></span>
  325. <?php
  326. }
  327. }else{
  328. if($cl['tw_status']==2){
  329. echo "<span style='color:orange;font-weight:normal;'>解析成功</span>";
  330. }elseif($cl['tw_status']==3){
  331. ?>
  332. <a style='color:orange;font-weight:normal;cursor:pointer' title="<?php echo $cl['wrong_reason'] ?>">解析失败</a>
  333. <?php
  334. }elseif($cl['word_path']){
  335. echo "<span style='color:orange;font-weight:normal;'>等待解析</span>";
  336. }else{
  337. echo "<span style='color:orange;font-weight:normal;'>未上传</span>";
  338. }
  339. }?>
  340. </td>
  341. <?php }else{
  342. // $examStatus = array(0=>'未上传',1=>'答案未上传',3=>'题目未上传',4=>'已上传');
  343. // if(isset($examStatus[$cl['uploadExamStatus']])){
  344. // $_status = $cl['uploadExamStatus'];
  345. // if($_status == 4){
  346. // echo '<td>'.$examStatus[$cl['uploadExamStatus']].'</td>';
  347. // }else{
  348. // echo '<td style="color:red">'.$examStatus[$cl['uploadExamStatus']].'</td>';
  349. // }
  350. // }else{
  351. // echo '<td></td>';
  352. // }
  353. } ?>
  354. <td style="width:300px;">
  355. <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('third/exam_list',array('exam_group_id'=>$cl['exam_group_id'],'branch'=>$cl['branch'],'grade'=>$class_grade[$cl['class_id']],'upload_status'=>$cl['upload_status']));?>'">&#xe668;</span>
  356. <?php if($cl['homework']==0):?>
  357. <a class="iconfont click-sc addbx create_sheet_subject" aria-hidden="true" tw_status="<?php echo $cl['tw_status']?>" labelled="<?php echo $cl['is_labelled']?>" title="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo '修改关联答题卡';}else{echo "关联答题卡";}?>" mark_type="<?php echo $cl['mark_type'];?>" exam_group_id="<?php echo $cl['exam_group_id']?>" sheet_id ="<?php if(isset($exam_sheets[$cl['exam_group_id']]) && !empty($exam_sheets[$cl['exam_group_id']])){ echo $exam_sheets[$cl['exam_group_id']];}else{echo 0;}?>">&#xe804;</a>
  358. <?php if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(41))): ?>
  359. <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷" onclick="uploadTemplate('<?php echo $cl['exam_group_id'];?>','<?php echo $cl['exam_name'];?>')">&#xe640;</span>
  360. <?php elseif($exportExam):?>
  361. <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷题目" onclick="uploadExamTopic('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php if(isset($cl['uploadExamTemplateId'])){ echo $cl['uploadExamTemplateId']; }else{ echo 0;}?>,<?php echo $cl['tpl_index'];?>)">&#xe640;</span>
  362. <span class="iconfont click-sc addbx" aria-hidden="true" title="上传试卷答案" onclick="uploadExamAnswer('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php if(isset($cl['uploadAnswerTemplateId'])){ echo $cl['uploadAnswerTemplateId']; }else{ echo 0;}?>)">答</span>
  363. <?php endif;?>
  364. <?php if( $cl['is_scan_changed'] != 1 && $cl['homework']==0 && isset($exam_sheets[$cl['exam_group_id']])):?>
  365. <?php if($exam_sheets[$cl['exam_group_id']]==1):?>
  366. <span class="iconfont" aria-hidden="true" title="扫描在线答题卡" onclick="createTemplateScanOnline('<?php echo $cl['exam_group_id'];?>',this,'<?php echo $cl['exam_name']; ?>',<?php echo $cl['import_score_type'];?>)"><img src="/images/online_scan.svg"></span>
  367. <?php else:?>
  368. <span class="iconfont click-sc addbx" aria-hidden="true" title="扫描答题卡" onclick="createTemplateSubject('<?php echo $cl['exam_group_id'];?>',<?php echo Yii::app()->session['session_duoxueke_subject_id']?>,<?php echo $cl['import_score_type'];?>)">扫</span>
  369. <?php endif;?>
  370. <?php endif;?>
  371. <?php if($cl['is_display'] == 1):?>
  372. <span class="iconfont click-sc click-tc addbx" aria-hidden="true" title="恢复试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',0)">&#xe68f;</span>
  373. <?php else:?>
  374. <span class="iconfont click-sc click-delete addbx" aria-hidden="true" title="隐藏试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',1)">&#xe68b;</span>
  375. <?php endif;?>
  376. <a href="<?php echo $this->createUrl("third/modifyThirdExam",array('exam_group_id'=>$cl['exam_group_id']));?>" class="iconfont click-sc addbx" aria-hidden="true" title="编辑考试信息" >编</a>
  377. <?php endif;?>
  378. <?php if($exportExam && $cl['is_feedback']==1):?>
  379. <span class="iconfont click-sc addbx exam_export" eid="<?php echo $cl['exam_group_id'] ?>" aria-hidden="true" title="导出考试数据" >导出</span>
  380. <?php endif;?>
  381. </td>
  382. </tr>
  383. <?php endforeach;else:?>
  384. <tr><td colspan="10">暂无数据!</td></tr>
  385. <?php endif;?>
  386. </tbody>
  387. </table>
  388. <?php if(!empty($page_total)):?>
  389. <div class="row">
  390. <div class="col-xs-6">
  391. &nbsp;
  392. </div>
  393. <div class="col-xs-6">
  394. <div class="dataTables_paginate paging_simple_numbers">
  395. <?php
  396. $this->widget('CLinkPager', array(
  397. 'header' => '',
  398. 'firstPageLabel'=> '首页',
  399. 'lastPageLabel' => '末页',
  400. 'prevPageLabel' => '上一页',
  401. 'nextPageLabel' => '下一页',
  402. 'pages' => $pages,
  403. 'maxButtonCount'=> 5,
  404. ));
  405. echo '共:'.$page_total.'条';
  406. ?>
  407. </div>
  408. </div>
  409. </div>
  410. <?php endif;?>
  411. </div>
  412. <!--上传模板弹窗-->
  413. <!-- PAGE CONTENT ENDS -->
  414. </div>
  415. </div>
  416. </div>
  417. </div>
  418. <!-- 复用考试列表弹窗 -->
  419. <div class="confirmbox-mask" style="display:none ;" id="fieldModalStudent">
  420. <div class="class-modal" style="padding: 0;height:580px;width:800px;">
  421. <div class="class-modal-head" style="background-color: #2977ff;color: white;height: 30px;font-size: 16px;font-weight: initial;"><span style="float: left;padding: 5px;">复用试卷</span><span class="student-list-close" style="float: right;padding: 5px;cursor: pointer;">X</span></div>
  422. <form id="examSelect">
  423. <div class="" style="height:520px;padding:10px;">
  424. <div class="class_area" id="class_area">
  425. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer student-list" style="font-size:12px">
  426. <thead>
  427. <tr>
  428. <th>名称</th>
  429. <th>创建时期</th>
  430. <th>考试日期</th>
  431. <th>操作</th>
  432. </tr>
  433. </thead>
  434. <tbody>
  435. <tr><td colspan="8">暂无数据</td></tr>
  436. </tbody>
  437. </table>
  438. <div class="row">
  439. <div class="col-xs-6">
  440. <div class="dataTables_paginate paging_simple_numbers student_list_page">
  441. </div>
  442. </div>
  443. </div>
  444. </div>
  445. </div>
  446. </form>
  447. </div>
  448. </div>
  449. <script src="/js/jquery.ajaxfileupload.js"></script>
  450. <script type="text/javascript">
  451. $(document).ready(function(){
  452. /*var str = '<div class="points"></div>';
  453. $(".sc-lis").each(function(){
  454. if($(this).find(".points").length>0){
  455. $(".sel-opt").append(str);
  456. }
  457. });*/
  458. $('body').on('click','.selectSendType',function(){
  459. $('.selectSendType').removeClass('selected');
  460. $('input[name=sendType]').val($(this).index());
  461. $(this).addClass('selected');
  462. })
  463. $(".layshow-btn").click(function(){
  464. var isAnswerSheet = $(this).attr("isAnswerSheet");
  465. var examGroupId = $(this).attr("examGroupId");
  466. if(isAnswerSheet != 1){
  467. layer.msg('尚未创建答题卡,请创建');
  468. return false;
  469. }
  470. $('.english_paper_id').val(examGroupId);
  471. layer.open({
  472. type: 1,
  473. title: '上传试卷',
  474. btn:['发送标注'],
  475. area: ['560px', '350px'], //宽高
  476. content: $(".layer-upload"),
  477. yes:function(index){
  478. sendPaperAndAnswer(examGroupId);
  479. layer.close(index);
  480. },
  481. });
  482. })
  483. $(".sel-opt,.sel-cons").mouseover(function(){
  484. $(".sel-cons").show();
  485. }).mouseout(function(){
  486. $(".sel-cons").hide();
  487. });
  488. $(".sc-lis").click(function(){
  489. var data = {
  490. subjectId : $(this).attr('val')
  491. };
  492. $.post("<?php echo Yii::app()->createUrl('third/setSubjectId')?>",data,function(flags){
  493. if(flags)
  494. {
  495. location.reload();
  496. }else
  497. {
  498. alert('网络异常');
  499. }
  500. });
  501. $('.has-sel').text($(this).text());
  502. $(".sel-cons").hide();
  503. });
  504. $(".ruanyun").click(function(){
  505. var exam_id = $(this).attr('exam_id');
  506. layer.msg("确定发送吗?学生是否全部上传成绩", {
  507. time: 0,
  508. btn: ['确定', '取消'],
  509. yes: function(index){
  510. layer.close(index);
  511. $.ajax({
  512. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  513. type: "POST",
  514. dataType: "json",
  515. data:{ examId: exam_id
  516. },
  517. success: function (data){
  518. if(data.status == 1){
  519. layer.msg('发送成功',{
  520. icon: 1
  521. }, function(){
  522. layer.closeAll();
  523. location.reload();
  524. });
  525. }else if(data.status == 2){
  526. layer.msg('发送失败,未上传成绩',{
  527. icon: 5
  528. }, function(){
  529. layer.closeAll();
  530. location.reload();
  531. });
  532. }else{
  533. layer.msg('发送失败',{
  534. icon: 5
  535. }, function(){
  536. layer.closeAll();
  537. location.reload();
  538. });
  539. }
  540. },
  541. error: function (data, status, e){ //服务器响应失败处理函数
  542. layer.msg('返回失败!',{
  543. icon: 1
  544. }, function(){
  545. layer.closeAll();
  546. });
  547. }
  548. });
  549. }
  550. });
  551. });
  552. $(".create_sheet").click(function(){
  553. var exam_group_id = $(this).attr("exam_group_id");
  554. var sheet_id = $(this).attr("sheet_id");
  555. var mark_type = $(this).attr("mark_type");
  556. var tw_status = $(this).attr("tw_status");
  557. var labelled = $(this).attr("labelled");
  558. if(mark_type==0){
  559. layer.msg('当前考试为线下阅卷,暂不支持切割模板,请使用在线答题卡功能进行考试。',{
  560. icon:5,time:5000
  561. }, function(){
  562. layer.closeAll();
  563. location.reload();
  564. });
  565. return false;
  566. }
  567. if(exam_group_id>0){
  568. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  569. $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
  570. var m = JSON.parse(rs);
  571. if(m.status==1)
  572. {
  573. layer.msg('已上传成绩,无法修改!',{
  574. icon: 5
  575. }, function(){
  576. layer.closeAll();
  577. location.reload();
  578. });
  579. }
  580. if(m.status==4)
  581. {
  582. layer.msg('您当前已发送答题卡后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
  583. '\n' +
  584. '\n' +
  585. '\n' +
  586. '您也可在后台协助详情页中撤回任务,自行操作!',{
  587. icon:5,time:5000
  588. }, function(){
  589. layer.closeAll();
  590. location.reload();
  591. });
  592. }
  593. if(m.status==2)
  594. {
  595. layer.msg('非法考试!',{
  596. icon: 5
  597. }, function(){
  598. layer.closeAll();
  599. location.reload();
  600. });
  601. }
  602. if(m.status==5)
  603. {
  604. msg="";
  605. if((tw_status==2 || tw_status==1) && labelled==0){
  606. msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡;<br>当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
  607. }else{
  608. msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡,请确认!";
  609. }
  610. layer.msg(msg, {
  611. time: 0,
  612. btn: ['确定', '取消'],
  613. yes: function(index){
  614. evaluationClient.createAnswerSheet(0+","+exam_group_id);
  615. }
  616. });
  617. }
  618. if(m.status==0)
  619. {
  620. msg="当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
  621. if((tw_status==2 || tw_status==1) && labelled==0){
  622. layer.msg(msg, {
  623. time: 0,
  624. btn: ['确定', '取消'],
  625. yes: function(index){
  626. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
  627. }
  628. });
  629. }else{
  630. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
  631. }
  632. }
  633. });
  634. }
  635. });
  636. $(".create_sheet_subject").click(function(){
  637. var exam_group_id = $(this).attr("exam_group_id");
  638. var sheet_id = $(this).attr("sheet_id");
  639. var mark_type = $(this).attr("mark_type");
  640. var tw_status = $(this).attr("tw_status");
  641. var labelled = $(this).attr("labelled");
  642. if(mark_type==0){
  643. layer.msg('当前考试为线下阅卷,暂不支持切割模板,请使用在线答题卡功能进行考试。',{
  644. icon:5,time:5000
  645. }, function(){
  646. layer.closeAll();
  647. location.reload();
  648. });
  649. return false;
  650. }
  651. if(exam_group_id>0){
  652. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  653. $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
  654. var m = JSON.parse(rs);
  655. /*
  656. if(m.status==1)
  657. {
  658. layer.msg('已上传成绩,无法修改!',{
  659. icon: 5
  660. }, function(){
  661. layer.closeAll();
  662. location.reload();
  663. });
  664. }
  665. */
  666. if(m.status==4)
  667. {
  668. layer.msg('您当前已发送答题卡后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
  669. '\n' +
  670. '\n' +
  671. '\n' +
  672. '您也可在后台协助详情页中撤回任务,自行操作!',{
  673. icon:5,time:5000
  674. }, function(){
  675. layer.closeAll();
  676. location.reload();
  677. });
  678. }
  679. if(m.status==2)
  680. {
  681. layer.msg('非法考试!',{
  682. icon: 5
  683. }, function(){
  684. layer.closeAll();
  685. location.reload();
  686. });
  687. }
  688. if(m.status==5)
  689. {
  690. msg="";
  691. if((tw_status==2 || tw_status==1) && labelled==0){
  692. msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡;<br>当前考试已发送解析,修改答题卡需要重新上传解析,请确认!";
  693. }else{
  694. msg="当前考试存在在线答题卡数据,如果继续使用并保存【制作模板】,则会清空在线答题卡,请确认!";
  695. }
  696. layer.msg(msg, {
  697. time: 0,
  698. btn: ['确定', '取消'],
  699. yes: function(index){
  700. evaluationClient.createAnswerSheet(0+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
  701. }
  702. });
  703. }
  704. if(m.status==0 || m.status==1)
  705. {
  706. if((tw_status==2 || tw_status==1) && labelled==0){
  707. layer.msg('当前考试已发送解析,修改答题卡需要重新上传解析,请确认!', {
  708. time: 0,
  709. btn: ['确定', '取消'],
  710. yes: function(index){
  711. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
  712. }
  713. });
  714. }else{
  715. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
  716. }
  717. }
  718. });
  719. }
  720. });
  721. jQuery(".maskType").click(function () {
  722. var is_show = jQuery(this).attr("is_show");
  723. if (is_show > 0) {
  724. return false;
  725. }
  726. var _display = '';
  727. var exam_group_id = jQuery(this).attr("examId");
  728. var tpl_index = jQuery(this).attr("tpl_index");
  729. var mar = 'margin:30px auto;';
  730. html = "" +
  731. '<div style="padding:10px 30px">' +
  732. '<div style="padding-top:10px;clear: left"></div>' +
  733. '<div style="margin:5px 0; float: left;';
  734. html = html + '">阅卷方式:</div>' +
  735. '<div style="float: left"><select id="mark_type" style="width:200px;';
  736. html = html + '">' +
  737. '<option value="0" ';
  738. if (jQuery(this).attr("mark_type") == '0') {
  739. html = html + 'selected';
  740. }
  741. html = html + '>线下阅卷</option>';
  742. html = html + ' <option value="3" ';
  743. if (jQuery(this).attr("mark_type") == '3') {
  744. html = html + 'selected';
  745. }
  746. html = html + '>班级混合阅卷</option> ';
  747. html = html + ' <option value="4" ';
  748. if (jQuery(this).attr("mark_type") == '4') {
  749. html = html + 'selected';
  750. }
  751. html = html + '>班级单独阅卷</option> ' +
  752. '</select></div>' +
  753. '<div class="row" style="' + mar + 'text-align: center;"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:20px 0 0 15px">确定</button>' +
  754. '<button id="cancel" class="label-primary-s bth-s" style="border:gray;background:gray;padding:4px 12px;margin:20px 0 0 25px">取消</button></div>' +
  755. '</div>' +
  756. "";
  757. layer.open({
  758. type: 1,
  759. area: ['350px', '300px'],
  760. title: "更改试卷",
  761. content: html,
  762. success: function (index, layerObj) {
  763. jQuery("#cancel").on("click", function () {
  764. layer.closeAll();
  765. });
  766. jQuery("#confirm").on("click", function () {
  767. var mark_type = jQuery("#mark_type").val();
  768. jQuery.post(
  769. "<?php echo $this->createUrl("print/Setmasktype");?>",
  770. {"exam_group_id": exam_group_id, "mark_type": mark_type, "tpl_index": tpl_index},
  771. function (data) {
  772. data = JSON.parse(data);
  773. layer.msg(data.message);
  774. if (data.success == 1) {
  775. setTimeout(function () {
  776. location.reload();
  777. }, 1300);
  778. }
  779. }
  780. );
  781. layer.closeAll();
  782. });
  783. },
  784. end: function () {
  785. }
  786. });
  787. });
  788. //打印
  789. $(".print_sheet").click(function(){
  790. var exam_group_id = $(this).attr('exam_group_id');
  791. if(!exam_group_id)
  792. {
  793. layer.msg('非法考试!');
  794. return false;
  795. }
  796. $.post("<?php echo Yii::app()->createUrl('third/print_paper')?>",{exam_group_id:exam_group_id},function(rs){
  797. var m = JSON.parse(rs);
  798. if(m.status)
  799. {
  800. evaluationClient.CreateDiSanFang(m.result);
  801. }
  802. });
  803. });
  804. $('.tab_btn').click(function(){
  805. $('input[name="list_type"]').val($(this).index());
  806. });
  807. $('.create-third').click(function(){
  808. var href='';
  809. <?php
  810. if(isset($list_type) && $list_type==1){
  811. echo "href='".$this->createUrl("third/thirdview_under_line")."';";
  812. } else{
  813. if(Yii::app()->params['section']==0){
  814. echo "href='".$this->createUrl("third/thirdview_section")."';";
  815. }elseif(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(3,6))){
  816. echo "href='".$this->createUrl("third/thirdview")."';";
  817. }else{
  818. echo "href='".$this->createUrl("third/thirdview_duo")."';";
  819. }
  820. }
  821. ?>
  822. window.location=href;
  823. });
  824. $('.upload-btn-paper').click(function(){
  825. var This = $(this);
  826. $($(this).parent().find("input")).each(function(){
  827. if(!$(this).val()){
  828. $(this).remove();
  829. }
  830. });
  831. // var length = parseInt($('.upload-ul-paper li').length);
  832. var html = '<input type="file" name="paper_exam'+filePaper+'" id="paper_exam'+filePaper+'" style="display:none" class="upload-paper-types">';
  833. This.after(html);
  834. This.parent().find("#paper_exam"+filePaper).click();
  835. filePaper++;
  836. });
  837. $("body").delegate(".upload-paper-types","change",function(){
  838. var idName = $(this).attr('id');
  839. var filename = $(this).val();
  840. var nameStart = filename.lastIndexOf('\\');
  841. var fileNameRe = filename.substring(nameStart,filename.length);
  842. fileNameRe = fileNameRe.substr(1);
  843. var extStart = filename.lastIndexOf('.');
  844. var extName = filename.substring(extStart,filename.length).toLowerCase();
  845. if (extName != ".docx" && extName != ".doc" && extName != ".pdf" && extName != ".gif" && extName != ".bmp" && extName != ".jpg" && extName != ".jpeg" && extName != ".png") {
  846. layer.msg('试卷格式错误');
  847. $(this).remove();
  848. return false;
  849. }
  850. var length = $(".upload-btn-paper").parent().find("input").length;
  851. var html = "";
  852. html += '<li class="clearfix">';
  853. html += ' <span class="fl paper-no">第'+length+'页</span>';
  854. html += ' <span class="fl">'+fileNameRe+'</span>';
  855. html += ' <em class="fr red remove-file-paper" idName="'+idName+'">×</em>';
  856. html += '</li>';
  857. $('.upload-ul-paper').append(html);
  858. });
  859. $('.upload-btn-answer').click(function(){
  860. var This = $(this);
  861. $($(this).parent().find("input")).each(function(){
  862. if(!$(this).val()){
  863. $(this).remove();
  864. }
  865. });
  866. // var length = parseInt($('.upload-ul-answer li').length);
  867. var html = '<input type="file" name="paper_answer'+fileAnswer+'" id="paper_answer'+fileAnswer+'" style="display:none" class="upload-answer-types">';
  868. This.after(html);
  869. This.parent().find("#paper_answer"+fileAnswer).click();
  870. fileAnswer++;
  871. });
  872. $("body").delegate(".upload-answer-types","change",function(){
  873. var idName = $(this).attr('id');
  874. var filename = $(this).val();
  875. var nameStart = filename.lastIndexOf('\\');
  876. var fileNameRe = filename.substring(nameStart,filename.length);
  877. fileNameRe = fileNameRe.substr(1);
  878. var extStart = filename.lastIndexOf('.');
  879. var extName = filename.substring(extStart,filename.length).toLowerCase();
  880. if (extName != ".docx" && extName != ".doc" && extName != ".pdf" && extName != ".gif" && extName != ".bmp" && extName != ".jpg" && extName != ".jpeg" && extName != ".png") {
  881. layer.msg('答案解析格式错误');
  882. $(this).remove();
  883. return false;
  884. }
  885. var length = $(".upload-btn-answer").parent().find("input").length;
  886. var html = "";
  887. html += '<li class="clearfix">';
  888. html += ' <span class="fl answer-no">第'+length+'页</span>';
  889. html += ' <span class="fl">'+fileNameRe+'</span>';
  890. html += ' <em class="fr red remove-file-answer" idName="'+idName+'">×</em>';
  891. html += '</li>';
  892. $('.upload-ul-answer').append(html);
  893. });
  894. $("body").delegate(".remove-file-paper","click",function(){
  895. var idName = $(this).attr("idName");
  896. $(this).parent().remove();
  897. $('#'+idName).remove();
  898. var no = 1;
  899. $(".upload-ul-paper li").each(function(){
  900. $(this).find(".paper-no").html("第"+no +"页");
  901. no++;
  902. });
  903. });
  904. $("body").delegate(".remove-file-answer","click",function(){
  905. var idName = $(this).attr("idName");
  906. $(this).parent().remove();
  907. $('#'+idName).remove();
  908. var no = 1;
  909. $(".upload-ul-answer li").each(function(){
  910. $(this).find(".answer-no").html("第"+no +"页");
  911. no++;
  912. });
  913. });
  914. });
  915. function showError(str)
  916. {
  917. layer.msg(str,{
  918. icon: 5
  919. }, function(){
  920. layer.closeAll();
  921. location.reload();
  922. });
  923. }
  924. function objToJson(obj){
  925. var json = "{ ";
  926. for(var item in obj){
  927. json += "'"+item+"':'"+obj[item]+"',";
  928. }
  929. json += " }";
  930. return json;
  931. }
  932. function ccc(){
  933. layer.msg('敬请期待!', {
  934. time: 0,
  935. btn: ['确定', '取消'],
  936. yes: function(index){
  937. layer.close(index);
  938. return false;
  939. }
  940. });
  941. }
  942. function delExam(odj){
  943. if (!odj) return false;
  944. var classId = odj.getAttribute("w_class_id");
  945. var examId = odj.getAttribute("w_exam_id");
  946. if (!classId || !examId) return false;
  947. var msg = '您确定要删除此班的考试吗?';
  948. layer.msg(msg, {
  949. time: 0,
  950. btn: ['确定', '取消'],
  951. yes: function(index){
  952. layer.close(index);
  953. $.ajax({
  954. url: "<?php echo $this->createUrl('print/delexam');?>",
  955. type: "POST",
  956. dataType: "json",
  957. data: {
  958. examId: examId,
  959. classId:classId
  960. },
  961. success: function (data){
  962. if(data.status == 1){
  963. layer.msg('删除成功',{
  964. icon: 1
  965. }, function(){
  966. layer.closeAll();
  967. location.reload();
  968. });
  969. }else{
  970. layer.msg('删除失败',{
  971. icon: 5
  972. }, function(){
  973. layer.closeAll();
  974. location.reload();
  975. });
  976. }
  977. },
  978. error: function (data, status, e){ //服务器响应失败处理函数
  979. layer.msg('返回失败!',{
  980. icon: 1
  981. }, function(){
  982. layer.closeAll();
  983. });
  984. }
  985. });
  986. }
  987. });
  988. }
  989. // 确认上传成绩
  990. function uploadConfirm(classId, examId,className,is_uploaded_count,students_count) {
  991. //if (confirm('您确定已上传成绩了吗?')) {
  992. msg = "<div style='text-align:left;'>("+className+")已上传(<span style=' font-size:20px;color:#15ae68 ;font-weight: bold'>"+is_uploaded_count+"</span>)份试卷,还有(<span style='font-size:20px;color: red;font-weight: bold'>"+(students_count-is_uploaded_count)+"</span>)份试卷未上传!是否确认本班级试卷都已上传?<br/><br/><span style='color: red'>请注意!试卷上传确认后将不能再次上传本班的试卷!!!</span></div>";
  993. layer.msg(msg, {
  994. time: 0,
  995. btn: ['确定', '取消'],
  996. yes: function(index, layerObj){
  997. layer.close(index);
  998. $.ajax({
  999. url: "<?php echo $this->createUrl('print/uploadConfirm');?>",
  1000. type: "POST",
  1001. data: {
  1002. classId: classId,
  1003. examId: examId
  1004. },
  1005. beforeSend:function(){
  1006. // 发送请求显示打印中
  1007. layer.msg('确认中...', {time: 20000});
  1008. },
  1009. dataType: "JSON",
  1010. success: function(data) {
  1011. if (data.status == 1) {
  1012. layer.msg('确认成功!');
  1013. setTimeout(function(){location.reload();}, 1300);
  1014. } else {
  1015. layer.msg(data.error);
  1016. }
  1017. },
  1018. complete:function(){
  1019. },
  1020. error:function(){
  1021. }
  1022. });
  1023. }
  1024. });
  1025. //}
  1026. }
  1027. // 打印错题本
  1028. function printBook(cid,eid,type){
  1029. if (!cid || !eid || !type) {
  1030. layer.msg("打印参数有误");return;
  1031. }
  1032. var message = '';
  1033. var objUrl = '';
  1034. if (type == 1) {
  1035. message = "您确定要下载该班级纠错本吗?";
  1036. objUrl = "<?php echo $this->createUrl('print/downloadwrongtopic');?>";
  1037. divTitle = "下载错题本";
  1038. improveName = "错题本";
  1039. } else if (type == 2){
  1040. message = "您确定要下载该班级个性化学习方案吗?";
  1041. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1042. divTitle = "下载个性化学习方案";
  1043. improveName = "个性化学习方案";
  1044. }else if (type == 3){
  1045. message = "您确定要下载该班级个性化学习宝吗?";
  1046. objUrl = "<?php echo $this->createUrl('print/downloadraisescheme');?>";
  1047. divTitle = "下载个性化学习宝";
  1048. improveName = "个性化学习宝";
  1049. }
  1050. else{
  1051. layer.msg("打印参数有误");return;
  1052. }
  1053. html = ""+
  1054. '<div style="padding:20px 30px 0px 30px">'+
  1055. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  1056. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  1057. '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
  1058. '</div>'+
  1059. '</div>'+
  1060. "";
  1061. layer.msg(message, {
  1062. time: 0,
  1063. btn: ['确定', '取消'],
  1064. yes: function(index){
  1065. layer.close(index);
  1066. msgIndex = layer.msg("下载中请稍后...", {"time": 3600000});
  1067. // 更试卷打印时间
  1068. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {cid: cid, eid: eid,type:type } );
  1069. /*if(type == 1)
  1070. location.href = objUrl+"/cid/"+cid+"/eid/"+eid;
  1071. else
  1072. location.href = objUrl+"/cid/"+cid+"/eid/"+eid+"/type/"+type;*/
  1073. startTime = (new Date()).getTime();
  1074. showTip = true;
  1075. tipShowed = false;
  1076. toPromptTime = 3000;
  1077. window.interval = setInterval(function(){
  1078. execTime = (new Date()).getTime() - startTime;
  1079. if(execTime > toPromptTime && showTip && !tipShowed){
  1080. // msgIndex = layer.msg("该文件较大,请耐心等待...", {"time": 3600000});
  1081. // tipShowed = true;
  1082. }
  1083. }, 1000);
  1084. jQuery.get(
  1085. "<?php echo $this->createUrl("print/getImproveFile");?>",
  1086. {"examId": eid, "classId": cid, "type": type},
  1087. function(data){
  1088. data = JSON.parse(data);
  1089. if(data.success == 1||data.success == 2){
  1090. layer.open({
  1091. type: 1,
  1092. area: ['550px', '220px'],
  1093. title: divTitle,
  1094. content: html,
  1095. success: function(index, layerObj){
  1096. clearInterval(window.interval);
  1097. msgIndex = layer.msg(data.limitinfo, {"time": 3000});
  1098. clearInterval(window.interval);
  1099. layer.close(msgIndex);
  1100. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  1101. jQuery("#confirm, #cancel").on("click", function(){
  1102. layer.close(layerObj);
  1103. });
  1104. jQuery("#copy").on("click", function(){
  1105. jQuery("#url").select();
  1106. });
  1107. },
  1108. end: function(){
  1109. }
  1110. });
  1111. }
  1112. else if(data.success == 0){
  1113. clearInterval(window.interval);
  1114. msgIndex = layer.msg(data.message, {"time": 3000});
  1115. }
  1116. }
  1117. );
  1118. }
  1119. });
  1120. }
  1121. // 上传试卷模板
  1122. function uploadTemplate(eid,name,grade){
  1123. if (!eid) {
  1124. layer.msg('操作失败!');
  1125. return false;
  1126. }
  1127. forCheckUrl = "<?php echo $this->createUrl('third/checkanswercard');?>";
  1128. $.post(forCheckUrl,{eid:eid},function(data){
  1129. var obj = JSON.parse(data);
  1130. var subject_id = '<?php echo Yii::app()->session['session_duoxueke_subject_id']?>';
  1131. if(obj.success==1)
  1132. {
  1133. var html ='<div class="layer_notice" style="padding:5px;">';
  1134. if(subject_id == 12){
  1135. html += '<div><a style="color:#0e8e54" href="/assets/data/physics_topic_mould.docx">下载试卷模板</a></div>';
  1136. }else if(subject_id==41){
  1137. // html += '<div><a style="color:#0e8e54" href="/assets/data/math_exam.doc">下载试卷模板</a></div>';
  1138. }
  1139. html +='<table class="table table-striped table-bordered table-hover ">';
  1140. html +='<thead class="thin-border-bottom">';
  1141. html +='<tr>';
  1142. html +='<th>试卷名称</th>';
  1143. html +='<th>操作</th>';
  1144. html +='</tr>';
  1145. html +='</thead>';
  1146. html +='<tbody class="content_tbody">';
  1147. if(subject_id == 41 ) {
  1148. html += '<td>' + name + '</td><td><input type="radio" value="1" name="upload_type" class="upload_type" checked><input type="file" style="display: inline" name="word_file" id="word_file" />';
  1149. html += '&nbsp;&nbsp;<input type="radio" name="upload_type" class="upload_type" value="2" >复用试卷</td></tr>';
  1150. }else{
  1151. html += '<td>' + name + '</td><td><input type="file" name="word_file" id="word_file" /></td></tr>';
  1152. }
  1153. html +='</tbody>';
  1154. html +='</table>';
  1155. html +='<span style="width:582px;display:inline-block;text-align:center;">';
  1156. html +='<button class="btn btn-success btn-sm upload-word" onclick="uploadWord()"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  1157. html +='<button class="btn btn-success btn-sm select-exam" onclick="selectExam('+grade+',\''+eid+'\')" style="display:none"><i class="ace-icon fa fa-check bigger-110"></i>确定</button>';
  1158. html +='</span>';
  1159. html +='<input type="hidden" id="mpEGid" value="'+eid+'">';
  1160. html +='</div>';
  1161. layer.open({
  1162. type: 1,
  1163. skin: 'layui-layer-rim', //加上边框
  1164. area: ['600px', '300px'], //宽高
  1165. content: html
  1166. });
  1167. }else
  1168. {
  1169. layer.msg(obj.message,{
  1170. icon: 5
  1171. }, function(){
  1172. layer.closeAll();
  1173. location.reload();
  1174. });
  1175. //layer.msg(obj.message);
  1176. }
  1177. });
  1178. }
  1179. $('body').on('click','.upload_type',function(){
  1180. console.log($(this).val());
  1181. if($(this).val()==1){
  1182. $('.upload-word').show();
  1183. $('.select-exam').hide();
  1184. }else{
  1185. $('.upload-word').hide();
  1186. $('.select-exam').show();
  1187. }
  1188. });
  1189. //复用试卷
  1190. var copyExamArr=[];
  1191. function selectExam(grade,examGroupId){
  1192. copyExamArr=[];
  1193. $.ajax({
  1194. url:'<?php echo $this->createUrl('third/loadCopyPaper')?>',
  1195. type:'POST',
  1196. dataType:'json',
  1197. data:{grade:grade,examGroupId:examGroupId},
  1198. success:function(res){
  1199. if(res.status==1){
  1200. rs=res.data;
  1201. if(rs.length>0){
  1202. $.each(rs,function(k,v){
  1203. copyExamArr.push(v)
  1204. })
  1205. showCopyExam(1,examGroupId)
  1206. }else{
  1207. layer.msg('暂时没有可以复用的考试');
  1208. }
  1209. }
  1210. }
  1211. });
  1212. }
  1213. function showCopyExam(page,examGroupId){
  1214. var pageLimit=10;
  1215. start=(page-1)*pageLimit
  1216. end =start+pageLimit
  1217. console.log(examGroupId);
  1218. maxPage= Math.ceil(copyExamArr.length/pageLimit);
  1219. var nowPageData=copyExamArr.slice(start,end)
  1220. console.log(nowPageData)
  1221. var html='';
  1222. pageHtml='';
  1223. layer.closeAll()
  1224. $.each(nowPageData,function(i,v){
  1225. html+='<tr>';
  1226. html+='<td>'+v['name']+'</td>';
  1227. html+='<td>'+v['create_time']+'</td>';
  1228. html+='<td>'+v['exam_date']+'</td>';
  1229. html+='<td><a href="#" targetExamId="'+examGroupId+'" class="copyPaperTopic" id="'+v['exam_group_id']+'">复用</a></td>';
  1230. html+='</tr>';
  1231. });
  1232. if(maxPage>1){
  1233. pageHtml+='<ul class="yiiPager">';
  1234. if(page>1){
  1235. pageHtml+='<li class="previous" id="'+examGroupId+'" pageNum="'+(page-1)+'"><a href="#" >上一页</a></li>';
  1236. }
  1237. for(var i=1;i<=maxPage;i++){
  1238. if(page==i){
  1239. pageHtml+='<li class="page selected"><a href="#" >'+i+'</a></li>';
  1240. }else{
  1241. pageHtml+='<li class="page"><a href="#" id="'+examGroupId+'" class="gotoPage">'+i+'</a></li>';
  1242. }
  1243. }
  1244. if(page<maxPage){
  1245. pageHtml+='<li class="next" id="'+examGroupId+'" pageNum="'+(page+1)+'"><a href="#" >下一页</a></li>';
  1246. }
  1247. pageHtml+='<li >共:'+copyExamArr.length+'条</li>';
  1248. pageHtml+='</ul>';
  1249. }
  1250. $('.student_list_page').html(pageHtml);
  1251. $('.student-list').find('tbody').html(html)
  1252. $('#fieldModalStudent').show();
  1253. }
  1254. $('.student-list-close').click(function(){
  1255. $('#fieldModalStudent').hide();
  1256. });
  1257. //复用按钮状态
  1258. var copyBtn=true;
  1259. $('.class_area')
  1260. .on('click','.gotoPage',function(){
  1261. page=parseInt($(this).html());
  1262. eid=$(this).attr('id');
  1263. showCopyExam(page,eid)
  1264. })
  1265. .on('click','.next',function(){
  1266. page=parseInt($(this).attr('pageNum'))
  1267. eid=$(this).attr('id');
  1268. showCopyExam(page,eid);
  1269. })
  1270. .on('click','.previous',function(){
  1271. page=parseInt($(this).attr('pageNum'))
  1272. eid=$(this).attr('id');
  1273. showCopyExam(page,eid);
  1274. })
  1275. .on('click','.copyPaperTopic',function(){
  1276. targetExamGroupId=$(this).attr('targetExamId');
  1277. copyExamGroupId=$(this).attr('id');
  1278. if(copyBtn){
  1279. var waiting=layer.msg('正在处理,请稍候。。。。。。',{time:0})
  1280. copyBtn=false;
  1281. $.ajax({
  1282. url:'<?php echo $this->createUrl('third/copyPaperTopic')?>',
  1283. type:'POST',
  1284. dataType:'json',
  1285. data:{examGroupId:targetExamGroupId,copyExamGroupId:copyExamGroupId},
  1286. success:function(res){
  1287. layer.close(waiting)
  1288. if(res.status==1){
  1289. layer.msg('复用成功',{time:2000},function(){
  1290. window.location.reload();
  1291. });
  1292. }else{
  1293. if(res.msg!=undefined){
  1294. layer.msg(res.msg);
  1295. // layer.closeAll();
  1296. //alert(res.msg);
  1297. }else{
  1298. layer.msg('复用失败');
  1299. }
  1300. copyBtn=true;
  1301. }
  1302. }
  1303. })
  1304. }
  1305. return false;
  1306. })
  1307. //复用
  1308. function uploadWord() {
  1309. var paramEid = $('#mpEGid').val();
  1310. if (!paramEid) {
  1311. layer.msg('没找到考试ID!');
  1312. return false;
  1313. }
  1314. var obj_file = $("#word_file").val();
  1315. if (!obj_file) {
  1316. layer.msg('请选择上传文件');
  1317. return false;
  1318. }
  1319. var extStart = obj_file.lastIndexOf('.');
  1320. var extName = obj_file.substring(extStart,obj_file.length).toLowerCase();
  1321. if (extName != ".docx" && extName != ".dotx" && extName != ".dotm") {
  1322. layer.msg('模板格式有误,请上传dotx格式word!');
  1323. return false;
  1324. }
  1325. $.ajaxFileUpload({
  1326. url: "<?php echo $this->createUrl('third/uploadTpl');?>", //用于文件上传的服务器端请求地址
  1327. secureuri: false, //是否需要安全协议,一般设置为false
  1328. fileElementId: 'word_file', //文件上传域的ID
  1329. dataType: 'text', //返回值类型 一般设置为json
  1330. data:{"eid":paramEid},
  1331. success: function (data, status){
  1332. var obj = JSON.parse(data);
  1333. if (obj.success == 1) {
  1334. layer.msg(obj.message,{
  1335. icon: 1,
  1336. }, function(){
  1337. layer.closeAll();
  1338. location.reload();
  1339. });
  1340. $("#alreadUpload").html('<span style="color:red;">已上传</span>');
  1341. } else {
  1342. layer.msg(obj.message,{
  1343. icon: 2,
  1344. }, function(){
  1345. layer.closeAll();
  1346. location.reload();
  1347. });
  1348. }
  1349. },
  1350. error: function (data, status, e){ //服务器响应失败处理函数
  1351. layer.msg('返回失败!',{
  1352. icon: 1,
  1353. }, function(){
  1354. layer.closeAll();
  1355. location.reload();
  1356. });
  1357. }
  1358. });
  1359. return false;
  1360. }
  1361. // 搜索事件
  1362. $("#search").click(function(){
  1363. $("#form1").submit();
  1364. });
  1365. function print(cid,eid,tid,fg){
  1366. if (!cid || !eid) return false;
  1367. var msg = '';
  1368. if (tid == 0) {
  1369. if (fg == 1) {
  1370. msg = '打印答题卡';
  1371. } else {
  1372. msg = '您确定要打印该试卷嘛?';
  1373. }
  1374. } else if (tid == 1) {
  1375. msg = '您确定要打印该错题本嘛?';
  1376. } else if (tid == 2) {
  1377. msg = '您确定要打印该个性化学习宝吗?';
  1378. }
  1379. layer.msg(msg, {
  1380. time: 0,
  1381. btn: ['确定', '取消'],
  1382. yes: function(index){
  1383. layer.close(index);
  1384. ajaxPrint(cid, eid, tid);
  1385. }
  1386. });
  1387. }
  1388. function ajaxPrint(cid, eid, tid) {
  1389. $.ajax({
  1390. url:"<?php echo $this->createUrl('print/ajaxupdate');?>",
  1391. type:"post",
  1392. data:{cid:cid,eid:eid,tid:tid},
  1393. dataType: "json",
  1394. beforeSend:function(){
  1395. // 发送请求显示打印中
  1396. layer.msg('打印中', {icon: 16,time: 20000});
  1397. },
  1398. success:function(obj){
  1399. var index = layer.msg();
  1400. layer.close(index);
  1401. if (obj.success == 1) {
  1402. if (tid == 0) {//console.log(JSON.stringify(obj.message));
  1403. evaluationClient.printPaper(JSON.stringify(obj.message));
  1404. //alert('提交打印试卷成功!');
  1405. } else if (tid == 1) {
  1406. evaluationClient.printCTB(JSON.stringify(obj.message));
  1407. //alert('提交打印错题本成功!');
  1408. } else if (tid == 2) {
  1409. evaluationClient.printTFFA(JSON.stringify(obj.message));
  1410. //alert('提交打印提分册成功!');
  1411. } else {
  1412. layer.msg('操作错误!');
  1413. }
  1414. location.reload();
  1415. } else {//alert(obj.message);
  1416. layer.msg(obj.message);
  1417. }
  1418. },
  1419. complete:function(){
  1420. //layer.msg('打印失败!');
  1421. //var index = layer.msg();
  1422. //layer.close(index);
  1423. },
  1424. error:function(){
  1425. //var index = layer.msg();
  1426. //layer.close(index);
  1427. }
  1428. });
  1429. }
  1430. // 生成试卷模板
  1431. function createTemplate (exam_group_id){
  1432. if (!exam_group_id) {
  1433. layer.msg('未找到试卷ID');
  1434. }
  1435. var data={
  1436. exam_group_id:exam_group_id
  1437. }
  1438. $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
  1439. var m = JSON.parse(rs);
  1440. if(m.status==1)
  1441. {
  1442. evaluationClient.loadThirdParty(exam_group_id);
  1443. }else {
  1444. layer.msg('尚未创建答题卡,请创建');
  1445. }
  1446. });
  1447. }
  1448. // 生成试卷模板
  1449. function createTemplateSubject (exam_group_id,subject,import_type){
  1450. if (!exam_group_id||!subject) {
  1451. layer.msg('未找到试卷ID');
  1452. }
  1453. var data={
  1454. exam_group_id:exam_group_id
  1455. }
  1456. $.post("<?php echo Yii::app()->createUrl("third/paper")?>",data,function(rs){
  1457. var m = JSON.parse(rs);
  1458. if(m.status==1)
  1459. {
  1460. if(import_type>0){
  1461. evaluationClient.ImportLoadThirdParty(exam_group_id+','+subject);
  1462. }else{
  1463. evaluationClient.loadThirdParty(exam_group_id+','+subject);
  1464. }
  1465. }else {
  1466. layer.msg('尚未创建答题卡,请创建');
  1467. }
  1468. });
  1469. }
  1470. function wb_html(odj){
  1471. if (!odj) return false;
  1472. var classId = odj.getAttribute("w_class_id");
  1473. var examId = odj.getAttribute("w_exam_id");
  1474. if (!classId || !examId) return false;
  1475. var msg = '您确定要生成该班级的错题本吗?';
  1476. layer.msg(msg, {
  1477. time: 0,
  1478. btn: ['确定', '取消'],
  1479. yes: function(index){
  1480. layer.close(index);
  1481. $.ajax({
  1482. url: "<?php echo $this->createUrl('client/wbhtml');?>",
  1483. type: "POST",
  1484. dataType: "json",
  1485. data: {
  1486. examId: examId,
  1487. classId:classId
  1488. },
  1489. success: function (data){
  1490. if(data > 0){
  1491. layer.msg('操作成功,重新生成错题本',{
  1492. icon: 1
  1493. }, function(){
  1494. layer.closeAll();
  1495. });
  1496. }else if(data==0){
  1497. layer.msg('操作失败,此班无错题本',{
  1498. icon: 1
  1499. }, function(){
  1500. layer.closeAll();
  1501. });
  1502. }
  1503. else{
  1504. layer.msg('操作失败,重新生成错题本',{
  1505. icon: 1
  1506. }, function(){
  1507. layer.closeAll();
  1508. });
  1509. }
  1510. },
  1511. error: function (data, status, e){ //服务器响应失败处理函数
  1512. layer.msg('返回失败!',{
  1513. icon: 1
  1514. }, function(){
  1515. layer.closeAll();
  1516. });
  1517. }
  1518. });
  1519. }
  1520. });
  1521. }
  1522. function isp2_html(odj){
  1523. if (!odj) return false;
  1524. var classId = odj.getAttribute("w_class_id");
  1525. var examId = odj.getAttribute("w_exam_id");
  1526. if (!classId || !examId) return false;
  1527. var msg = '您确定要生成该班级的二步提分方案吗?';
  1528. layer.msg(msg, {
  1529. time: 0,
  1530. btn: ['确定', '取消'],
  1531. yes: function(index){
  1532. layer.close(index);
  1533. $.ajax({
  1534. url: "<?php echo $this->createUrl('client/isp2html');?>",
  1535. type: "POST",
  1536. dataType: "json",
  1537. data: {
  1538. examId: examId,
  1539. classId:classId
  1540. },
  1541. success: function (data){
  1542. if(data > 0){
  1543. layer.msg('操作成功,重新生成提分方案',{
  1544. icon: 1
  1545. }, function(){
  1546. layer.closeAll();
  1547. });
  1548. }else if(data==0){
  1549. layer.msg('操作失败,此班无提分方案',{
  1550. icon: 1
  1551. }, function(){
  1552. layer.closeAll();
  1553. });
  1554. }
  1555. else{
  1556. layer.msg('操作失败,重新生成提分方案',{
  1557. icon: 1
  1558. }, function(){
  1559. layer.closeAll();
  1560. });
  1561. }
  1562. },
  1563. error: function (data, status, e){ //服务器响应失败处理函数
  1564. layer.msg('返回失败!',{
  1565. icon: 1
  1566. }, function(){
  1567. layer.closeAll();
  1568. });
  1569. }
  1570. });
  1571. }
  1572. });
  1573. }
  1574. function isp3_html(odj){
  1575. if (!odj) return false;
  1576. var classId = odj.getAttribute("w_class_id");
  1577. var examId = odj.getAttribute("w_exam_id");
  1578. if (!classId || !examId) return false;
  1579. var msg = '您确定要生成该班级的个性化学习宝吗?';
  1580. layer.msg(msg, {
  1581. time: 0,
  1582. btn: ['确定', '取消'],
  1583. yes: function(index){
  1584. layer.close(index);
  1585. $.ajax({
  1586. url: "<?php echo $this->createUrl('client/isp3html');?>",
  1587. type: "POST",
  1588. dataType: "json",
  1589. data: {
  1590. examId: examId,
  1591. classId:classId
  1592. },
  1593. success: function (data){
  1594. if(data > 0){
  1595. layer.msg('操作成功,重新生成提分方案',{
  1596. icon: 1
  1597. }, function(){
  1598. layer.closeAll();
  1599. });
  1600. }else if(data==0){
  1601. layer.msg('操作失败,此班无提分方案',{
  1602. icon: 1
  1603. }, function(){
  1604. layer.closeAll();
  1605. });
  1606. }
  1607. else{
  1608. layer.msg('操作失败,重新生成提分方案',{
  1609. icon: 1
  1610. }, function(){
  1611. layer.closeAll();
  1612. });
  1613. }
  1614. },
  1615. error: function (data, status, e){ //服务器响应失败处理函数
  1616. layer.msg('返回失败!',{
  1617. icon: 1
  1618. }, function(){
  1619. layer.closeAll();
  1620. });
  1621. }
  1622. });
  1623. }
  1624. });
  1625. }
  1626. // 隐藏试卷
  1627. function oprateExam(examGroupId,flag){
  1628. if (examGroupId) {
  1629. layer.msg('未找到周周练id',{
  1630. icon: 5
  1631. }, function(){
  1632. layer.closeAll();
  1633. });
  1634. }
  1635. var msg = '您确定要隐藏该试卷吗?';
  1636. if (flag == 0) {
  1637. msg = '您确定要恢复该试卷吗?';
  1638. }
  1639. layer.msg(msg, {
  1640. time: 0,
  1641. btn: ['确定', '取消'],
  1642. yes: function(index){
  1643. layer.close(index);
  1644. $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
  1645. var obj = JSON.parse(data);
  1646. if (obj.success == 1) {
  1647. location.reload();
  1648. } else {
  1649. layer.msg(obj.message,{
  1650. icon: 5
  1651. }, function(){
  1652. layer.closeAll();
  1653. });
  1654. // layer.msg(obj.message);
  1655. }
  1656. });
  1657. }
  1658. });
  1659. }
  1660. function uploadExamTopic(ExamGroupId,Subject,Sheet,tplIndex){
  1661. if (!ExamGroupId||!Subject) {
  1662. layer.msg('未找到试卷ID');
  1663. return false;
  1664. }
  1665. $.ajax({
  1666. url:"<?php echo $this->createUrl('third/getthirdsheet');?>",
  1667. type:"POST",
  1668. dataType:"json",
  1669. data:{exam_group_id:ExamGroupId},
  1670. success:function (res) {
  1671. if(res.success==1){
  1672. evaluationClient.loadExamPaper(Sheet+','+ExamGroupId+','+Subject+','+tplIndex);
  1673. }else if(res.success==4){
  1674. layer.msg('您当前已发送试卷后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
  1675. '\n' +
  1676. '\n' +
  1677. '\n' +
  1678. '您也可在后台协助详情页中撤回任务,自行操作!',{icon:5,time:5000});
  1679. }else{
  1680. layer.msg('请先关联答题卡');
  1681. }
  1682. }
  1683. });
  1684. }
  1685. function uploadExamAnswer(ExamGroupId,Subject,Sheet){
  1686. if (!ExamGroupId||!Subject) {
  1687. layer.msg('未找到试卷ID');
  1688. return false;
  1689. }
  1690. $.ajax({
  1691. url:"<?php echo $this->createUrl('third/getthirdsheet');?>",
  1692. type:"POST",
  1693. dataType:"json",
  1694. data:{exam_group_id:ExamGroupId,get_type:2},
  1695. success:function (res) {
  1696. if(res.success==1){
  1697. evaluationClient.loadAnswerParsing(Sheet+','+ExamGroupId+','+Subject);
  1698. }else if(res.success==4){
  1699. layer.msg('您当前已发送答案解析后台协助任务,为避免您产生与后台重复的操作,以造成数据混乱,已禁止您操作。请等待后台处理结果。\n' +
  1700. '\n' +
  1701. '\n' +
  1702. '\n' +
  1703. '您也可在后台协助详情页中撤回任务,自行操作!',{icon:5,time:5000});
  1704. }else{
  1705. layer.msg('请先关联答题卡');
  1706. }
  1707. }
  1708. });
  1709. }
  1710. // tips
  1711. $(".open-tips").on("mouseenter", function () {
  1712. var tips_text = $(this).attr("tipstext");
  1713. layer.tips(tips_text, this, {
  1714. tips: [1, '#14AE68'] //还可配置颜色
  1715. });
  1716. });
  1717. $('.datetimepicker8').datetimepicker({
  1718. onGenerate:function( ct ){
  1719. $(this).find('.xdsoft_date')
  1720. .toggleClass('xdsoft_disabled');
  1721. $(this).find(".xdsoft_today").removeClass('xdsoft_disabled');
  1722. },
  1723. format:'Y-m-d H:i',
  1724. formatDate:'Y-m-d H:i',
  1725. formatTime:'H:i',
  1726. // minDate:'-1970/01/2',
  1727. minDate: '-<?php echo date('Y-m-d H:i', strtotime('Yesterday')); ?>',
  1728. maxDate:'+1970/01/2',
  1729. timepicker:true,
  1730. step:10,
  1731. });
  1732. function sendPaperAndAnswer(examGroupId){
  1733. var print_time = $('input[name="english-print-time"]').val();
  1734. var printTime = 0;
  1735. if(print_time){
  1736. var now_time = parseInt(new Date().getTime() / 1000);
  1737. printTime = new Date(print_time).getTime() / 1000;
  1738. if(now_time > printTime){
  1739. layer.msg('期望时间不得小于当前时间');
  1740. return false;
  1741. }
  1742. }else{
  1743. layer.msg('请选择期望时间');
  1744. return false;
  1745. }
  1746. var paperLength = $('.upload-btn-paper').parent().find("input").length;
  1747. var answerLength = $('.upload-btn-answer').parent().find("input").length;
  1748. var paperUrl = {};
  1749. var answerUrl = {};
  1750. var notice = '';
  1751. if(paperLength == 0 && answerLength == 0){
  1752. layer.msg('请上传试卷及答案解析');
  1753. return false;
  1754. }else if(paperLength == 0){
  1755. layer.msg('请上传试卷');
  1756. return false;
  1757. }else if(answerLength == 0){
  1758. layer.msg('请上传答案解析');
  1759. return false;
  1760. }else{
  1761. var uploadFiles = [];
  1762. $(".upload-btn-paper").parent().find("input").each(function(){
  1763. if($(this).val()){
  1764. if($("#"+$(this).attr("id"))[0].files[0].size >8388608){
  1765. // layer.msg("文件过大");
  1766. notice = "文件不能超过8M";
  1767. // alert("文件不能超过8M");
  1768. // return false;
  1769. // location.reload();
  1770. }else{
  1771. uploadFiles.push($(this).attr("id"));
  1772. }
  1773. }
  1774. });
  1775. $(".upload-btn-answer").parent().find("input").each(function(){
  1776. if($(this).val()){
  1777. if($("#"+$(this).attr("id"))[0].files[0].size >8388608){
  1778. notice = "文件不能超过8M";
  1779. // layer.msg("文件过大");
  1780. // alert("文件不能超过8M");
  1781. // return false;
  1782. // location.reload();
  1783. }else{
  1784. uploadFiles.push($(this).attr("id"));
  1785. }
  1786. }
  1787. });
  1788. if(notice != ""){
  1789. layer.msg(notice,{time:2000});
  1790. location.reload();
  1791. return false;
  1792. }
  1793. layer.msg('正在上传,请稍候......',{time:60000});
  1794. uploadFiles.reverse();
  1795. for(var i = 0;i<uploadFiles.length;i++){
  1796. var uploadOne = uploadFiles[i];
  1797. $.ajaxFileUpload({
  1798. url: "<?php echo $this->createUrl('third/uploadEnglishPaper');?>", //用于文件上传的服务器端请求地址
  1799. secureuri: false, //是否需要安全协议,一般设置为false
  1800. fileElementId: uploadOne, //文件上传域的ID
  1801. dataType: 'text', //返回值类型 一般设置为json
  1802. data:{"examGroupId":examGroupId,"uploadOne":uploadOne},
  1803. success: function (data){
  1804. console.log(data);
  1805. var obj = JSON.parse(data);
  1806. if (obj.success == 1) {
  1807. if(obj.answer_url != ''){
  1808. //answerUrl.push(obj.answer_url);
  1809. var idAnswer = obj.uploadOne.replace("paper_answer","");
  1810. answerUrl[idAnswer] = obj.answer_url;
  1811. }
  1812. if(obj.paper_url != ''){
  1813. //paperUrl.push(obj.paper_url);
  1814. var idPaper = obj.uploadOne.replace("paper_exam","");
  1815. paperUrl[idPaper] = obj.paper_url;
  1816. }
  1817. if(Object.keys(answerUrl).length + Object.keys(paperUrl).length == uploadFiles.length){
  1818. jQuery.post(
  1819. '<?php echo $this->createUrl('third/uploadEnglishPaperInsert');?>',
  1820. {"examGroupId":examGroupId,"answerUrl":answerUrl,"paperUrl":paperUrl,"printTime":printTime},
  1821. function(data1){
  1822. var obj1 = JSON.parse(data1);
  1823. console.log(obj1);
  1824. if (obj1.success == 1) {
  1825. layer.msg('上传成功');
  1826. location.reload();
  1827. return false;
  1828. } else {
  1829. layer.msg(obj1.message);
  1830. location.reload();
  1831. return false;
  1832. }
  1833. }
  1834. );
  1835. }
  1836. } else {
  1837. layer.msg(obj.message,{
  1838. icon: 1,
  1839. }, function(){
  1840. layer.closeAll();
  1841. location.reload();
  1842. });
  1843. }
  1844. },
  1845. // error: function (data, status, e){ //服务器响应失败处理函数
  1846. // layer.msg('返回失败!',{
  1847. // icon: 1,
  1848. // }, function(){
  1849. // layer.closeAll();
  1850. // location.reload();
  1851. // });
  1852. // }
  1853. });
  1854. }
  1855. // console.log(answerUrl,paperUrl);
  1856. //
  1857. // answerUrl.push(1);
  1858. // console.log(answerUrl.length);
  1859. // return false;
  1860. // MaskUtil.unmask();
  1861. // location.reload();
  1862. return false;
  1863. }
  1864. }
  1865. // 生成试卷模板
  1866. function createTemplateEnglish (eid,flag){
  1867. if (!eid) {
  1868. layer.msg('未找到考试信息');
  1869. }
  1870. var msg = '';
  1871. if (flag == 12) {
  1872. msg = '您确定要下载答题卡嘛?';
  1873. } else if(flag == 11){
  1874. msg = '您确定要下载试卷嘛?';
  1875. }
  1876. layer.msg(msg, {
  1877. time: 0,
  1878. btn: ['确定', '取消'],
  1879. yes: function(index){
  1880. layer.close(index);
  1881. $.post('<?php echo $this->createUrl('print/createtempelate');?>',{"eid":eid,"flag":flag},function(data){
  1882. var obj = JSON.parse(data);
  1883. if (obj.success == 1) {
  1884. if(flag == 11){
  1885. evaluationClient.CreateSubjectPaperTiGan(JSON.stringify(obj.object));
  1886. }else if(flag == 12){
  1887. evaluationClient.CreateSubjectWordTiKa(JSON.stringify(obj.object));
  1888. }else{
  1889. layer.msg("参数错误");
  1890. }
  1891. } else {
  1892. layer.msg(obj.message);
  1893. }
  1894. });
  1895. }
  1896. });
  1897. }
  1898. //发送/取消/重新发送标注
  1899. var flag = true;
  1900. $(".sendLabelTask").bind("click", function () {
  1901. var examId = jQuery(this).attr("examId");
  1902. var examName = jQuery(this).attr("examName");
  1903. var subjectId = jQuery(this).attr("subjectId");
  1904. var createTime = jQuery(this).attr("createTime");
  1905. var type = jQuery(this).attr("type");
  1906. var status = jQuery(this).attr("status");
  1907. var _this = jQuery(this);
  1908. var isAnswerSheet=$(this).attr('isAnswerSheet');
  1909. var productSwitch=<?php echo $productSwitch?>;
  1910. if(productSwitch==3 && type!='cancel' && (subjectId==3 || subjectId==6 || subjectId==51)){
  1911. sendLabelForSelectType(examId,examName,subjectId,createTime,type,status,_this);
  1912. return false;
  1913. }
  1914. if (type=='cancel') {
  1915. //取消标注
  1916. layer.msg('本次考试不需要后台老师标注吗?', {
  1917. time: 0,
  1918. btn: ['确定', '取消'],
  1919. yes: function (index) {
  1920. _this.removeClass('sendlabeltask');
  1921. _this.unbind();
  1922. layer.close(index);
  1923. if (flag){
  1924. flag = false;
  1925. jQuery.post(
  1926. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  1927. {"examId": examId, "examName": examName, "createTime": createTime, 'type': type,'status':status},
  1928. function (data) {
  1929. data = JSON.parse(data);
  1930. if (data.success == 1) {
  1931. layer.alert('取消成功', {'icon': 1,'closeBtn':0}, function () {
  1932. location.reload();
  1933. });
  1934. }else if (data.success == 2){
  1935. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  1936. location.reload();
  1937. });
  1938. }
  1939. else {
  1940. flag = true;
  1941. layer.msg(data.message);
  1942. }
  1943. }
  1944. );
  1945. }
  1946. }
  1947. });
  1948. }else{
  1949. if(isAnswerSheet!=1){
  1950. layer.msg('请先关联答题卡');
  1951. return false;
  1952. }
  1953. if (flag){
  1954. flag = false;
  1955. indexSend=layer.msg('正在发送,请稍候......',{time:0});
  1956. jQuery.post(
  1957. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  1958. {"examId": examId, "examName": examName, "createTime": createTime,'type': type,'status':status},
  1959. function (data) {
  1960. layer.close(indexSend);
  1961. data = JSON.parse(data);
  1962. if (data.success == 1) {
  1963. layer.msg('发送成功');
  1964. setTimeout(function () {
  1965. location.reload();
  1966. }, 2000);
  1967. }else if (data.success == 2){
  1968. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  1969. location.reload();
  1970. });
  1971. }
  1972. else {
  1973. flag = true;
  1974. layer.msg(data.message);
  1975. }
  1976. }
  1977. );
  1978. }
  1979. }
  1980. });
  1981. //选择发送发注类型
  1982. function sendLabelForSelectType(examId,examName,subjectId,createTime,type,status,_this){
  1983. var str = '<div id="hgc_editor" style="padding:20px 35px;">\
  1984. <p>选择标注类型</p>\
  1985. <span class="selectSendType selected">题库后台标注</span>\
  1986. <span class="selectSendType">学校自主标注</span>\
  1987. <input type="hidden" name="sendType" value="1">\
  1988. </div>';
  1989. layer.open({
  1990. title:'选择标注类型'
  1991. ,area:'740px'
  1992. ,type: 1
  1993. ,offset: 'auto'
  1994. ,content: str
  1995. ,btn: ['确定','取消']
  1996. ,btnAlign: 'c' //按钮居中
  1997. ,shade: 0.6 //不显示遮罩
  1998. ,yes:function(){
  1999. //确定回调
  2000. var sendType=$('input[name=sendType]').val();
  2001. if(sendType==undefined){
  2002. layer.msg('请选择标注类型')
  2003. }else if(sendType==1){
  2004. var sub_id = $('input[name="subject_id"]').val();
  2005. if (sub_id == 3 || sub_id == 6) {
  2006. var str = '<div id="hgc_editor" style="padding:20px 35px;">\
  2007. <p>请慎重填写该份试卷的备注(可不写)。例如,该年级头几次使用需重视,马上放假需要快速标记等。</p>\
  2008. <textarea style="width:100%;height:200px;resize:vertical;" placeholder="请输入该份试卷的标注要求" class="label-remark"></textarea>\
  2009. </div>';
  2010. layer.open({
  2011. title:'发送标注'
  2012. ,area:'740px'
  2013. ,type: 1
  2014. ,offset: 'auto'
  2015. ,content: str
  2016. ,btn: ['确定','取消']
  2017. ,btnAlign: 'c' //按钮居中
  2018. ,shade: 0.6 //不显示遮罩
  2019. ,yes:function(){
  2020. //确定回调
  2021. sendLabel(examId,examName,createTime,type,status);
  2022. }
  2023. });
  2024. }else{
  2025. sendLabel(examId,examName,createTime,type,status);
  2026. }
  2027. }else if(sendType==2){
  2028. sendLabelToTeacher(examId,type,status)
  2029. }
  2030. }
  2031. });
  2032. }
  2033. //发送标注到题库
  2034. function sendLabel(examId,examName,createTime,type,status) {
  2035. if (flag){
  2036. flag = false;
  2037. indexSend=layer.msg('正在发送,请稍候......',{time:0});
  2038. jQuery.post(
  2039. "<?php echo $this->createUrl("print/sendlabeltask");?>",
  2040. {"examId": examId, "examName": examName, "createTime": createTime,'type': type,'status':status,remark:$(".label-remark").val()},
  2041. function (data) {
  2042. layer.close(indexSend);
  2043. data = JSON.parse(data);
  2044. if (data.success == 1) {
  2045. layer.msg('发送成功');
  2046. setTimeout(function () {
  2047. location.reload();
  2048. }, 2000);
  2049. }else if (data.success == 2){
  2050. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  2051. location.reload();
  2052. });
  2053. }
  2054. else {
  2055. flag = true;
  2056. layer.msg(data.message);
  2057. }
  2058. }
  2059. );
  2060. }
  2061. }
  2062. //发送标注到教师端
  2063. function sendLabelToTeacher(examId,type,status) {
  2064. if (flag){
  2065. flag = false;
  2066. indexSend=layer.msg('正在发送,请稍候......',{time:0});
  2067. jQuery.post(
  2068. "<?php echo $this->createUrl("print/sendLabelToTeacher");?>",
  2069. {"examId": examId,'type': type,'status':status},
  2070. function (data) {
  2071. layer.close(indexSend);
  2072. data = JSON.parse(data);
  2073. if (data.success == 1) {
  2074. layer.msg('发送成功');
  2075. setTimeout(function () {
  2076. location.reload();
  2077. }, 2000);
  2078. }else if (data.success == 2){
  2079. layer.alert(data.message, {'icon': 1,'closeBtn':0}, function () {
  2080. location.reload();
  2081. });
  2082. }
  2083. else {
  2084. flag = true;
  2085. layer.msg(data.message);
  2086. }
  2087. }
  2088. );
  2089. }
  2090. }
  2091. //扫描在线答题卡
  2092. function createTemplateScanOnline(exam_group_id,obj,exam_name,import_type){
  2093. if (!exam_group_id) {
  2094. layer.msg('未找到试卷ID');
  2095. }
  2096. if($(obj).hasClass('disabled')){
  2097. return false;
  2098. }
  2099. var data={
  2100. exam_group_id:exam_group_id
  2101. }
  2102. $.post("<?php echo Yii::app()->createUrl("print/getOnlineCard")?>",data,function(rs){
  2103. var m = JSON.parse(rs);
  2104. if(m.status==1)
  2105. {
  2106. $(obj).addClass('disabled');
  2107. if(import_type>0){
  2108. evaluationClient.ImportOnLineAnswerCard_M_Subject(exam_group_id+","+exam_name+","+<?php echo Yii::app()->session['session_duoxueke_subject_id']?>);
  2109. }else{
  2110. evaluationClient.OnLineAnswerCard_M_Subject(exam_group_id+","+exam_name+","+<?php echo Yii::app()->session['session_duoxueke_subject_id']?>);
  2111. }
  2112. }else {
  2113. layer.msg('尚未创建在线答题卡,请创建');
  2114. }
  2115. });
  2116. }
  2117. $('.exam_export').click(function(){
  2118. eid=$(this).attr('eid');
  2119. data={examGroupId:eid}
  2120. $.post("<?php echo Yii::app()->createUrl('print/exportExamData')?>",data,function(flags){
  2121. var m = JSON.parse(flags);
  2122. if(m.status==1)
  2123. {
  2124. var html = ""+
  2125. '<div style="padding:20px 30px 0px 30px">'+
  2126. '<div style="padding:8px 0;">请复制下方链接打印包。</div>'+
  2127. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  2128. '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
  2129. '</div>'+
  2130. '</div>'+
  2131. "";
  2132. //
  2133. layer.open({
  2134. type: 1,
  2135. area: ['550px', '220px'],
  2136. title: '下载',
  2137. content: html,
  2138. success: function(index, layerObj){
  2139. $(".loading-pop").hide();
  2140. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+m.data+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  2141. jQuery("#confirm, #cancel").on("click", function(){
  2142. layer.close(layerObj);
  2143. });
  2144. jQuery("#copy").on("click", function(){
  2145. jQuery("#url").select();
  2146. });
  2147. },
  2148. end: function(){
  2149. }
  2150. });
  2151. return;
  2152. }else if(m.status==2) {
  2153. layer.msg('数据正在生成中,请稍侯点击导出下载');
  2154. }else{
  2155. layer.msg(m.result);
  2156. }
  2157. });
  2158. });
  2159. </script>