智慧校园考试-班级报告
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

section_2.js 16KB

1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. $(function () {
  2. function initaveragescoreEcharts(list, s_index) {
  3. var itemStyle = {
  4. normal: {
  5. label: {
  6. show: true, //开启显示数值
  7. position: "top" //数值在上方显示
  8. }
  9. }
  10. };
  11. var avgscore = [],
  12. xAxis_data = [],
  13. totalScore = 0;
  14. var curlegend = ["平均分"];
  15. $.each(list.pjf, function (idx, item) {
  16. totalScore += item.classavgscore;
  17. avgscore.push(item.classavgscore);
  18. xAxis_data.push(item.classname);
  19. });
  20. var gradeAvgScore = Math.floor(totalScore / xAxis_data.length);
  21. var curseries = [
  22. {
  23. name: "平均分",
  24. type: "bar",
  25. barWidth: $.UnitUtil.mm2px(5),
  26. // 柱状图最小高度
  27. barMinHeight: $.UnitUtil.mm2px(2),
  28. barGap: 0,
  29. data: avgscore,
  30. itemStyle: itemStyle,
  31. markLine: {
  32. precision: 0,
  33. data: [{ type: "average", name: "平均值" }],
  34. itemStyle: {
  35. normal: {
  36. lineStyle: {
  37. color: "#ff001e",
  38. type: "dotted"
  39. },
  40. label: {
  41. show: true,
  42. color: "#ff001e",
  43. position: "insideEndTop",
  44. formatter: function () {
  45. return "年级平均分:" + gradeAvgScore;
  46. }
  47. }
  48. }
  49. },
  50. large: true
  51. },
  52. z: 10
  53. }
  54. ];
  55. var option = {
  56. animation: false,
  57. color: ["#5C99FF", "#FF5F56", "#5EC5C8", "#f1982b"],
  58. title: {
  59. text: "分",
  60. x: "left",
  61. y: "top",
  62. textStyle: {
  63. color: "#5F6E82",
  64. fontSize: $.UnitUtil.mm2px(3),
  65. fontWeight: 500
  66. }
  67. },
  68. legend: {
  69. itemWidth: $.UnitUtil.mm2px(2),
  70. itemHeight: $.UnitUtil.mm2px(2),
  71. top: "bottom",
  72. data: curlegend
  73. },
  74. grid: {
  75. top: $.UnitUtil.mm2px(10),
  76. left: 0,
  77. right: 0,
  78. bottom: $.UnitUtil.mm2px(8),
  79. containLabel: true
  80. },
  81. xAxis: [
  82. {
  83. type: "category",
  84. data: xAxis_data,
  85. axisLabel: {
  86. color: "#5F6E82" //更改坐标轴文字颜色
  87. },
  88. axisTick: {
  89. alignWithLabel: true
  90. },
  91. boundaryGap: true,
  92. triggerEvent: true,
  93. axisLine: {
  94. show: true, //是否显示轴线
  95. lineStyle: {
  96. color: "#DADADA" //刻度线的颜色
  97. }
  98. }
  99. }
  100. ],
  101. yAxis: [
  102. {
  103. type: "value",
  104. axisTick: {
  105. show: false //刻度
  106. },
  107. axisLine: {
  108. show: false, //是否显示轴线
  109. lineStyle: {
  110. color: "#DADADA" //刻度线的颜色
  111. }
  112. },
  113. splitLine: {
  114. //网格线
  115. lineStyle: {
  116. type: "dotted" //设置网格线类型 dotted:虚线 solid:实线
  117. },
  118. show: true //隐藏或显示
  119. },
  120. axisLabel: {
  121. color: "#5F6E82" //更改坐标轴文字颜色
  122. }
  123. }
  124. ],
  125. series: curseries
  126. };
  127. var myEcharts = echarts.init(
  128. $(".section2.sectiontwo_" + s_index + " #averagescoreEcharts")[0]
  129. );
  130. myEcharts.clear();
  131. myEcharts.setOption(option);
  132. }
  133. function achievementdistributiontable(list, s_index) {
  134. var table = "",
  135. goodTableHeadTr1Html =
  136. '<th class="dj">等级</th><th class="pm">排名(年级/名)</th><th class="dj">人数</th><th class="comm">详情</th>',
  137. trHtml = "";
  138. $.each(list.djtj, function (idx, item) {
  139. var stujson = JSON.parse(item.stujson),
  140. stuarr = "";
  141. $.each(stujson, function (index, items) {
  142. stuarr += items.studentname + "(" + items.schoolrank + "名)、";
  143. });
  144. stuarr = stuarr.substr(0, stuarr.length - 1);
  145. trHtml +=
  146. "<tr><td>" +
  147. item.rankname +
  148. "类</td><td>" +
  149. item.rankrange +
  150. "</td><td>" +
  151. item.stunum +
  152. "</td><td>" +
  153. stuarr +
  154. "</td></tr>";
  155. });
  156. table =
  157. '<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
  158. goodTableHeadTr1Html +
  159. '</tr></thead><tbody class="goodTableTbody">' +
  160. trHtml +
  161. "</tbody></table>";
  162. $(".section2.sectiontwo_" + s_index + " .achievementdistribution").html(
  163. table
  164. );
  165. }
  166. function progresstable (list, s_index) {
  167. if(s_index !=0) return
  168. var table = "",
  169. trHtml = { 1: "", 2: "" };
  170. var cjdjheight =
  171. $(".section2_1.sectiontwo_" + s_index + " .cjdjheight").height() - 454;//454
  172. var surplus = pageheight - cjdjheight; //本页剩余高度
  173. var height = 0,
  174. page = { 1: "", 2: "" },
  175. ispage = false;
  176. $.each(list.dfjb, function (idx, item) {
  177. if (idx % 2 == 0) {
  178. height += 27.5;
  179. if (height > surplus && surplus - height < 27.5) {
  180. ispage = true;
  181. }
  182. if (ispage) {
  183. trHtml[2] +=
  184. "<tr><td>" +
  185. (idx + 1) +
  186. "</td><td>" +
  187. item.username +
  188. "</td><td>" +
  189. item.score +
  190. "分</td><td>第" +
  191. item.classrank +
  192. '名</td><td class="green">进步' +
  193. item.classrankpre +
  194. "名</td>";
  195. } else {
  196. trHtml[1] +=
  197. "<tr><td>" +
  198. (idx + 1) +
  199. "</td><td>" +
  200. item.username +
  201. "</td><td>" +
  202. item.score +
  203. "分</td><td>第" +
  204. item.classrank +
  205. '名</td><td class="green">进步' +
  206. item.classrankpre +
  207. "名</td>";
  208. }
  209. } else {
  210. if (ispage) {
  211. trHtml[2] +=
  212. "<td>" +
  213. (idx + 1) +
  214. "</td><td>" +
  215. item.username +
  216. "</td><td>" +
  217. item.score +
  218. "分</td><td>第" +
  219. item.classrank +
  220. '名</td><td class="green">进步' +
  221. item.classrankpre +
  222. "名</td>";
  223. } else {
  224. trHtml[1] +=
  225. "<td>" +
  226. (idx + 1) +
  227. "</td><td>" +
  228. item.username +
  229. "</td><td>" +
  230. item.score +
  231. "分</td><td>第" +
  232. item.classrank +
  233. '名</td><td class="green">进步' +
  234. item.classrankpre +
  235. "名</td>";
  236. }
  237. }
  238. });
  239. for (var i = 1; i < 3; i++) {
  240. page[i] =
  241. '<table border="1" class="my_table"><tbody class="goodTableTbody">' +
  242. trHtml[i] +
  243. "</tbody></table>";
  244. }
  245. $(".section2_1.sectiontwo_" + s_index + " .progress").html(page[1]);
  246. if (ispage) {
  247. //添加第二页
  248. $(".section2_1.sectiontwo_" + s_index).after(
  249. '<div class="page_root section2 sectiontwo_' +
  250. s_index +
  251. ' section2_2"></div>'
  252. );
  253. $(".section2_2.sectiontwo_" + s_index).html(page[2]);
  254. }
  255. }
  256. function retrogression(list, s_index) {
  257. var trHtml = "",
  258. table = "";
  259. $.each(list.dftb, function (idx, item) {
  260. item.classrankpre = Math.abs(item.classrankpre);
  261. if (idx % 2 == 0) {
  262. trHtml +=
  263. "<tr><td>" +
  264. (idx + 1) +
  265. "</td><td>" +
  266. item.username +
  267. "</td><td>" +
  268. item.score +
  269. "分</td><td>第" +
  270. item.classrank +
  271. '名</td><td class="red">退步' +
  272. item.classrankpre +
  273. "名</td>";
  274. } else {
  275. trHtml +=
  276. "<td>" +
  277. (idx + 1) +
  278. "</td><td>" +
  279. item.username +
  280. "</td><td>" +
  281. item.score +
  282. "分</td><td>第" +
  283. item.classrank +
  284. '名</td><td class="red">退步' +
  285. item.classrankpre +
  286. "名</td>";
  287. }
  288. });
  289. var table =
  290. '<table border="1" class="my_table"><tbody class="goodTableTbody">' +
  291. trHtml +
  292. "</tbody></table>";
  293. $(".section2.sectiontwo_" + s_index + " .retrogression").html(table);
  294. }
  295. function critical(list, s_index) {
  296. var trHtml = "",
  297. table = "";
  298. $.each(list.ljs, function (idx, item) {
  299. if (idx % 2 == 0) {
  300. trHtml +=
  301. "<tr><td>" +
  302. (idx + 1) +
  303. "</td><td>" +
  304. item.username +
  305. "</td><td>" +
  306. item.score +
  307. "分</td><td>第" +
  308. item.classrank +
  309. '分</td><td class="red">' +
  310. item.classrankpre +
  311. "分</td>";
  312. } else {
  313. trHtml +=
  314. "<td>" +
  315. (idx + 1) +
  316. "</td><td>" +
  317. item.username +
  318. "</td><td>" +
  319. item.score +
  320. "分</td><td>第" +
  321. item.classrank +
  322. '分</td><td class="red">' +
  323. item.classrankpre +
  324. "分</td>";
  325. }
  326. });
  327. var table =
  328. '<table border="1" class="my_table"><tbody class="goodTableTbody">' +
  329. trHtml +
  330. "</tbody></table>";
  331. $(".section2.sectiontwo_" + s_index + " .critical").html(table);
  332. }
  333. function wave(list, s_index) {
  334. var trHtml = "",
  335. table = "";
  336. $.each(list.bds, function (idx, item) {
  337. var curdata = {
  338. class: "red",
  339. name: "退步"
  340. };
  341. if (item.classrankpre > 0) {
  342. curdata = {
  343. class: "green",
  344. name: "进步"
  345. };
  346. }
  347. item.classrankpre = Math.abs(item.classrankpre);
  348. if (idx % 2 == 0) {
  349. trHtml +=
  350. "<tr><td>" +
  351. (idx + 1) +
  352. "</td><td>" +
  353. item.username +
  354. "</td><td>" +
  355. item.score +
  356. "分</td><td>" +
  357. item.classrank +
  358. '分</td><td class="' +
  359. curdata.class +
  360. '">' +
  361. curdata.name +
  362. item.classrankpre +
  363. "名</td>";
  364. } else {
  365. trHtml +=
  366. "<td>" +
  367. (idx + 1) +
  368. "</td><td>" +
  369. item.username +
  370. "</td><td>" +
  371. item.score +
  372. "分</td><td>" +
  373. item.classrank +
  374. '分</td><td class="' +
  375. curdata.class +
  376. '">' +
  377. curdata.name +
  378. item.classrankpre +
  379. "名</td>";
  380. }
  381. });
  382. var table =
  383. '<table border="1" class="my_table"><tbody class="goodTableTbody">' +
  384. trHtml +
  385. "</tbody></table>";
  386. $(".section2.sectiontwo_" + s_index + " .wave").html(table);
  387. }
  388. function errquestion(list, s_index) {
  389. var table = "",
  390. goodTableHeadTr1Html =
  391. "<th>题号</th><th>题型</th><th>知识点</th><th>班级得分率</th><th>年级得分率</th><th>高频错误项</th>",
  392. trHtml = "";
  393. $.each(list.gpctList, function (idx, item) {
  394. item.answer = JSON.parse(item.answer);
  395. var pointnames = item.pointnames[0] || "";
  396. var erroroption = item.erroroption || "--";
  397. trHtml +=
  398. '<tr><td class="word_wrap">第' +
  399. item.qn +
  400. "题</td><td>" +
  401. item.eptname +
  402. "</td><td>" +
  403. pointnames +
  404. "</td><td>" +
  405. item.classsrate +
  406. "%</td><td>" +
  407. item.gradesrate +
  408. "%</td><td>" +
  409. erroroption +
  410. "</td></tr>";
  411. });
  412. table =
  413. '<table border="1" class="my_table"><thead><tr class="goodTableHeadTr1">' +
  414. goodTableHeadTr1Html +
  415. '</tr></thead><tbody class="goodTableTbody">' +
  416. trHtml +
  417. "</tbody></table>";
  418. $(".section2.sectiontwo_" + s_index + " .errquestion").html(table);
  419. }
  420. var parameter = $(".section_2_html_root").data("page-params");
  421. parameter = JSON.parse(parameter);
  422. var html = "";
  423. $.each(parameter, function (s_index, item) {
  424. html +=
  425. ' <div class="page_root section2 sectiontwo_' +
  426. s_index +
  427. '">' +
  428. (s_index === 0
  429. ? '<h1 class="section_title_1">第二章 单科概况</h1><div class="abstract_box"><div class="abstract_left"><img src="/img/img2.png" /></div><div class="abstract_right"><div class="abstract_content">从学校和数据的角度分析整体科目、整体班级及各科各班之间的水平和差异情况,系统从多个维度的数据进行对比分析,包括<strong> 满分、最高分、平均分、最低分、四率、参考人数、标准差。</strong ></div ></div ></div >'
  430. : "") +
  431. '<h1 class="subjectinfo">' +
  432. item.subjectname +
  433. '概况</h1><div class="section_title_3 jj">本次报告是结合学生语文学科成绩,进行深层分析,很好地反映了全部学生阶段性的教学成果和存在的问题。学生整体表现大致如下:</div><h2 class="section_title_2">1.总览</h2><div class="section_list"><div class="section_item"><div class="item_num"><span class="classavgscore"></span>分</div><div class="item_title">平均分</div></div><div class="section_item"><div class="item_num"><span class="classavgscorerank"></span>名</div><div class="item_title">平均分排名</div></div><div class="section_item"><div class="item_num"><span class="yxrate"></span>%</div><div class="item_title">优秀率</div></div><div class="section_item"><div class="item_num"><span class="jgrate"></span>%</div><div class="item_title">及格率</div></div><div class="section_item" style="margin-right: 0"><div class="item_num"><span class="classmaxscore"></span>分</div><div class="item_title">最高分</div></div></div><div style="margin-bottom: 4mm; font-size: 4mm">全校平均分:<span class="schoolavgscore blue"></span>分<spanclass="line"></spanclass=>全校最高分:<span class="schoolmaxscore blue"></span>分</div><h2 class="section_title_2">2.学科平均分对比</h2><div id="averagescoreEcharts" style="margin: 0 4mm 4mm; height: 80mm"></div></div><div class="page_root section2 section2_1 sectiontwo_' +
  434. s_index +
  435. '"><div class="cjdjheight"><h2 class="section_title_2">3.成绩等级分布</h2><div class="achievementdistribution"></div><h2 class="section_title_2">4.需关注学生</h2><h3 class="section_title_3">4.1 大幅进步分布</h3></div><div class="progress multicolumn"></div></div><div class="page_root section2 sectiontwo_' +
  436. s_index +
  437. '"><h3 class="section_title_3">4.2 大幅退步分布</h3><div class="retrogression"></div></div><div class="page_root section2 sectiontwo_' +
  438. s_index +
  439. '"><h3 class="section_title_3">4.3 临界生分布</h3><div class="critical"></div></div><div class="page_root section2 sectiontwo_' +
  440. s_index +
  441. '"><h3 class="section_title_3">4.4 波动生分布</h3><div class="wave"></div></div><div class="page_root section2 sectiontwo_' +
  442. s_index +
  443. '"><h2 class="section_title_2">5.高频错题分析</h2><div class="errquestion"></div></div>';
  444. });
  445. $(".ChapterTwo").html(html);
  446. $.each(parameter, function (s_index, item) {
  447. $(".section2.sectiontwo_" + s_index + " .classavgscore").text(
  448. item.classavgscore
  449. );
  450. $(".section2.sectiontwo_" + s_index + " .classavgscorerank").text(
  451. item.classavgscorerank
  452. );
  453. $(".section2.sectiontwo_" + s_index + " .yxrate").text(item.yxrate);
  454. $(".section2.sectiontwo_" + s_index + " .jgrate").text(item.jgrate);
  455. $(".section2.sectiontwo_" + s_index + " .classmaxscore").text(
  456. item.classmaxscore
  457. );
  458. $(".section2.sectiontwo_" + s_index + " .schoolavgscore").text(
  459. item.schoolavgscore
  460. );
  461. $(".section2.sectiontwo_" + s_index + " .schoolmaxscore").text(
  462. item.schoolmaxscore
  463. );
  464. initaveragescoreEcharts(item, s_index);
  465. achievementdistributiontable(item, s_index);
  466. progresstable(item, s_index);
  467. retrogression(item, s_index);
  468. critical(item, s_index);
  469. wave(item, s_index);
  470. errquestion(item, s_index);
  471. // document.documentElement.scrollTop = 8500;
  472. });
  473. });