<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.Admin.Exam.KS_SelectTk"  Codebehind="KS.SelectTk.aspx.cs" %>

<%@ Import Namespace="Kesion.Publics" %>
<%@ Import Namespace="Kesion.Cache" %>
<%@ Import Namespace="Kesion.BLL" %>
<asp:Content ID="Content1" ContentPlaceHolderID="KSContent" runat="server">

    <script src="../../<%=MyCache.GetSJCacheConfig(1) %>/exam.js"></script>
    <script src="http://cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML"></script>
    <!--数学公式-->
    <%if (Kesion.APPCode.EditorAPI.EditorTag() == "UM")
        { %>
    <link rel="stylesheet" href="../../UMEditor/third-party/mathquill/mathquill.css" />
    <script src="../../UMEditor/third-party/mathquill/mathquill.min.js"></script>
    <%} %>
    <script>
       function Gettmtype(s) {
           s = parseInt(s);
           location.href = "?action=<%=action%>&tmids=<%=tmids%>&typeid=<%=typeid%>&sjid=<%=sjid%>&tmtype="+s+"&classid=<%=classId%>";
       }
       function Getclassid(s) {
           s = parseInt(s);
           location.href = "?action=<%=action%>&tmids=<%=tmids%>&typeid=<%=typeid%>&sjid=<%=sjid%>&tmtype=<%=tmtype%>&classid="+s+""; 
       }
       function GetMyIds() {
		   var sid = null;
		   for (var i = 0; i < document.getElementsByName("ids").length; i++) {
				var KS = document.getElementsByName("ids")[i];
				if (KS.checked == true) {
					if (sid == null)
						sid = KS.value;
					else
						sid += "," + KS.value;
				}
			}
			return sid;
       }
    </script>
    <style>
    	.scroll_Rcontent{ padding-right:0;}
    </style>
    <div class="listedit">
        <ul>
            
            <input type="checkbox" name="chkall" id="chkall" onclick="CheckAll(this.form);" /><label for="chkall">全选</label>
            <asp:LinkButton ID="addclassbutton" runat="server" OnClientClick="return(GetIDS());"  OnClick="Save_Click" CssClass="button button_on">确定保存</asp:LinkButton>
            <a href="KS.SJAddST.Aspx?sjid=<%=sjid%>" class="button">返回试题添加</a>
            
        </ul> 
    </div>
    <div class="quickSearch">
        <asp:DropDownList ID="DrpClassID" runat="server"  onchange="Getclassid(this.value)" Width="150" style="margin-right:8px;">
            <asp:ListItem Value="0">--按分类查看--</asp:ListItem>
        </asp:DropDownList>
<%--         <asp:DropDownList AutoPostBack="true"  OnSelectedIndexChanged="DrpClassID_SelectedIndexChanged"<asp:DropDownList ID="drpSJtypeClass" runat="server"  AutoPostBack="true" > 
        <asp:ListItem Value="0">-选择章节属性-</asp:ListItem>
        </asp:DropDownList>--%>
       
        <asp:DropDownList ID="DrpTmType" runat="server"  onchange="Gettmtype(this.value)">
            <asp:ListItem Value="0">--题目类型不限--</asp:ListItem>
        </asp:DropDownList> 
        <asp:TextBox ID="TxtKeyWord" runat="server" CssClass="textbox" />
        <asp:Button ID="BtnSearch" runat="server" CssClass="button" Text="搜索"  onclick="BtnSearch_Click"/>
    </div>
    <table width="100%" border="0" cellpadding="1" cellspacing="1" class="CTable mytable">
        <tr class="CTitle topbar">
            <td height="25" width="48" align="center"><b>选择</td>
            <td width="30" align="center"><b>序号</b></td>
            <td width="30" align="center"><b>类型</b></td>
            <td width="849" style="text-align: left">&nbsp;&nbsp;<b>题目内容</b></td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
            </HeaderTemplate>
            <ItemTemplate>
                <tr class="CtrMouseOut" onmouseover="this.className='CtrMouseOver'" onmouseout="this.className='CtrMouseOut'" onclick="chk(this)">
                    <td class="Ctd" width="50" nowrap="nowrap" align="center">
                        <input type="checkbox" name="ids" id="ids" value='<%# Eval("tmid").ToString()%>' <%#  ((tmids.IndexOf(Eval("tmid").ToString())!=-1)||(selectids.IndexOf(Eval("tmid").ToString()))!=-1)?"checked":""%>/>
                        <br />
                    </td>
                    <td class="Ctd">
                        <%# Container.ItemIndex + 1 + (CurrPage - 1) * PageSize%>
                    </td>
                    <td nowrap>
                        <%#Kesion.Exam.Function.GetDefaultTmType(Utils.StrToInt(Eval("tmtype").ToString())) %>
                    </td>
                    <td class="Ctd" style="word-break: break-all">
                        <strong><%# ReplaceTMNR(Convert.ToString(DataBinder.Eval(Container.DataItem, "Title")), Convert.ToInt32(Eval("tmid")))%></strong><div style='height: 2px; overflow: hidden'></div>
                        <%# ReplaceTMNR(Convert.ToString(DataBinder.Eval(Container.DataItem, "TMNR")),Convert.ToInt32(Eval("tmid")))%>
                        <div style='height: 5px; border-bottom: 1px dashed #cccccc; overflow: hidden'></div>
                        <span class="tips">
                            <%# (Convert.ToString(Eval("tmtype"))!="6" && Convert.ToString(Eval("tmtype"))!="7")?"<div>参考答案："+Kesion.Exam.Function.GetCKDA(Utils.StrToInt(Eval("tmtype")),Convert.ToString(Eval("answer")))+"</div>":"" %>
                            <%# string.IsNullOrEmpty(Convert.ToString(Eval("dajs")))?"":"答案解释："+Utils.replaceBR(Convert.ToString(DataBinder.Eval(Container.DataItem, "dajs"))) %>
                        </span>
                        </div>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                <asp:Label ID="lblEmptyZP" Text="<tr class='tdbg'><td height='50' style='text-align:center' colspan=4>没有试题！！！</td></tr>" CssClass="text_hei_12" runat="server" Visible='<%#bool.Parse((Repeater1.Items.Count==0).ToString())%>'>
                </asp:Label>
            </FooterTemplate>
        </asp:Repeater>
    </table>
    <KS:Page ID="Page1" runat="server"/>
</asp:Content>
