<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true" CodeBehind="question_my.aspx.cs" Inherits="Math.admin.question_my" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    
                  
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>试题关键字搜索</legend>
</fieldset>
 
  <style>
      .hard img{ height:20px; }
  </style>
    
    <div class="layui-form-item"> 

         <div class="layui-inline">
            <label class="layui-form-label">题目关键字</label>
            <div class="layui-input-inline">
              <asp:TextBox runat="server" ID="txt_key" placeholder="请输入"  autocomplete="off" class="layui-input"></asp:TextBox>
            </div>
          </div>

      
         <div class="layui-inline">
            <label class="layui-form-label">标签</label>
            <div class="layui-input-inline">
                   <asp:TextBox runat="server" ID="txt_tags" placeholder="请输入"  autocomplete="off" class="layui-input"></asp:TextBox>
            </div>
          </div>

          
         <div class="layui-inline">
            <label class="layui-form-label">来源</label>
            <div class="layui-input-inline">
                   <asp:TextBox runat="server" ID="txt_source" placeholder="请输入"  autocomplete="off" class="layui-input"></asp:TextBox>
            </div>
          </div>

     </div>



     <div class="layui-form-item"> 







           <div class="layui-inline">
            <label class="layui-form-label">题目分类</label>
            <div class="layui-input-inline">
        
                <asp:DropDownList runat="server" ID="ddl_cat"
                     AutoPostBack="true" OnSelectedIndexChanged="ddl_cat_SelectedIndexChanged"
                     AppendDataBoundItems="true" lay-ignore CssClass="form-control">
                    <asp:ListItem Text="不限" Value=""></asp:ListItem> 
                </asp:DropDownList>

            </div>
          </div>
         



       <div class="layui-inline">
            <label class="layui-form-label">难度系统</label>
            <div class="layui-input-inline">
        
                <asp:DropDownList runat="server" ID="ddl_hard" OnSelectedIndexChanged="ddl_hard_SelectedIndexChanged" AutoPostBack="true" lay-ignore CssClass="form-control">
                    <asp:ListItem Text="不限" Value=""></asp:ListItem>
                       <asp:ListItem Text="1星" Value="1"></asp:ListItem>
                       <asp:ListItem Text="2星" Value="2"></asp:ListItem>
                       <asp:ListItem Text="3星" Value="3"></asp:ListItem>
                       <asp:ListItem Text="4星" Value="4"></asp:ListItem>
                       <asp:ListItem Text="5星" Value="5"></asp:ListItem>

                </asp:DropDownList>

            </div>
          </div>
         
          
 
     
       <div class="layui-inline">
            <label class="layui-form-label">试题类型</label>
            <div class="layui-input-inline">
        

                 <asp:DropDownList runat="server" ID="ddl_qtype" lay-ignore AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" CssClass="form-control">
                    <asp:ListItem Text="不限" Value=""></asp:ListItem>
                       <asp:ListItem Text="单选题" Value="单选题"></asp:ListItem>
                       <asp:ListItem Text="多选题" Value="多选题"></asp:ListItem>
                       <asp:ListItem Text="判断题" Value="判断题"></asp:ListItem>
                       <asp:ListItem Text="填空题" Value="填空题"></asp:ListItem>
                       <asp:ListItem Text="问答题" Value="问答题"></asp:ListItem>

                </asp:DropDownList>



            </div>
          </div>
         
            
           

       
          
            
             <div class="layui-inline">
                 <asp:Button   runat="server"  
                      Text="查询"
                     ID="lb_search"  class="layui-btn layuiadmin-btn-useradmin">
         

                 </asp:Button>
                 
          
          </div>
      
</div>
                  
 
  
        
           

   <div style="margin-top:10px; margin-left:20px;">
 共查询结果： <asp:Label runat="server" ID="lbl_total"></asp:Label> 条
  </div>


 <asp:ListView ID="lv_lists" runat="server"      ItemContainerID="layoutTableTemplate"  
    DataKeyNames="id" OnPagePropertiesChanging="lv_lists_PagePropertiesChanging"    
 >
 
 
    <LayoutTemplate>
 
   <table   class="layui-table">
      <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
    </table>
  </LayoutTemplate>
     
  
   
    <ItemTemplate>
     
 
	  		
    <tr style="background-color:#f2f2f2">
    	 <td colspan=6 align="right"> 

            

    		 <a   href='view.aspx?id=<%# Eval("id")%>'  class="layui-btn layui-btn-sm">查看</a>  
     		                  	
             
             
                 		 <a   href='question_new.aspx?id=<%# Eval("id")%>'  class="layui-btn layui-btn-normal layui-btn-sm">更新</a>  
             
             	 <a   href='###'  onclick="del(this,<%#Eval("id")%>)"   class="del layui-btn layui-btn-danger layui-btn-sm">删除</a>  
       			

               <a   href='###'  onclick="copy(this,<%#Eval("id")%>)"  class="layui-btn layui-btn-primary layui-border-green layui-btn-sm">复制</a> 

              <a   href='###'  onclick="Pop('addtocourse.aspx?pid=<%#Eval("id")%>',600,400,'把试题添加到课程里');"  class="layui-btn layui-btn-primary layui-border-black layui-btn-sm">添加到课程</a> 


                  <a   href='###'  onclick="Pop('Share_Up.aspx?id=<%#Eval("id")%>',600,400,'共享试题'); "  class="layui-btn layui-btn-warm layui-btn-sm">试题上传</a> 
 


    	 </td> 	
     </tr>
    
    
    
     <tr  align="left">
			 <td  width="33%"   ><b>题号:</b> <%# Eval("id")%> 
             (<span style=" font-size:10px">Create Date <%#DateTime.Parse(Eval("adddate").ToString()) %></span>)
			  </td>

           <td  width="10%"  ><b>分值:</b> <%# Eval("score")%>分  </td>



          <td  width="20%" ><b>难度:</b> <span class="hd hard" data-count="<%# Eval("hard")%>" ></span> </td>


         

			 <td  width="33%" colspan="2"  ><b>来源:</b> <%# Eval("source")%>  </td>
			 
	 </tr>
							
	  
         
       <tr  >
			 <td colspan="6" >
                 <%# Eval("question2")%> 
			 </td>
			 
	 </tr>
	
	
	  
	   		
	   		
	   		 
          
	   		
	   		
    </ItemTemplate>


  

</asp:ListView>   





    

 <div  class="paging"  >

 <asp:DataPager ID="DataPager1" 
      class="layui-box layui-laypage layui-laypage-default"  
       
     PagedControlID="lv_lists" runat="server" PageSize=10>
 <Fields>
            
        <asp:NextPreviousPagerField 
                PreviousPageText="上一页" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="false" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />


           <asp:NumericPagerField  
                ButtonType="Link" 
                CurrentPageLabelCssClass="currentpage"  
                RenderNonBreakingSpacesBetweenControls="false" 
              
                ButtonCount="10" 
                NextPageText="..." 
               />

     

     <asp:NextPreviousPagerField  
               NextPageText="下一页" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="false" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
              
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>

  
    
 
                    

         
     



        <script>

            function del(obj, id) {
                if (confirm('确定删除吗？')) {
                    var tr = $(obj).parent().parent();//.remove();
                    $(tr).next("tr").next("tr").remove();
                    $(tr).next("tr").remove();
                    $(tr).remove(); 
                    $.get("../api/del.aspx?t=del&id=" + id);

                }

            

            }




            function copy(obj, id) {
                if (confirm('确定复制题目吗？')) { 
                    $.get("../api/del.aspx?t=copy&id=" + id);
                    layer.msg("复制成功，请刷新页面");

                }



                
             


            }

        </script>
    



    <script>

        $(".editormd-tex").each(function () {
            var tex = $(this).text(); 
            var element = $(this)[0]; 
            katex.render(tex, element, {
                throwOnError: false
            });

        });

    </script>

    <script>
        $(".hard").each(function () {
            var c = $(this).data("count");
            var r = "";
            for (var i = 0; i < c; i++)
            {
                r += "<img src=img/star.svg> ";
            }
            $(this).html(r);

        });

    </script>


</asp:Content>
 
