<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Assessment_StudentResult, App_Web_k11ba3xi" maintainscrollpositiononpostback="true" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager"
    TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>

<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl"
    TagPrefix="Date" %>

<%@ Register Src="~/UserControls/Common/StudentSearch/StudentSearch.ascx" TagName="StudentSearch"
    TagPrefix="Std" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <Std:StudentSearch ID="StudentSearch" Visible="false" runat="server" />

            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">

                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="105"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader2WireBox">
                    </div>

                    <div class="contentHolder" style="padding-left: 0px; padding-right: 0px">
                        <div class="himssuHeader1WireBox card card-box">
                            <div class="himsBoxHeader card-head">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-graduation-cap"></i>
                                            <asp:Label ID="Label1" runat="server" Text="Student Result"></asp:Label>
                                        </header>
                                    </div>
                                    <div class="fRight mt-27">
                                        <asp:Button ID="BackButtonID" runat="server" SkinID="0" CssClass="btn btn-back fas" Text="&#xf30a; Back" Visible="false" OnClick="BackButtonID_Click" />
                                    </div>
                                </div>
                            </div>

                            <div class="himsBoxContent card-body">
                                <asp:Panel ID="StudentSearchPanel" runat="server">
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="StudentIdNoLabel" runat="server" Text="Id No" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5 display-flex">
                                            <asp:TextBox ID="StudentIdNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                SkinID="CustomWidthTextBox" runat="server" MaxLength="200"
                                                AutoPostBack="true" OnTextChanged="StudentIdNoTextBox_TextChanged">
                                            </asp:TextBox>
                                            <asp:ImageButton SkinID="FindImage" ToolTip="Student Search" ID="StudentIdNoImageButton"
                                                ImageUrl="~/images/icons/icon_find.gif" runat="server" />
                                            <asp:HiddenField ID="SourceIdHiddenField" runat="server" />
                                            <asp:HiddenField ID="ClassIdHiddenField" runat="server" />
                                            <asp:HiddenField ID="AgeHiddenField" runat="server" />
                                            <asp:HiddenField ID="StudentDivisionIdHiddenField" runat="server" />
                                            <asp:HiddenField ID="StudentClassIdHiddenField" runat="server" />
                                            <asp:HiddenField ID="StudentOrgIdHiddenField" runat="server" />
                                            <asp:HiddenField ID="StudentBatchIdHiddenField" runat="server" />
                                        </div>
                                    </div>


                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ExamLabel" Text="Exam" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="ExamDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                AutoPostBack="True" OnSelectedIndexChanged="ExamDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="cBoth">
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="NameLabel" runat="server" Text="Name"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="NameTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ClassLabel" runat="server" Text="Class"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="ClassTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="DivisionLabel" runat="server" Text="Division"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="DivisionTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                        </div>
                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="RollNoLabel" runat="server" Text="Roll No"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:TextBox ID="RollNoTextBox" runat="server" SkinID="CustomWidthTextBox"
                                                onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" MaxLength="100" ReadOnly="true"></asp:TextBox>
                                        </div>
                                    </div>

                                    <div class="alignCenter col-md-12 pTop15">
                                        <asp:Button class="alignCenter pTop5 col-md-6" ID="GenerateZeroMarksButton" runat="server" CssClass="btn btn-generate fas"
                                            Text="&#xf079; Generate 0" SkinID="0" OnClick="GenerateZeroMarksButton_Click" Style="margin-top: 7px;" />
                                    </div>
                                </asp:Panel>
                                <div class="contentHolder">
                                    <div class="oterBox">
                                        <div class="controlLabelWidth">
                                        </div>
                                        <div class="fLeft pRight5">
                                            <%--<asp:Button ID="SearchMarkEntryButton" Text="Search" runat="Server" OnClick="SearchMarkEntryButton_Click" />--%>
                                            <asp:HiddenField ID="DetailHiddenField" runat="server" />
                                        </div>
                                    </div>
                                    <%-- <div class="outerBox pTop5 col-md-3">
                                        <div class="fLeft pRight5">
                                            <asp:HiddenField ID="DetailHiddenField" runat="server" />
                                        </div>
                                    </div>--%>

                                    <div id="Div1" class="himssuHeader6WireBox col-md-12" runat="server" visible="true">
                                        <div class="himsBoxHeader card-head inner" id="GridViewPagerDiv" runat="server" visible="True">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="headerText">
                                                    <header>
                                                        <asp:Label ID="GridViewLabel" Text="Result Sheet" runat="server" />
                                                    </header>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="himsBoxContent">

                                            <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="False">
                                            </div>

                                        </div>
                                    </div>
                                    <%--          <div id="DivData" class="Container" style="vertical-align: top; height: 250px; width: 99.6%;">  --%>
                                    <div>
                                        <div id="info" runat="server" class="col-md-12" visible="false">
                                            <div class="alert alert-info">
                                                <i class="material-icons">info</i> |
                                        <asp:Label ID="Label3" runat="server"></asp:Label>
                                            </div>
                                        </div>
                                        <div id="Div4" runat="server" class="table-responsive" style="width: 100%; padding-left: 14px; padding-right: 14px">
                                            <asp:GridView ID="MarkEntryGridView" runat="server" AutoGenerateColumns="False"
                                                EmptyDataText="No Records Found !!" AllowPaging="false" ShowHeader="true"
                                                DataKeyNames="AcademicId,ResultDetailId,ResultId,GraceMark,Remark,ExamGroupId" CssClass="table table-striped table-bordered table-hover">

                                                <Columns>

                                                    <asp:TemplateField HeaderText="Subject" ItemStyle-Width="15%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:Label ID="PercentileLabel" runat="server" Text='<%# Bind("SubjectName") %>'>' </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Maximum" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:Label ID="maximumLabel" runat="server" Text='<%# Bind("Maximum") %>'>' </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Minimum" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:Label ID="MinimumLabel" runat="server" Text='<%# Bind("Minimum") %>'>' </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Obtain" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:Label ID="TotalObtainLabel" runat="server" Text='<%# Bind("Obtain") %>'>' </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Grace Mark" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="GraceTextBox" SkinID="CustomWidthTextBox" Width="100px" runat="server" Text='<%#Eval("GraceMark") %>'></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Krupa Grace Mark" ItemStyle-Width="10%" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="KrupaGraceTextBox" SkinID="CustomWidthTextBox" Width="100px" runat="server" Text='<%#Eval("KrupaMark") %>'></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Remark" ItemStyle-Width="20%" ControlStyle-BorderWidth="150px" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="RemarkTextBox" SkinID="CustomWidthTextBox" Width="50px" runat="server" Text='<%#Eval("Remark") %>'></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>

                                                </Columns>

                                                <PagerSettings Visible="False" />

                                            </asp:GridView>
                                        </div>

                                    </div>

                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="StatusLabel" Text="Status" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="StatusDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                            </asp:DropDownList>


                                        </div>

                                    </div>
                                    <div id="Div2" class="himssuHeader6WireBox col-md-12" runat="server" visible="true">
                                        <div class="himsBoxHeader card-head inner" id="Div3" runat="server" visible="True">
                                            <div class="leftdiv">
                                            </div>
                                            <div class="himsBoxTitle">
                                                <div class="headerText">
                                                    <header>
                                                        <asp:Label ID="Label2" Text="Mark Entry Sub Exam Wise" runat="server" />
                                                    </header>
                                                </div>
                                            </div>
                                        </div>

                                    </div>

                                    <div id="Div5">
                                        <div class="himsBoxContent">
                                            <div id="StudentExamDetailsdiv" runat="server" style="width: 100%; padding-left: 14px; padding-right: 14px"></div>
                                        </div>
                                    </div>

                                    <div class="alignCenter pTop5 col-md-12" id="ExamButtonDiv" runat="server" style="display: none">
                                        <asp:Button ID="SaveExamButton" runat="server" CssClass="fas btn btn-save  mt7"
                                            Text="&#xf0c7; Save" SkinID="0" CommandName="Save" OnClientClick="AreYouSureConfirmBox()" />
                                        <asp:Button ID="GenerateResultButton" runat="server" CssClass="btn btn-generate fas"
                                            Text="&#xf079; Generate Result" SkinID="0" CommandName="Generate Result" OnClick="GenerateResultButton_Click" Style="margin-top: 7px;" />


                                        <%--<input type="button" onclick="CallSelectedIndexChanged()" value="Raise Event" style="display: none" />--%>
                                    </div>

                                    <div class=" col-md-12">
                                        <div class="alert-info ">
                                            <i class="material-icons">info</i>
                                            <b>Note : After any kind of changes in any exam please save and Generate results
                                        <br>
                                                <b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Otherwise, it will not affect on Result Sheet Report.
                                        <br>
                                                    <b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Only SubExam will display on the selection of the main exam.
                                        <br>
                                                        <b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Generate Result will effect on full class ranking and other all calculation process.
                                        </div>

                                        <div id="AbsentListdiv" class="himssuHeader6WireBox col-md-12" runat="server" visible="false">
                                        <div id="AbsentListmaindiv" class="himssuHeader6WireBox col-md-12" runat="server">
                                            <div class="himsBoxHeader card-head inner" id="Div7" runat="server">
                                                <div class="leftdiv">
                                                </div>
                                                <div class="himsBoxTitle">
                                                    <div class="headerText">
                                                        <header>
                                                            <asp:Label ID="Label4" Text="Absent Student List" runat="server" />
                                                        </header>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent">

                                                <div id="Div8" class="himsBoxContentMsg" runat="server" visible="False">
                                                </div>

                                            </div>
                                        </div>
                                        <%--          <div id="DivData" class="Container" style="vertical-align: top; height: 250px; width: 99.6%;">  --%>
                                        <div>
                                            <div id="Div9" runat="server" class="col-md-12" visible="false">
                                                <div class="alert alert-info">
                                                    <i class="material-icons">info</i> |
                                        <asp:Label ID="Label5" runat="server"></asp:Label>
                                                </div>
                                            </div>
                                            <div id="Div10" runat="server" class="table-responsive" style="width: 100%; padding-left: 14px; padding-right: 14px">
                                                <asp:GridView ID="AbsentStudentListGridView" runat="server" AutoGenerateColumns="False"
                                                    EmptyDataText="No Records Found !!" AllowPaging="false" ShowHeader="true"
                                                    CssClass="table table-striped table-bordered table-hover" DataKeyNames="ExamId,SubjectId,ResultDetailId,AcademicId">

                                                    <Columns>

                                                        <asp:TemplateField ItemStyle-Wrap="true" ItemStyle-Width="5%">
                                                            <HeaderTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="HeaderIsPresentCheckBox" runat="server" onclick="checkAll(this);" />
                                                                    Present
                                                                        <span></span>
                                                                </label>
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="IsPresentCheckBox" runat="server" Checked='<%# Bind("IsPresent") %>' />
                                                                    <span></span>
                                                                </label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="ExamName" ItemStyle-Width="45%" HeaderText="Exam Name"></asp:BoundField>
                                                        <asp:BoundField DataField="SubjectName" ItemStyle-Width="45%" HeaderText="Subject Name"></asp:BoundField>

                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                                <div class="alignCenter pTop5 col-md-12" id="AttendanceSaveButtonDiv" runat="server">
                                                    <asp:Button ID="AttendanceSaveButton" runat="server" CssClass="fas btn btn-save  mt7"
                                                        Text="&#xf0c7; Save" SkinID="0" OnClick="AttendanceSaveButton_Click" />
                                                </div>
                                            </div>

                                        </div>
                                        </div>


                                    </div>
                                </div>

                            </div>



                        </div>


                    </div>

                </div>

            </div>


            </b></b></b></b>


        </ContentTemplate>
    </asp:UpdatePanel>
    <%--   <script data-main="../../../JavaScript/rjs/encrypt/student-result-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/student-result")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            SetAll();

        });

        //Re-bind for callbacks
        var prm = Sys.WebForms.PageRequestManager.getInstance();

        prm.add_endRequest(function () {
            SetAll();
        });

        function SetAll() {

            $('.numbersOnly').focusin(function () {
                // alert("hi");
                //$(this).css("background-color", "red");
                $('.tooltip1').remove();
                //debugger;
                var title = $(this).attr('title');
                var t1 = "";
                var t2 = "";
                t1 = $(this).closest(".max_obtain_mark").find(".MaxMarks").html();
                t2 = $(this).closest(".max_obtain_mark").find(".ObtainMarks").html();

                title = t1 + ' | ' + t2;
                var position = $(this).offset();
                var top = parseInt(position.top) + 22;
                var left = parseInt(position.left);
                //$('.tooltip1').css({ "left": "" + position.left + "", "top": "" + position.top + "" });
                $('<p class="tooltip1" style="left:' + left + 'px;top:' + top + 'px"></p>')
                .text(title)
                .appendTo('body')
                .fadeIn('slow');


                //var position = $(this).position();
                //var mousex = position.left + 20; //Get X coordinates
                //var mousey = position.top + 10; //Get Y coordinates
                //$('.tooltip1').css("left: " + position.left + ", top: " + position.top);


            }).mouseleave(function () {
                $(this).attr('title', $(this).data('tipText'));
                $('.tooltip1').remove();
            });

        }


        //$('.numbersOnly').keydown(function (evt) {
        //    //$('.tooltip1').remove();
        //    if (evt.key === 9) {
        //        //debugger;
        //        $(this).attr('title', $(this).data('tipText'));
        //        //var title = $(this).attr('title');
        //        //$(this).data('tipText', title).removeAttr('title');

        //        //var t1 = "";
        //        //var t2 = "";
        //        //t1 = $(this).closest(".max_obtain_mark").find(".MaxMarks").html();
        //        //t2 = $(this).closest(".max_obtain_mark").find(".ObtainMarks").html();

        //        //title = t1 + ' | ' + t2;
        //        ////alert(title);
        //        //$('<p class="tooltip1"></p>')
        //        //.text(title)
        //        //.appendTo('body')
        //        //.fadeIn('slow');
        //    }

        //});





        function AreYouSureConfirmBox() {
            var x = confirm("Are you sure you want to update the marks?");
            if (x)
                SaveData();
            else
                return false;
        }

        function SaveData() {

            //alert("hi");
            //var obj = {
            //    "tablename": tablename
            //};
            //if ($("#ctl00_CP_StudentIdNoTextBox").val() != "") {
            //    alert("Please select ID No");
            //    return false;
            //}
            //if ($("#ctl00_CP_ExamDropDownList option:selected").text() != "") {
            //    alert("Please select Exam");
            //    return false;
            //}

            var ExamData = [];
            var resultdetailid = "";
            var tablename = "";
            var obtainmarks = "";
            //$('#ExamDataTbl > tbody  > tr:not(:first)').each(function () {
            //    $(this).closest("tr").find("td:not('.ClsF')").each(function () {
            //    });
            //    $("#ExamDataTbl").find('td').each(function (key, val) {
            //    });
            //});

            $('#ExamDataTbl td:not(".Sub")').each(function () {
                debugger;
                var resultdetailid = $(this).attr("resultdetailid");
                var obtainmarks = $(this).find("input").val();
                //alert($(this).attr("IsChange"));
                var IsTempSave = $(this).attr("IsTempSave");
                if (IsTempSave == "1") {
                    ExamData.push({
                        resultdetailid: resultdetailid,
                        obtainmarks: obtainmarks
                    });
                }
                // alert(Obtainval);                
            });

            var jsonObjects = {
                "Exams": ExamData
            };

            $.ajax({
                type: "POST",
                url: "/Pages/Assessment/General/StudentResult.aspx/SaveData",
                data: JSON.stringify(jsonObjects),
                contentType: "application/json;charset=utf-8",
                dataType: "json",
                success: function (data) {
                    var datas = $.parseJSON(data.d);
                    //alert(datas);
                    if (datas != '') {
                        if (datas == "1") {

                            alert("Record Save successfully.");
                            GetExamSubjectWiseList();
                            //CallSelectedIndexChanged();

                        }
                        else if (datas == "-101") {
                            GetExamSubjectWiseList();
                            //alert("No Obtains marks available.");
                            alert("Please change atleast one.");
                        }
                        else {
                            alert("Error has occured.");
                        }
                    }
                    else {
                        alert("Error has occured.");
                    }
                    // getdata();
                },
                error: function () {

                }
            });

        }


        $(document).on('change', '.numbersOnly', function () {
            var exammaxmarks = $(this).attr("exammaxmarks");
            var obtainmarks = $(this).val();
            $(this).closest('td').attr("IsTempSave", "1");
            if (parseFloat(exammaxmarks) < parseFloat(obtainmarks)) {
                $(this).val('');
                alert("Obtain Mark is not greater than MaxiMark.");
                return false;
            }
        });

        function GetExamSubjectWiseList() {
            //alert("hello");
            var obj = {
                "AcademicId": $("#ctl00_CP_SourceIdHiddenField").val(),
                "ExamId": $("#ctl00_CP_ExamDropDownList option:selected").val()
            };
            $.ajax({
                type: "POST",
                url: "/Pages/Assessment/General/StudentResult.aspx/GetSubjectWiseExamList",
                data: JSON.stringify(obj),
                contentType: "application/json;charset=utf-8",
                dataType: "json",
                success: function (data) {
                    //alert(data.d);
                    document.getElementById("ctl00_CP_StudentExamDetailsdiv").innerHTML = data.d;
                    if (data.d != '') {
                        //$("#ctl00_CP_StudentExamDetailsdiv").html('');
                        $("#ctl00_CP_ExamButtonDiv").css('display', '');
                        document.getElementById("ctl00_CP_StudentExamDetailsdiv").innerHTML = data.d;
                        SetAll();
                    }
                    else {
                        //$("#ctl00_CP_StudentExamDetailsdiv").html('');                      
                        $("#ctl00_CP_ExamButtonDiv").css('display', 'none');
                        //document.getElementById("ctl00_CP_StudentExamDetailsdiv").innerHTML = data.d;
                        document.getElementById("ctl00_CP_StudentExamDetailsdiv").innerHTML = "<table id='ExamDataTbl' class='table table-striped table-bordered table-hover'><tbody><tr><td>No Records Found !!</td></tr></tbody>";
                    }
                }
            });
        }
        function Norecord() {
            document.getElementById("ctl00_CP_StudentExamDetailsdiv").innerHTML = "<table id='ExamDataTbl' class='table table-striped table-bordered table-hover'><tbody><tr><td>No Records Found !!</td></tr></tbody>";
        }

    </script>
    <style type="text/css">
        #ExamDataTbl label {
            font-size: 10px;
            font-weight: bold;
            float: left;
        }

        #ExamDataTbl input {
            width: 50px;
            float: left;
            clear: both;
        }

        td.max_obtain_mark {
            padding: 4px 6px !important;
        }

            td.max_obtain_mark div {
                font-size: 11px !important;
            }

        tr.sub_exam_width th {
            width: 140px;
            padding: 4px 13px !important;
        }

        .tooltip1 {
            position: absolute;
            border: 1px solid #333;
            backgrou d-col
                        5px;
          pad
        ;

          color: f
               font- ize: 
        ;

        
        
        . a
                    ispla
         
        

        .ObtainMarks{{
            display: none;
        }
    </style>
    <script>

        function checkAll(obj) {
            var objGridview = obj.closest('table');
            var list = objGridview.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objRow = list[i].parentNode.parentNode;
                if (list[i].type == "checkbox" && obj != list[i]) {
                    if (obj.checked) {
                        list[i].checked = true;
                    }
                    else {
                        list[i].checked = false;
                    }
                }
            }
        }
    </script>

</asp:Content>
