/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) * Copyright (c) 2013-2018 北京泉江科技有限公司 * 创建人:超级管理员 * 日 期:2019-04-23 15:50 * 描 述:问卷管理 */ var refreshGirdData; var VID = request("VID"); var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { $('.warpper').lrscroll(); page.bind(); }, bind: function () { $('.shenBtn').click(function () { $('#AskPaper').trigger("validate"); }); //单选框 $('.shenInputBox').on('click', '.inputRadio', function () { if (!$(this).hasClass('active')) { $(this).addClass('active').parents('.shenInputBox').find('.inputRadio').not($(this)) .removeClass('active'); judgeRideo($(this)); } }); //多选框 $('.inputCheck').click(function () { if ($(this).hasClass('active')) { $(this).removeClass('active'); } else { $(this).addClass('active'); } judgeRideo($(this)); }); //是否为其他选项判断 function judgeRideo(obj) { var parents = obj.parents('.signSec2Box'); var inputs = parents.find('.shenInput3'); if (parents.find("i[hasinput='yes']").hasClass('active')) { inputs.css({ display: 'block' }); } else { inputs.css({ display: 'none' }); } } $('#AskPaper').validator({ timely: 2, theme: 'yellow_right_effect', valid: function (form) { learun.layerConfirm('是否确认提交答案?', function (res) { var answerlist = new Array(); var strStuNo = $("#StuNo").val(); var strStuName = $("#StuName").val(); $(form).find("input.xuanze:checked").each(function (index, element) { var itemvalue = { QID: $(this).attr("qid"), IID: $(this).attr("id"), UText: "", UID: strStuNo, UName:strStuName}; if ($(this).attr("hasinput")=="yes") { itemvalue.UText = $("#" + $(this).attr("id") + "Other").val(); } answerlist.push(itemvalue); }); if (res) { learun.postForm(top.$.rootUrl + '/Ask/Ask_Main/StudentSubmitForm', { answerlist: JSON.stringify(answerlist), VID: VID, "__RequestVerificationToken": $.lrToken }, function () { learun.frameTab.parentIframe().refreshGirdData(); learun.frameTab.close("paper" + VID); }); } }); } }); } }; page.init(); }