智慧校园考试-班级报告
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

preface.js 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. $(function () {
  2. function getGradeName(gradeid) {
  3. var gradename = "";
  4. if (gradeid == 1) {
  5. gradename = "一年级";
  6. } else if (gradeid == 2) {
  7. gradename = "二年级";
  8. } else if (gradeid == 3) {
  9. gradename = "三年级";
  10. } else if (gradeid == 4) {
  11. gradename = "四年级";
  12. } else if (gradeid == 5) {
  13. gradename = "五年级";
  14. } else if (gradeid == 6) {
  15. gradename = "六年级";
  16. } else if (gradeid == 7) {
  17. gradename = "七年级";
  18. } else if (gradeid == 8) {
  19. gradename = "八年级";
  20. } else if (gradeid == 9) {
  21. gradename = "九年级";
  22. } else if (gradeid == 10) {
  23. gradename = "高一";
  24. } else if (gradeid == 11) {
  25. gradename = "高二";
  26. } else if (gradeid == 12) {
  27. gradename = "高三";
  28. }
  29. return gradename;
  30. };
  31. // 考试类型 10期末20期中30月考40周考
  32. function getExamTypeName(examtype) {
  33. var examname = "";
  34. if (examtype == 10) {
  35. examname = "期末";
  36. } else if (examtype == 20) {
  37. examname = "期中";
  38. } else if (examtype == 30) {
  39. examname = "月考";
  40. } else if (examtype == 40) {
  41. examname = "周考";
  42. }
  43. return examname;
  44. };
  45. // outerHeight(true) 高度为 height+margin+padding+border
  46. var parameter = JSON.parse($(".preface_html_root").data("page-params"));
  47. var gradename = getGradeName(parameter.ksgk.gradeid);
  48. var examname = getExamTypeName(parameter.ksgk.examtype);
  49. $(".preface .gradename").text(gradename);
  50. $(".preface .examtype").text(examname);
  51. $(".preface .classnum").text(parameter.ksgk.classnum);
  52. $(".preface .subjectnum").text(parameter.ksgk.subjectnum);
  53. $(".preface .allscore").text(parameter.ksgk.allscore);
  54. $(".preface .stunum").text(parameter.ksgk.stunum);
  55. $(".preface .qkunum").text(parameter.ksgk.missnum);
  56. $(".preface .sjnum").text(parameter.ksgk.stunum);
  57. $(".preface .maxscore").text(parameter.ksgk.maxscore);
  58. $(".preface .avgscore").text(parameter.ksgk.avgscore);
  59. var arr = $.grep(parameter.fsdjtj, function (value) {
  60. return value.ranktype == 1 && value.subjectid == "zf";
  61. });
  62. var html = "";
  63. $.each(arr, function (idx, item) {
  64. html += '<div class="preface_content_line">本次考试' +
  65. item.rankname +
  66. '类上线分值' +
  67. item.rankrange +
  68. ',上线率' +
  69. item.sturate + '%,上线人数 ' +
  70. item.stunum +
  71. '人;</div>'
  72. });
  73. $(".preface .preface_djfx").html(html);
  74. });