| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546 |
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pageredit.aspx.cs" Inherits="HySoft.BaseCallCenter.Web.askmanage.pageredit" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>编辑试题</title>
- <link href="/scripts/ui/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="/scripts/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
- <script src="/scripts/ui/json2.js" type="text/javascript"></script>
- <script src="/scripts/ui/js/core/base.js" type="text/javascript"></script>
- <script src="/scripts/ui/js/ligerui.min.js" type="text/javascript"></script>
- <script src="/scripts/ui/js/plugins/ligerTextBox.js" type="text/javascript"></script>
- <script src="/scripts/ui/js/plugins/ligerSpinner.js" type="text/javascript"></script>
- <script src="/scripts/function.js" type="text/javascript"></script>
- <script src="/scripts/utils.js" type="text/javascript"></script>
- <script src="/scripts/ui/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
- <link href="/scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
- <link href="/images/style.css" rel="stylesheet" type="text/css" />
- <link href="/scripts/ui/skins/Tab/css/grid.css" rel="stylesheet" type="text/css" />
- <link href="/scripts/ui/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
- <style type="text/css">
- .l-toolbar
- {
- background: none;
- height: 23px;
- border: 0px solid #9CBAE7;
- border-top: 0px solid #EFF7F7;
- }
- .tools_box
- {
- border: 1px solid #D6D6D6;
- border-bottom: 0px;
- }
- </style>
- <script type="text/javascript">
- var sort = 0;
- var itemcount = 0;
- var questionlist;
- var selectlist;
- function CloseThis() {
- parent.SaveRes();
- }
- function ResetWidth() {
- try {
- var fwidth = $("#form1").width() * 0.5;
- document.getElementById("divQuestionList").style.width = fwidth;
- document.getElementById("divSelectList").style.width = fwidth-20;
- questionlist.reload();
- selectlist.reload();
- //LoadQuestionList();
- //LoadSelectList();
- //questionlist.setWidth(fwidth);
- //selectlist.setWidth(fwidth);
- //questionlist.setColumnWidth('_f_title', 80);
- }
- catch (e)
- { }
- }
- $(function () {
- var a = $("#navtab1").ligerTab({
- showSwitch: false,
- contextmenu: false,
- onAfterSelectTabItem: function (targettabid) {
- }
- });
- LoadQuestionList();
- LoadSelectList();
- $("#pageloading_bg,#pageloading").hide();
- });
- function LoadQuestionList() {
- var fwidth = $("#form1").width() * 0.5;
- var selectcategoryid = document.getElementById("dropQuestionCategory").value;
- var selecttype = document.getElementById("dropQuestionType").value;
- var key = escape(document.getElementById("txtKeywords").value);
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- questionlist = $("#divQuestionList").ligerGrid({
- height: 236,
- width: fwidth,
- checkbox: true,
- columns: [
- { display: '操作', width: '35', frozen: true, name: '_f_questionid', render: function (rowdata, rowindex, value) {
- return "<img src='../scripts/ui/skins/icons/right.png' onclick='SelectInItem(\"" + rowdata._f_questionid + "\");' style='width:20px;cursor:hand;' title='选入' />";
- }
- },
- { display: '试题标题', align: 'left', width: '150', frozen: true, name: '_f_title' },
- { display: '试题类型', width: '80', name: '_f_type', render: function (rowdata, rowindex, value) {
- if (value == "1")
- return "<img src='../images/help_question_mark_24.png' style='width:18px' /> <font color='red'>问答题</font>";
- else if (value == "2")
- return "<img src='../images/radio_button_off_16.png' style='width:16px' /> <font color='green'>单选题</font>";
- else if (value == "3")
- return "<img src='../images/check_box_24.png' style='width:18px' /> <font color='blue'>多选题</font>";
- else
- return "";
- }
- },
- { display: '试题分类', width: '120', name: '_f_categoryname' },
- { display: '试题内容', align: 'left', width: '550', name: '_f_content' }
- ],
- toolbar: {
- items: [
- { text: '增加', click: itemclick2, icon: 'add' },
- { line: true },
- { text: '修改', click: itemclick2, icon: 'modify' },
- { line: true },
- { text: '删除', click: itemclick2, icon: 'delete' },
- { line: true },
- { text: '选入', click: itemclick2, icon: 'rightall' }
- ]
- },
- url: 'ajax/question.ashx?action=getlistbypager&pagerid=' + id + '&userid=' + userid + '&categoryid=' + selectcategoryid + '&selecttype=' + selecttype + '&key=' + key, pageSize: 50, pageSizeOptions: [10, 20, 50], rownumbers: true,
- onSelectRow: function (data, rowindex, rowobj) {
- },
- onDblClickRow: function (data, rowindex, rowobj) {
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "修改试题";
- try {
- id = data._f_questionid;
- vtitle = "【<font color='red'>" + data._f_title + "</font>】修改试题";
- }
- catch (e) {
- }
- if (id != "") {
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=modify&id=' + id, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的试题,请选择');
- }
- }
- });
- $("#pageloading").hide();
- }
- function itemclick2(item) {
- switch (item.icon) {
- case "add":
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "添加试题";
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=new&categoryid=' + id + '&selecttype=' + selecttype, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- break;
- case "modify":
- var vheight = $("#form1").height() - 30;
- var vwidth = $("#form1").width() * 0.9;
- if (vwidth > 700) {
- vwidth = 700;
- }
- var id = "";
- var vtitle = "修改试题";
- var rowobj;
- try {
- rowobj = questionlist.getSelectedRow();
- id = rowobj._f_questionid;
- vtitle = "【<font color='red'>" + rowobj._f_title + "</font>】修改试题";
- }
- catch (e) {
- }
- if (id != "") {
- var selecttype = document.getElementById("dropQuestionType").value;
- $.ligerDialog.open({ url: 'questionedit.aspx?otype=modify&id=' + id, title: vtitle, height: vheight, width: vwidth, isResize: true
- });
- }
- else {
- $.ligerDialog.error('没有选择要修改的试题,请选择');
- }
- break;
- case "delete":
- var id = "";
- var rowobj;
- try {
- rowobj = questionlist.getSelectedRow();
- id = rowobj._f_questionid;
- }
- catch (e) {
- }
- if (id != "") {
- $.ligerDialog.confirm('确定要删除【<font color="red">' + rowobj._f_title + '</font>】试题吗?', function (yes) {
- if (yes) {
- $.post("ajax/question.ashx?action=delete&id=" + id, function (data) {
- if (data == "success") {
- $.ligerDialog.success('删除成功');
- LoadQuestionList();
- }
- else {
- $.ligerDialog.error('删除失败');
- }
- });
- }
- });
- }
- else {
- $.ligerDialog.error('没有选择要删除的试题,请选择');
- }
- break;
- case "help":
- break;
- case "rightall":
- SelectAllInItem();
- break;
- case "leftall":
- SelectAllOutItem();
- break;
- }
- }
- function LoadSelectList() {
- // var selectcategoryid = document.getElementById("dropQuestionCategory").value;
- // var selecttype = document.getElementById("dropQuestionType").value;
- // var key = escape(document.getElementById("txtKeywords").value);
- // var arrid = document.getElementById("txtArrid").value;
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- var fwidth = $("#form1").width() * 0.5-20;
- selectlist = $("#divSelectList").ligerGrid({
- height: 236,
- width: fwidth,
- checkbox: true,
- columns: [
- { display: '操作', width: '35', frozen: true, name: '_f_questionid', render: function (rowdata, rowindex, value) {
- return "<img src='../scripts/ui/skins/icons/left.png' onclick='SelectOutItem(\"" + rowdata._f_itemid + "\");' style='width:20px;cursor:hand;' title='移除' />";
- }
- },
- { display: '排序', width: '50', align: 'left', frozen: true, name: '_f_sort', render: function (rowdata, rowindex, value) {
- if (value > sort) {
- sort = value;
- }
- if (rowindex == 0)
- return " <img id='xy_" + rowindex + "' onclick='MoveItem(\"" + rowdata._f_itemid + "\",\"" + value + "\",\"1\");' src='../images/icon_desc.gif' title='下移' style='width:12px; cursor:hand;' />";
- else
- return " <img id='sy_" + rowindex + "' onclick='MoveItem(\"" + rowdata._f_itemid + "\",\"" + value + "\",\"-1\");' src='../images/icon_asc.gif' title='上移' style='width:12px; cursor:hand;' /> <img id='xy_" + rowindex + "' onclick='MoveItem(\"" + rowdata._f_itemid + "\",\"" + value + "\",\"1\");' src='../images/icon_desc.gif' title='下移' style='width:12px; cursor:hand;' />";
- }
- },
- { display: '试题标题', align: 'left', frozen: true, width: '150', name: '_f_title' },
- { display: '试题类型', width: '80', name: '_f_type', render: function (rowdata, rowindex, value) {
- if (value == "1")
- return "<img src='../images/help_question_mark_24.png' style='width:18px' /> <font color='red'>问答题</font>";
- else if (value == "2")
- return "<img src='../images/radio_button_off_16.png' style='width:16px' /> <font color='green'>单选题</font>";
- else if (value == "3")
- return "<img src='../images/check_box_24.png' style='width:18px' /> <font color='blue'>多选题</font>";
- else
- return "";
- }
- },
- { display: '试题分类', width: '120', name: '_f_categoryname' },
- { display: '试题内容', align: 'left', width: '550', name: '_f_content' }
- ],
- toolbar: {
- items: [
- { text: '选出', click: itemclick2, icon: 'leftall' },
- { line: true },
- { text: '<span id="spanAllSelect" style="color:red">共有0个问题</span>', click: itemclick2, icon: 'help' }
- ]
- },
- url: 'ajax/question.ashx?action=getselectlist&pagerid=' + id + '&userid=' + userid, pageSize: 100, pageSizeOptions: [10, 20, 50, 100], rownumbers: true,
- onSelectRow: function (data, rowindex, rowobj) {
- },
- onAfterShowData: function (data) {
- itemcount = data.Total;
- try {
- document.getElementById("spanAllSelect").innerHTML = "共有" + itemcount + "个问题";
- document.getElementById("txtQuestionCount").value = itemcount;
- }
- catch (e) {
- }
- var imgindex = itemcount - 1;
- try {
- var imgid = "xy_" + imgindex;
- document.getElementById("xy_" + imgindex).style.display = "none";
- }
- catch (e) {
- }
- }
- });
- $("#pageloading").hide();
- }
- function SelectInItem(questionid) {
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- var timeno = new Date().getTime();
- var optaction = "addtemp";
- if (id != "") {
- optaction = "add";
- }
- try {
- $.ajax({
- type: "get",
- url: "ajax/pageritems.ashx?action=" + optaction + "&id=" + id + "&questionid=" + questionid + "&userid=" + userid + "&sort=" + sort + "&timeno=" + timeno,
- dataType: "html",
- success: function (res) {
- if (res == "success") {
- LoadQuestionList();
- LoadSelectList();
- } else {
- $.ligerDialog.error("选入失败");
- }
- }
- });
- }
- catch (e) {
- }
- }
- function SelectOutItem(itemid) {
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- var timeno = new Date().getTime();
- var optaction = "deletetemp";
- if (id != "") {
- optaction = "delete";
- }
- try {
- $.ajax({
- type: "get",
- url: "ajax/pageritems.ashx?action=" + optaction + "&id=" + id + "&itemid=" + itemid + "&userid=" + userid + "&sort=" + sort + "&timeno=" + timeno,
- dataType: "html",
- success: function (res) {
- if (res == "success") {
- LoadQuestionList();
- LoadSelectList();
- } else {
- $.ligerDialog.error("选出失败");
- }
- }
- });
- }
- catch (e) {
- }
- }
- function SelectAllInItem() {
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- var timeno = new Date().getTime();
- var optaction = "addalltemp";
- if (id != "") {
- optaction = "addall";
- }
- try {
- var rows = questionlist.getSelectedRows();
- if (rows.length > 0) {
- var arr = new Array();
- var i = 0;
- for (var i = 0; i < rows.length; i++) {
- arr[i] = rows[i]._f_questionid;
- }
- $.ajax({
- type: "get",
- url: "ajax/pageritems.ashx?action=" + optaction + "&id=" + id + "&arrid=" + arr.toString() + "&userid=" + userid + "&sort=" + sort + "&timeno=" + timeno,
- dataType: "html",
- success: function (res) {
- if (res == "success") {
- LoadQuestionList();
- LoadSelectList();
- } else {
- $.ligerDialog.error("选入失败");
- }
- }
- });
- }
- else {
- $.ligerDialog.error('没有选择要选入的试题');
- }
- }
- catch (e) {
- }
- }
- function SelectAllOutItem() {
- var id = document.getElementById("txtId").value;
- var userid = document.getElementById("txtUserId").value;
- var timeno = new Date().getTime();
- var optaction = "deletealltemp";
- if (id != "") {
- optaction = "deleteall";
- }
- try {
- var rows = selectlist.getSelectedRows();
- if (rows.length > 0) {
- var arr = new Array();
- var i = 0;
- for (var i = 0; i < rows.length; i++) {
- arr[i] = rows[i]._f_itemid;
- }
- $.ajax({
- type: "get",
- url: "ajax/pageritems.ashx?action=" + optaction + "&id=" + id + "&arrid=" + arr.toString() + "&userid=" + userid + "&sort=" + sort + "&timeno=" + timeno,
- dataType: "html",
- success: function (res) {
- if (res == "success") {
- LoadQuestionList();
- LoadSelectList();
- } else {
- $.ligerDialog.error("选出失败");
- }
- }
- });
- }
- else {
- $.ligerDialog.error('没有选择要选出的试题');
- }
- }
- catch (e) {
- }
- }
- function MoveItem(itemid, ssort, type) {
- var id = document.getElementById("txtId").value;
- var timeno = new Date().getTime();
- var optaction = "movetemp";
- if (id != "") {
- optaction = "move";
- }
- try {
- $.ajax({
- type: "get",
- url: "ajax/pageritems.ashx?action=" + optaction + "&pagerid=" + id + "&itemid=" + itemid + "&sort=" + ssort + "&movetype=" + type + "&timeno=" + timeno,
- dataType: "html",
- success: function (res) {
- if (res == "success") {
- LoadSelectList();
- } else {
- $.ligerDialog.error("移动排序失败");
- }
- }
- });
- }
- catch (e) {
- }
- }
- function ShowPagerView() {
- var id = document.getElementById("txtId").value;
- parent.ShowPager(id);
- }
- function validate() {
- var i = 0;
- if (!validate2()) {
- i++;
- }
- if (i > 0) {
- return false;
- }
- return true;
- }
- function validate2() {
- if ($("#txtF_Title").val() == "" || $("#txtF_Title").val() == undefined) {
- document.getElementById("lbF_Title").innerHTML = "* 名称不能为空!";
- document.getElementById("lbF_Title").style.color = "red";
- return false;
- }
- else {
- document.getElementById("lbF_Title").innerHTML = "*";
- document.getElementById("lbF_Title").style.color = "#414141";
- return true;
- }
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:HiddenField ID="hidF_CategoryId" runat="server" Value="" />
- <asp:HiddenField ID="txtUserId" runat="server" Value="0" />
- <asp:HiddenField ID="txtId" runat="server" Value="" />
- <asp:HiddenField ID="txtArrid" runat="server" Value="" />
- <asp:HiddenField ID="txtQuestionCount" runat="server" Value="0" />
- <div id="pageloading">
- 数据加载中,请稍等...
- </div>
- <table class="form_table" style="width: 100%; height: 100%;">
- <colgroup>
- <col width="100" />
- <col />
- </colgroup>
- <tr style="height: 25px;">
- <th style="height: 25px; padding: 0px 8px 0px 0px;">
- 问卷名称:
- </th>
- <td style="height: 25px; padding: 2px 0px 0px 8px;">
- <textarea id="txtF_Title" cols="20" rows="4" runat="server" class="txtInput normal"
- style="width: 380px; height: 30px;"></textarea><label id="lbF_Title" for="txtF_Title"></label>
- </td>
- </tr>
- <tr style="height: 25px;">
- <th style="height: 25px; padding: 0px 8px 0px 0px;">
- 问卷说明:
- </th>
- <td style="height: 25px; padding: 5px 0px 5px 8px;">
- <textarea id="txtF_Remark" cols="20" rows="4" runat="server" class="txtInput normal"
- style="width: 380px; height: 50px;"></textarea>
- </td>
- </tr>
- </table>
- <div id="trSelect" style="width: 99%; text-align: center;">
- <div id="navtab1" style="width: 100%; height: 300px; border: 1px solid #D3D3d3;">
- <div title="选择试题" tabid="tab1">
- <table id="tableMessage" cellpadding="3" cellspacing="3" border="0" style="width: 100%;">
- <tr>
- <td style="height: 30px; padding-left: 10px;" colspan="2" align="left">
- 分类:<asp:DropDownList ID="dropQuestionCategory" runat="server" onchange="LoadQuestionList();" CssClass="selectBox"
- Width="100px">
- </asp:DropDownList>
- 题型:<asp:DropDownList ID="dropQuestionType" runat="server" onchange="LoadQuestionList();"
- CssClass="selectBox" Width="60px">
- <asp:ListItem Value="" Text="所有题型"></asp:ListItem>
- <asp:ListItem Value="1" Text="问答题"></asp:ListItem>
- <asp:ListItem Value="2" Text="单选题"></asp:ListItem>
- <asp:ListItem Value="3" Text="多选题"></asp:ListItem>
- </asp:DropDownList>
- 关键字:<asp:TextBox ID="txtKeywords" runat="server" Style="width: 100px;"
- CssClass="txtInput"></asp:TextBox>
- <input id="btnSearch" type="button" value="搜 索" class="btnSearch" onclick="LoadQuestionList();" />
- </td>
- </tr>
- <tr>
- <td id="tdLeft" valign="top" style="width:50%; padding: 0px 2px 5px 2px;">
- <div id="divQuestionList">
- </div>
- </td>
- <td valign="top" style="width:50%;padding: 0px 2px 5px 2px;">
- <div id="divSelectList">
- </div>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <br />
- <div style="width: 100%; text-align: center;">
- <input id="Button1" type="button" value="预览试卷" class="btnSubmit" style="color:green;" onclick="ShowPagerView();" /> <asp:Button ID="btnSubmit" runat="server" Text="生成试卷" CssClass="btnSubmit"
- OnClientClick="return validate();" OnClick="btnSubmit_Click" /></div>
- <br />
- </form>
- </body>
- </html>
|