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.
 
 
 
 
 
 

78 line
3.2 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2019-04-23 15:50
  5. * 描 述:教师问卷管理
  6. */
  7. var refreshGirdData;
  8. var VID = request("VID");
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.warpper').lrscroll();
  14. page.bind();
  15. },
  16. bind: function () {
  17. $('.shenBtn').click(function () {
  18. $('#AskPaper').trigger("validate");
  19. });
  20. //单选框
  21. $('.shenInputBox').on('click',
  22. '.inputRadio',
  23. function () {
  24. if (!$(this).hasClass('active')) {
  25. $(this).addClass('active').parents('.shenInputBox').find('.inputRadio').not($(this))
  26. .removeClass('active');
  27. judgeRideo($(this));
  28. }
  29. });
  30. //多选框
  31. $('.inputCheck').click(function () {
  32. if ($(this).hasClass('active')) {
  33. $(this).removeClass('active');
  34. } else {
  35. $(this).addClass('active');
  36. }
  37. judgeRideo($(this));
  38. });
  39. //是否为其他选项判断
  40. function judgeRideo(obj) {
  41. var parents = obj.parents('.signSec2Box');
  42. var inputs = parents.find('.shenInput3');
  43. if (parents.find("i[hasinput='yes']").hasClass('active')) {
  44. inputs.css({ display: 'block' });
  45. } else {
  46. inputs.css({ display: 'none' });
  47. }
  48. }
  49. $('#AskPaper').validator({
  50. timely: 2,
  51. theme: 'yellow_right_effect',
  52. valid: function (form) {
  53. learun.layerConfirm('是否确认提交答案?', function (res) {
  54. var answerlist = new Array();
  55. var strStuNo = $("#EmpNo").val();
  56. var strStuName = $("#EmpName").val();
  57. $(form).find("input.xuanze:checked").each(function (index, element) {
  58. var itemvalue = { QID: $(this).attr("qid"), IID: $(this).attr("id"), UText: "", UID: strStuNo, UName:strStuName};
  59. if ($(this).attr("hasinput")=="yes") {
  60. itemvalue.UText = $("#" + $(this).attr("id") + "Other").val();
  61. }
  62. answerlist.push(itemvalue);
  63. });
  64. if (res) {
  65. learun.postForm(top.$.rootUrl + '/Ask/Ask_MainOfTeacher/TeacherSubmitForm', { answerlist: JSON.stringify(answerlist), VID: VID, "__RequestVerificationToken": $.lrToken }, function () {
  66. learun.frameTab.parentIframe().refreshGirdData();
  67. learun.frameTab.close("paper" + VID);
  68. });
  69. }
  70. });
  71. }
  72. });
  73. }
  74. };
  75. page.init();
  76. }