SATT ACADEMY

New to Satt Academy? Create an account


or
Log in with Google Account

Web Development - JavaScript - জাভাস্ক্রিপ্ট এইচটিএমএল ডোম (JS HTML DOM) | NCTB BOOK

এইচটিএমএল ডোমের সাহায্যে আপনি নোডের সম্পর্ক ব্যবহার করে নোড ট্রি নেভিগেট করতে পারেন।


ডোম নোড

W3C এর এইচটিএমএল ডোমের স্ট্যান্ডার্ড অনুযায়ী, একটি এইচটিএমএল ডকুমেন্টের সবকিছুই একটি নোডঃ

  • সম্পূর্ণ ডকুমেন্ট একটি ডকুমেন্ট নোড
  • প্রতিটি এইচটিএমএল এলিমেন্ট একটি এলিমেন্ট নোড
  • এইচটিএমএল এলিমেন্টের ভিতরের টেক্সট হচ্ছে টেক্সট নোড
  • প্রতিটি এইচটিএমএল এট্রিবিউট হলো এট্রিবিউট নোড
  • সকল কমেন্ট হচ্ছে কমেন্ট নোড
DOM HTML tree

এইচটিএমএল ডোমের মাধ্যমে নোড ট্রির সকল নোডকে জাভাস্ক্রিপ্ট দ্বারা এক্সেস করা যাবে।

নতুন নোড তৈরি করা যাবে এবং সমস্ত নোড পরিবর্তন বা বাদ দেওয়া যাবে।


নোডের সম্পর্ক

এই সম্পর্ককে বর্ণনা করতে প্যারেন্ট,চাইল্ড এবং সিবলিং ব্যবহার করা হয়।

  • একটি নোড ট্রির মধ্যে সবচেয়ে উপরের নোডকে রুট(বা রুট নোড) বলা হয়
  • প্রতিটি নোডের শুধুমাত্র একটাই প্যারেন্ট থাকে, রুট ছাড়া (যার কোন প্যারেন্ট নেই)
  • একটি নোডের অনেকগুলো চিলড্রেন থাকতে পারে
  • সিবলিং(ব্রাদারস-সিস্টারস) হলো সেই নোড যাদের একই প্যারেন্ট থাকে

kt_satt_skill_example_id=1498

উপরের এইচটিএমএল থেকে আমরা যা শিখলামঃ

  • হচ্ছে একটি রুট নোড
  • এর কোন প্যারেন্ট নেই
  • হচ্ছে এবং এর প্যারেন্ট
  • হচ্ছে এর প্রথম চাইল্ড
  • হলো এর শেষ চাইল্ড

এবং

  • এর একটি চাইল্ড আছেঃ </li><li><title> এর একটি চাইল্ড টেক্সট নোড রয়েছেঃ "জাভাস্ক্রিপ্ট উদাহরণ"</li><li><body> এর দুইটি চাইল্ড আছেঃ <h1> এবং <p></li><li><h1> এর একটি চাইল্ড আছেঃ "ডোম টিউটোরিয়াল"</li><li><p> এর একটি চাইল্ড আছেঃ "স্যাট একাডেমী"</li><li><h1> এবং <p> হচ্ছে সিবলিং</li></ul><hr><h2 style="margin-left:0px;">নোডের মধ্যে নেভিগেট করা</h2><p style="margin-left:0px;">আপনি জাভাস্ক্রিপ্ট দিয়ে নোডের মধ্যে নেভিগেট করতে নিম্নলিখিত নোড প্রোপার্টি ব্যবহার করতে পারেনঃ</p><ul><li>parentNode</li><li>childNodes[<i>nodenumber</i>]</li><li>firstChild</li><li>lastChild</li><li>nextSibling</li><li>previousSibling</li></ul><hr><h2 style="margin-left:0px;">সতর্কতা!</h2><p style="margin-left:0px;">ডোম(DOM) প্রক্রিয়াকরণে একটি ভুল ধারণা হলো একটি এলিমেন্ট নোডে শুধু টেক্সট থাকবে।</p><p style="margin-left:0px;">এই উদাহরণেঃ <strong><title>ডোম টিউটোরিয়াল, এলিমেন্ট নোড টেক্সট ধারণ করে না। এটি "ডোম টিউটোরিয়াল" ভ্যালুসহ একটি <strong>টেক্সট নোড(text node)</strong> ধারণ করে।</p><p style="margin-left:0px;">নোডের <strong>innerHTML</strong>প্রোপারটি অথবা <strong>nodeValue</strong> দ্বারা টেক্সট নোডের ভ্যালু এক্সেস করা যেতে পারে।</p><hr><h2 style="margin-left:0px;">চাইল্ড নোড এবং নোড ভ্যালু</h2><p style="margin-left:0px;">innerHTML প্রোপারটি ছাড়াও আপনি একটি এলিমেন্টের কন্টেন্টকে পেতে childNodes এবং nodeValue প্রোপারটি ব্যবহার করতে পারেন।</p><p style="margin-left:0px;">নিম্নলিখিত উদাহরণে আমরা একটি <h1> এলিমেন্টের নোড ভ্যালুকে সংগ্রহ করে এবং একটি <p> এলিমেন্টে ব্যবহার করেছি।</p><p>short note</p><p style="margin-left:0px;">উপরোক্ত উদাহরণে getElementById হলো একটি মেথড, childNodes এবং nodeValue হচ্ছে প্রোপার্টি।</p><p style="margin-left:0px;">এই টিউটোরিয়ালে innerHTML প্রোপার্টি ব্যবহার করা হয়েছে। তবে ট্রি স্ট্রাকচার এবং ডোমের নেভিগেশন জানার জন্য উপরোক্ত মেথডটি অবশ্যই শেখা প্রয়োজন।</p><p style="margin-left:0px;">firstChild প্রোপারটির ব্যবহার এবং childNodes[0] এর ব্যবহার একই রকমঃ</p><p>short note</p><h2 style="margin-left:0px;">ডোম রুট নোড</h2><p style="margin-left:0px;">শুধুমাত্র দুটি উপায়ে সম্পূর্ণ ডকুমেন্টকে এক্সেস করা যায়ঃ</p><ul><li>document.body - ডকুমেন্টের বডি</li><li>document.documentElement - সম্পূর্ণ ডকুমেন্ট</li></ul><p>short note</p><p>short note</p><h2 style="margin-left:0px;">nodeName প্রোপার্টি</h2><p style="margin-left:0px;">nodeName প্রোপার্টি দ্বারা একটি নোডের নাম নির্দেশ করা হয়।</p><ul><li>nodeName প্রোপার্টি read-only</li><li>একটি এলিমেন্ট নোডের nodeName এবং TagName একই রকম</li><li>একটি এট্রিবিউট নোডের nodeName হলো এট্রিবিউটের নাম</li><li>একটি টেক্সট নোডের nodeName সবসময় #text হয়</li><li>ডকুমেন্ট নোডের nodeName সবসময় #document হয়</li></ul><p style="margin-left:0px;"><strong>নোটঃ</strong> nodeName সবসময় একটি এইচটিএমএল এলিমেন্টের বড়হাতের অক্ষরের ট্যাগ নাম ধারণ করে।</p><hr><h2 style="margin-left:0px;">nodeValue প্রোপার্টি</h2><p style="margin-left:0px;">nodeValue প্রোপার্টি একটি নোডের ভ্যালু নির্দেশ করে।</p><ul><li>এলিমেন্ট নোডের nodeValue এর ভ্যালু undefined থাকে</li><li>টেক্সট নোডের nodeValue ঐ টেক্সটকেই নির্দেশ করে</li><li>এট্রিবিউট নোডের nodeValue হলো এট্রিবিউটের ভ্যালু</li></ul><hr><h2 style="margin-left:0px;">nodeType প্রোপার্টি</h2><p style="margin-left:0px;">nodeType প্রোপার্টি নোডের টাইপ রিটার্ন করে। nodeType হলো read only প্রোপার্টি।</p><p style="margin-left:0px;">সবচেয়ে গুরুত্বপূর্ণ নোড টাইপগুলো হচ্ছেঃ</p><figure class="table" style="width:642.484px;"><table style="background-color:transparent;border:1px solid rgb(204, 204, 204);"><tbody><tr><th style="padding:8px;vertical-align:top;">ইলিমেন্ট টাইপ</th><th style="padding:8px;vertical-align:top;">নোডটাইপ</th></tr><tr><th style="padding:8px;vertical-align:top;">Element</th><th style="padding:8px;vertical-align:top;">১</th></tr><tr><th style="padding:8px;vertical-align:top;">Attribute</th><th style="padding:8px;vertical-align:top;">২</th></tr><tr><th style="padding:8px;vertical-align:top;">Text</th><th style="padding:8px;vertical-align:top;">৩</th></tr><tr><th style="padding:8px;vertical-align:top;">Comment</th><th style="padding:8px;vertical-align:top;">৮</th></tr><tr><th style="padding:8px;vertical-align:top;">Document</th><th style="padding:8px;vertical-align:top;">৯</th></tr></tbody></table></figure><p> </p> </div> <!--end::content--> <!--begin::Content Video--> <!--end::Content Video--> <!--begin::User Info--> <div class="d-flex flex-column flex-md-row align-items-start align-items-md-center justify-content-md-between justify-content-start mb-9"> <div> <span class="text-gray-800 text-uppercase mb-1 fs-7"> Content added || updated By </span> <!--begin::Item--> <div class="d-flex align-items-center pe-2"> <!--begin::Avatar--> <a href="https://sattacademy.com/public/index.php/user/u&id=70115/profile" class=""> <div class="symbol symbol-30px symbol-circle me-3 user-statistics" data-id="70115" data-flug="-1"> <img src="https://sattacademy.com/public/assets/media/avatars/blank.png" class="toolbar-img" alt=""> </div> </a> <!--end::Avatar--> <!--begin::Text--> <div class="fs-7 fw-bold"> <a href="https://sattacademy.com/public/index.php/user/u&id=70115/profile" class="text-gray-700 text-hover-primary"> Ibnul Haisan </a> </div> <!--end::Text--> </div> <!--end::Item--> </div> </div> <!--end::User Info--> <!--begin::Question--> <div class=""> </div> <!--end::Question--> </div> </div> </div> <!--begin::Related Topics--> <div class="mb-9 mx-5"> <p class="fs-4">আরও দেখুন...</p> <div class="d-flex flex-wrap align-items-center"> <a href="https://sattacademy.com/public/index.php/academy/chapter=26707/read" class="btn btn-light btn-active-primary btn-sm rounded-1 me-5 mb-5"> ডোম ফর্ম (DOM Form) </a> <a href="https://sattacademy.com/public/index.php/academy/chapter=26714/read" class="btn btn-light btn-active-primary btn-sm rounded-1 me-5 mb-5"> ডোম কালেকশন (DOM Collection) </a> <a href="https://sattacademy.com/public/index.php/academy/chapter=26702/read" class="btn btn-light btn-active-primary btn-sm rounded-1 me-5 mb-5"> ডোম পরিচিতি (DOM Intro) </a> <a href="https://sattacademy.com/public/index.php/academy/chapter=26703/read" class="btn btn-light btn-active-primary btn-sm rounded-1 me-5 mb-5"> ডোম মেথড (DOM Method) </a> <a href="https://sattacademy.com/public/index.php/academy/chapter=26704/read" class="btn btn-light btn-active-primary btn-sm rounded-1 mb-5"> ডোম ডকুমেন্ট (DOM Document) </a> </div> </div> <!--end::Related Topics--> </div> <!--end::Content--> </div> <!--end::Col--> <!--begin::Col--> <div class="col-md-4 d-none d-md-block" style="overflow:scroll; height:800px; position:sticky; top:100px;"> <!--begin::card--> <div class="card"> <!--begin::Body--> <div class="card-body p-7"> <!--begin::Layout--> <div class="d-flex flex-column flex-lg-row"> <!--begin::Sidebar--> <div class="flex-column flex-lg-row-auto w-100 mb-md-10"> <!--begin::Catigories--> <div class="mb-md-15"> <div class="sidebar-title mb-3"> <h4 class="text-dark text-uppercase">On This Page</h4> </div> <div class="mb-7" style=" height:3px; background-color: #004803"></div> <ul class="p-0"> <li style="list-style: none"> <!--begin::Item--> <div class="d-flex flex-stack"> <!--begin::Section--> <a href="#kk_target_26712" class="text-primary fw-semibold fs-6 me-2">ডোম নেভিগেশন (DOM Navigation)</a> <!--end::Section--> </div> <!--end::Item--> <!--begin::Separator--> <div class="separator separator-dashed my-3"></div> <!--end::Separator--> </li> </ul> </div> <!--end::Catigories--> <!--begin::Promotion--> <div class="m-0 d-none d-md-block"> <h4 class="text-dark mb-2 text-uppercase">Promotion</h4> <div class="mb-7" style=" height:3px; background-color: #004803"></div> <!--begin::Item--> <div class="w-100"> <img src="https://sattacademy.com/public/custom/banner/pro_banner.png" alt=""> </div> <!--end::Item--> <!--begin::Dynamic promotion content--> <div id="sidebar-promotion-content"></div> <!--end::Dynamic promotion content--> </div> <!--end::Promotion--> </div> <!--end::Sidebar--> </div> <!--end::Layout--> </div> <!--end::Body--> </div> <!--end::card--> </div> <!--end::Col--> </div> <!--end::Row--> </div> <!--end::subject topic--> </div> <!--end::Container--> </div> <!--end:Post --> <div class="modal fade z-index-1500" id="kk_modal_self_test" tabindex="-1" aria-hidden="true"> <!--begin::Modal dialog--> <div class="modal-dialog modal-dialog-centered mw-650px"> <!--begin::Modal content--> <div class="modal-content rounded"> <!--begin::Modal header--> <div class="modal-header pb-0 border-0 justify-content-end"> <!--begin::Close--> <div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal"> <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg--> <span class="svg-icon svg-icon-1"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="black" /> <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black" /> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Close--> </div> <!--begin::Modal header--> <!--begin::Modal body--> <div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15"> <!--begin:Form--> <form id="kk_modal_self_test_form" class="form" enctype="multipart/form-data"> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <input type="hidden" name="subject_id" value=""> <!--begin::Heading--> <div class="mb-9 text-center"> <!--begin::Title--> <h1 class="mb-3">Self Test</h1> <!--end::Title--> <!--begin::Description--> <div class="text-muted fw-bold fs-5">Fill up the form and submit </div> <!--end::Description--> </div> <!--end::Heading--> <!---Error Message --> <div class="messages col-md-12 mx-auto fw-bolder text-center mb-3"></div> <!---Error Message --> <div class="text-center mb-9"> <span class="fs-4 fw-bold">To attend a self test please, login first. <a href="https://sattacademy.com/public/index.php/login" class="text-decoration-underline">click here to login</a></span> </div> <!--begin::Actions--> <div class="text-center"> <button type="reset" id="kk_modal_self_test_cancel" class="btn btn-light me-3">Cancel</button> <a href="https://sattacademy.com/public/index.php/login" class="btn btn-primary"> Login </a> </div> <!--end::Actions--> </form> <!--end:Form--> </div> <!--end::Modal body--> </div> <!--end::Modal content--> </div> <!--end::Modal dialog--> </div> <!--begin::Modal - Bookmark modal--> <div class="modal fade" id="kk_modal_new_bookmark" tabindex="-1" aria-hidden="true"> <!--begin::Modal dialog--> <div class="modal-dialog modal-dialog-centered mw-600px"> <!--begin::Modal content--> <div class="modal-content rounded"> <!--begin::Modal header--> <div class="modal-header pb-0 border-0 justify-content-end"> <!--begin::Close--> <div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal"> <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg--> <span class="svg-icon svg-icon-1"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="black" /> <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black" /> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Close--> </div> <!--begin::Modal header--> <!--begin::Modal body--> <div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15"> <!--begin:Form--> <form id="kk_modal_new_bookmark_form" class="form" method="POST" enctype="multipart/form-data"> <!-- csrf token --> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <input type="hidden" name="question_id"> <input type="hidden" name="catid"> <input type="hidden" name="type"> <!--begin::Heading--> <div class="mb-13 text-center"> <!--begin::Title--> <h1 class="mb-3">Add New Bookmark</h1> <!--end::Title--> <!--begin::Description--> <div class="text-muted fw-bold fs-5">Fill up the form and submit </div> <!--end::Description--> </div> <!--end::Heading--> <div class="messages text-center fw-bold"></div> <div class="text-center mb-9"> <span class="fs-4 fw-bold">To add a bookmark login first. <a href="https://sattacademy.com/public/index.php/login" class="text-decoration-underline">click here to login</a></span> </div> <!--begin::Actions--> <div class="text-center"> <button type="reset" id="kk_modal_bookmark_cancel" class="btn btn-light me-3 ">Cancel</button> <a href="https://sattacademy.com/public/index.php/login" class="btn btn-primary"> Login </a> </div> <!--end::Actions--> </form> <!--end:Form--> </div> <!--end::Modal body--> </div> <!--end::Modal content--> </div> <!--end::Modal dialog--> </div> <!--end::Modal - Bookmark modal--> <!--begin::Modal - Error Report--> <div class="modal fade" id="kk_modal_error_report" tabindex="-1" aria-hidden="true"> <!--begin::Modal dialog--> <div class="modal-dialog modal-dialog-centered mw-650px"> <!--begin::Modal content--> <div class="modal-content rounded"> <!--begin::Modal header--> <div class="modal-header pb-0 border-0 justify-content-end"> <!--begin::Close--> <div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal"> <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg--> <span class="svg-icon svg-icon-1"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="black" /> <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black" /> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Close--> </div> <!--begin::Modal header--> <!--begin::Modal body--> <div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15"> <!--begin:Form--> <form id="kk_modal_error_report_form" class="form" enctype="multipart/form-data"> <div class="messages"></div> <!-- csrf token --> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <!--begin::Heading--> <div class="mb-13 text-center"> <!--begin::Title--> <h1 class="mb-3">Error Report</h1> <!--end::Title--> <!--begin::Description--> <div class="text-muted fw-bold fs-5">Fill up the form and submit </div> <!--end::Description--> </div> <!--end::Heading--> <!--begin::Hidden Input --> <input type="hidden" name="id" value=""> <input type="hidden" name="type" value=""> <!--begin::Hidden Input--> <div class="text-center mb-9"> <span class="fs-4 fw-bold">To report an error please, login first. <a href="https://sattacademy.com/public/index.php/login" class="text-decoration-underline">click here to login</a></span> </div> <!--begin::Actions--> <div class="text-center"> <button type="reset" id="kk_modal_error_report_cancel" class="btn btn-light me-3">Close</button> <a href="https://sattacademy.com/public/index.php/login" class="btn btn-primary"> Login </a> </div> <!--end::Actions--> </form> <!--end:Form--> </div> <!--end::Modal body--> </div> <!--end::Modal content--> </div> <!--end::Modal dialog--> </div> <!--end::Modal - Error Report--> <!--begin::Modal - Video--> <div class="modal fade" id="kk_modal_add_video" tabindex="-1" aria-hidden="true"> <!--begin::Modal dialog--> <div class="modal-dialog modal-dialog-centered mw-650px"> <!--begin::Modal content--> <div class="modal-content rounded"> <!--begin::Modal header--> <div class="modal-header pb-0 border-0 justify-content-end"> <!--begin::Close--> <div class="btn btn-sm btn-icon btn-active-color-primary" data-bs-dismiss="modal"> <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg--> <span class="svg-icon svg-icon-1"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="black" /> <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black" /> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Close--> </div> <!--begin::Modal header--> <!--begin::Modal body--> <div class="modal-body scroll-y px-10 px-lg-15 pt-0 pb-15"> <!--begin:Form--> <form id="kk_modal_new_video_form" class="form" enctype="multipart/form-data"> <!-- csrf token --> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <!--begin::Hidden Input--> <input type="hidden" name="data_id"> <input type="hidden" name="type"> <!--end::Hidden Input--> <!--begin::Heading--> <div class="mb-13 text-center"> <!--begin::Title--> <h1 class="mb-3">Add Video</h1> <!--end::Title--> <!--begin::Description--> <div class="text-muted fw-bold fs-5">Fill up the form and submit </div> <!--end::Description--> </div> <!--end::Heading--> <!--begin::Error Message--> <div class="messages text-center fw-bold"></div> <!--end::Error Message--> <div class="text-center mb-9"> <span class="fs-4 fw-bold">To add a video please, login first. <a href="https://sattacademy.com/public/index.php/login" class="text-decoration-underline">click here to login</a></span> </div> <!--begin::Actions--> <div class="text-center"> <button type="reset" id="kk_modal_add_video_cancel" class="btn btn-light me-3 ">Cancel</button> <a href="https://sattacademy.com/public/index.php/login" class="btn btn-primary"> Login </a> </div> <!--end::Actions--> </form> <!--end:Form--> </div> <!--end::Modal body--> </div> <!--end::Modal content--> </div> <!--end::Modal dialog--> </div> <!--end::Modal - Video--> <!--end::Post--> <!--begin::Dynamic promotion content--> <div id="footer-promotion-content" class="container mx-auto my-10 my-lg-20"></div> <!--end::Dynamic promotion content--> </div> <!--end::Content--> <!--begin::Footer--> <!--begin::Footer--> <div class="footer pb-3 " id="kt_footer" style="background-color: #13263C"> <div class="d-flex flex-column flex-md-row align-items-md-start align-items-start justify-content-md-between px-7 pt-10 pb-5"> <div class=""> <!--begin::Block--> <div class="px-md-3"> <!--begin::Logo image--> <a href="https://sattacademy.com" style="margin-top:-8px"> <img alt="logo" src="https://sattacademy.com/public/uploads/company/1666848761.png" class="logo-default h-35px h-md-45px" target="_blank" /> </a> <!--end::Logo image--> </div> <!--end::Block--> <!--begin::Block--> <div class="rounded px-md-5 py-3 mb-5 mb-sm-2"> <!--begin::Title--> <h4 class="fw-bold text-gray-200 mb-4 text-uppercase">Download Our Mobile Apps</h4> <!--end::Title--> <div class="d-flex justify-content-start align-content-center mb-2"> <!--begin::playstore image--> <a href=" https://play.google.com/store/apps/details?id=com.sattacademy.sattacademy " class=""> <img alt="Logo" src="https://sattacademy.com/public/assets/media/playstore/google-play-store.png" class="logo-default h-30px me-3" /> </a> <a href=" https://play.google.com/store/apps/details?id=com.sattacademy.sattacademy " class=""> <img alt="Logo" src="https://sattacademy.com/public/assets/media/playstore/app-store.png" class="logo-default h-30px" /> </a> <!--begin::playstore image--> </div> </div> <!--end::Block--> </div> <!--begin::Col--> <div class="mb-9 mb-md-0"> <!--begin::Links--> <div class="d-flex flex-column"> <!--begin::Subtitle--> <h4 class="fw-bold text-gray-200 mb-4 text-uppercase">Satt policy</h4> <!--end::Subtitle--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/privacy-policy" class="text-white text-gray-400 text-hover-primary fs-6 mb-2">Privacy Policy</a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/terms-and-conditions" class="text-white text-gray-400 text-hover-primary fs-6 mb-2">Terms and Condition</a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/refund-policy" class="text-white text-gray-400 text-hover-primary fs-6 mb-2">Refund Policy</a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/cookie-policy" class="text-white text-gray-400 text-hover-primary fs-6 mb-2">Cookies Policy</a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/d-m-c-a" class="text-white text-gray-400 text-hover-primary fs-6 mb-2">DMCA</a> <!--end::Link--> </div> <!--end::Links--> </div> <!--end::Col--> <!--begin::Col--> <div class="mb-9 mb-md-0"> <!--begin::Links--> <div class="d-flex flex-column"> <!--begin::Subtitle--> <h4 class="fw-bold text-gray-200 mb-4 text-uppercase">Main Features</h4> <!--end::Subtitle--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/academy" class="text-white text-gray-400 text-hover-primary fs-6 mb-2 text-uppercase">Academic Care </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/admission" class="text-white text-gray-400 text-hover-primary fs-6 mb-2 text-uppercase">University Admission </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/job-solution" class="text-white text-gray-400 text-hover-primary fs-6 mb-2 text-uppercase">Job Preparation </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/skill-dev" class="text-white text-gray-400 text-hover-primary fs-6 mb-2 text-uppercase">Skil Development </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/packages" class="text-white text-gray-400 text-hover-primary fs-6 mb-2 text-uppercase">PACKAGE PLAN </a> <!--end::Link--> </div> <!--end::Links--> </div> <!--end::Col--> <!--begin::Col--> <div class=""> <div class="card-rounded mb-4"> <!--begin::Subtitle--> <h4 class="fw-bold text-gray-200 mb-1 text-uppercase">Subscribe our newsletter</h4> <!--end::Subtitle--> <div class="d-flex flex-md-row justify-content-start"> <!--begin::Content--> <div class="my-2 me-5"> <span class="d-flex" > <input type="text" id="subscriber_email" class="form-control form-control-solid w-200px border-0 rounded-0 h-45px" name="email" placeholder="example@gmail.com"> <button type="submit" id="kk_newsletter_subscriber" class="btn btn-primary rounded-0 rounded-end" style ="background: radial-gradient(circle, rgb(1, 151, 1) 0%, rgb(1, 83, 8) 100%);">Subscribe </button> </span> <div class="text-white help-block with-errors email-error"></div> </div> <!--end::Content--> </div> </div> <div class="d-flex align-items-center justify-content-between m-4 ms-0"> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/faqs" class="text-white text-gray-400 text-hover-primary fs-5 me-4">FAQ</a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/about-us" class="text-white text-gray-400 text-hover-primary fs-5 me-4">ABOUT </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/contact-us" class="text-white text-gray-400 text-hover-primary fs-5 me-4">CONTACT </a> <!--end::Link--> <!--begin::Link--> <a href="https://sattacademy.com/public/index.php/satt-career" class="text-white text-gray-400 text-hover-primary fs-5 me-4">CAREER </a> <!--end::Link--> </div> <!--begin::Links--> <div class="d-flex flex-column px-4 ps-0"> <!--start::social link--> <div class="d-flex align-items-center justify-content-between"> <!--begin::Link--> <a href="https://www.facebook.com/sattacademy" class="social-icon me-4"> <i class="fab fa-facebook-f fs-1"></i> </a> <!--end::Link--> <!--begin::Link--> <a href="https://www.youtube.com/@sattacademy" class="social-icon me-4"> <i class="fab fa-youtube fs-1 "></i> </a> <!--end::Link--> <!--begin::Link--> <a href="https://twitter.com/sattacademy" class="social-icon me-4"> <i class="fab fa-twitter fs-1 "></i> </a> <!--end::Link--> <!--begin::Link--> <a href="https://bd.linkedin.com/company/sattacademy" class="social-icon me-4"> <i class="fab fa-linkedin-in fs-1 "></i> </a> <!--end::Link--> <!--begin::Link--> <a href="https://instagram.com/sattacademy?igshid=YmMyMTA2M2Y=" class="social-icon me-4"> <i class="fab fa-instagram fs-1"></i> </a> <!--end::Link--> </div> <!--end::social link--> </div> <!--end::Links--> </div> </div> </div> <!--end::Footer--> <!--Begin::Copywrite--> <div class="bg-light" > <!--begin::Container--> <div class="container"> <!--begin::--> <div class="d-flex align-items-md-center justify-content-center py-1"> <!--begin::copyright--> <a class="text-dark fw-bold fs-7" href="https://sattacademy.com/public/index.php">©2024 SATT ACADEMY. All rights reserved.</a> </div> <!--end::--> </div> <!--end::Container--> </div> <!--end::Copywrite--> <!--end::Footer--> </div> <!--end::Wrapper--> </div> <!--end::Page--> </div> <!--end::Root--> <!--end::Main--> <!--begin::Dynamic Modal--> <div class="modal fade" tabindex="-1" id="satt_dynamic_modal"> <div class="modal-dialog modal-dialog-centered mw-650px"> <div class="modal-content" style="background-color: transparent"> <!--begin::Close--> <button type="button" class="promotion-close-btn promotion-modal-close-btn" data-bs-dismiss="modal" aria-label="Close"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor"></rect> <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor"></rect> </svg> </button> <!--end::Close--> <div class="dynamic-modal-body promotion-body"> </div> </div> </div> </div> <!--end::Dynamic Modal--> <!-- begin: Dynamic offcanvas --> <div class="offcanvas" tabindex="-1" id="satt_dynamic_offcanvas" aria-labelledby="offcanvasLabel"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="offcanvasLabel">Promotion</h5> <button type="button" class="btn-close promotion-close-btn" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> <div class="offcanvas-body promotion-body" id="dynamic_offcanvas_body"> </div> </div> <!-- end: Dynamic offcanvas --> <!--begin::Scrolltop--> <div id="kt_scrolltop" class="scrolltop" data-kt-scrolltop="true"> <!--begin::Svg Icon | path: icons/duotune/arrows/arr066.svg--> <span class="svg-icon"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"> <rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="black" /> <path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="black" /> </svg> </span> <!--end::Svg Icon--> </div> <!--end::Scrolltop--> <!--begin::Javascript--> <script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script> <!--Bootstrap Js --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"></script> <!--begin::SweetAlert Cdn --> <script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script> <style> .swal2-container.swal2-center>.swal2-popup { padding-top: 20px !important; } span.alert_satt_title { position: absolute; top: 16px; left: 0; right: 0; font-size: 1.5rem; font-weight: 600; text-transform: uppercase; } .swal2-popup .swal2-title { margin-bottom: -20px; } .swal2-close { margin-top: -18px !important; } </style> <script> function restrict(data) { var globalPackagePlans = [{"id":13,"package_id":5,"name":"BASIC","monthly_price":199,"yearly_price":1499,"lifetime_price":0,"lifetime_discount":0,"monthly_discount":100,"yearly_discount":1000,"discount_type":"fixed","status":"active","created_by":1,"updated_by":1,"created_at":"2023-05-08T14:50:31.000000Z","updated_at":"2024-06-10T17:48:29.000000Z","deleted_at":null},{"id":14,"package_id":5,"name":"PLUS","monthly_price":249,"yearly_price":2499,"lifetime_price":0,"lifetime_discount":0,"monthly_discount":100,"yearly_discount":1700,"discount_type":"fixed","status":"active","created_by":1,"updated_by":1,"created_at":"2023-05-08T14:50:43.000000Z","updated_at":"2024-06-10T17:49:51.000000Z","deleted_at":null},{"id":15,"package_id":5,"name":"PRO","monthly_price":399,"yearly_price":3499,"lifetime_price":0,"lifetime_discount":0,"monthly_discount":200,"yearly_discount":2000,"discount_type":"fixed","status":"active","created_by":1,"updated_by":1,"created_at":"2023-05-08T14:50:55.000000Z","updated_at":"2024-06-10T17:53:39.000000Z","deleted_at":null}]; // show alert if subscriptions need if (data.need_subscribe == true) { hideSpinner(); Swal.fire({ title: '<p><b class="text-danger">Free limit exceeded!</b></><p/><p>Need subscription for unlimited access!<p/>', icon: "warning", showDenyButton: true, showCancelButton: true, confirmButtonText: "View Details", denyButtonText: `Not Now!`, html: ` <div x-data="{ activeTab: 'monthly' }" class="restrictCard"> <span class="alert_satt_title">SATT Academy</span> <!-- Nav tabs --> <ul class="nav nav-tabs justify-content-center" role="tablist"> <li class="nav-item"> <a class="nav-link" :class="{ 'active': activeTab === 'monthly' }" @click.prevent="activeTab = 'monthly'" href="#">Monthly</a> </li> <li class="nav-item"> <a class="nav-link" :class="{ 'active': activeTab === 'yearly' }" @click.prevent="activeTab = 'yearly'" href="#">Yearly</a> </li> </ul> <!-- Tab panes --> <div class="tab-content"> <div id="monthly" x-show="activeTab === 'monthly'" class="container tab-pane active"><br> <div class="table-responsive"> <table class="table" style="border: 1px solid black;"> <thead class="restrict-thead text-dark rounded"> <tr class="text-center" style="border: 1px solid black;"> <th class="ps-2">Package</th> <th>Price</th> <th>Action</th> </tr> </thead> <tbody> ${globalPackagePlans.map(plan => ` <tr style="border: 1px solid black;"> <td>${plan.name}</td> <td> <span class="text-danger text-decoration-line-through">${plan.monthly_price}</span> <span>${ (plan.discount_type === 'fixed' ? plan.monthly_price - plan.monthly_discount : (plan.monthly_price - (plan.monthly_price/100)*plan.monthly_discount ) )}৳</span> </td> <td> <div class="mt-n6 d-flex"> <form action="https://sattacademy.com/public/index.php/subscribe" method="post"> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <input type="hidden" name="id" value="${plan.id}"/> <input type="hidden" name="type" value="plan"/> <input type="hidden" name="month_year" value="month"/> <button type="submit" class="btn btn-green text-white btn-sm ">Subscribe</button> </form> <a href="https://sattacademy.com/public/index.php/packages" class="btn btn-details text-white btn-sm d-none d-md-block">View Details</a> </div> </td> </tr> `).join('')} </tbody> </table> </div> </div> <div id="yearly" x-show="activeTab === 'yearly'" class="container tab-pane active"><br> <div class="table-responsive"> <table class="table" style="border: 1px solid black;"> <thead class="restrict-thead bg-secondary text-dark rounded"> <tr class="text-center" style="border: 1px solid black;"> <th class="ps-2">Package</th> <th>Price</th> <th>Action</th> </tr> </thead> <tbody> ${globalPackagePlans.map(plan => ` <tr style="border: 1px solid black;"> <td>${plan.name}</td> <td> <span class="text-danger text-decoration-line-through">${plan.yearly_price}</span> <span>${ (plan.discount_type === 'fixed' ? plan.yearly_price - plan.yearly_discount : (plan.yearly_price - (plan.yearly_price/100)*plan.yearly_discount ) )}৳</span> </td> <td> <div class="mt-n6 d-flex"> <form action="https://sattacademy.com/public/index.php/subscribe" method="post"> <input type="hidden" name="_token" value="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" autocomplete="off"> <input type="hidden" name="id" value="${plan.id}"/> <input type="hidden" name="type" value="plan"/> <input type="hidden" name="month_year" value="year"/> <button type="submit" class="btn btn-green text-white btn-sm ">Subscribe</button> </form> <a href="https://sattacademy.com/public/index.php/packages" class="btn btn-details text-white btn-sm d-none d-md-block">View Details</a> </div> </td> </tr> `).join('')} </tbody> </table> </div> </div> </div> </div> `, width: '570px', heightAuto: true, customClass: { popup: 'swal-height', confirmButton: 'btn-green', }, showCloseButton: true }).then((result) => { if (result.isConfirmed) { Swal.fire("Redirecting to package plan page...", "", "success"); window.location.href = "/packages"; } else if (result.isDenied) { Swal.fire("Thanks, But if you want this service you need to subscribe", "", "info"); } }); } else if (data.need_login == true) { hideSpinner(); Swal.fire({ title: data.message?.title ?? "Login to continue...", text: data.message?.body ?? "If you need more content, you need to login", icon: "warning", showDenyButton: true, showCancelButton: true, confirmButtonText: "Login Now", denyButtonText: `Not Now!` }).then((result) => { /* Read more about isConfirmed, isDenied below */ if (result.isConfirmed) { Swal.fire("Redirecting to login page...", "", "success"); // if user want to subscribe then redirect to package plan page window.location.href = "/login"; } else if (result.isDenied) { Swal.fire("Thanks, But if you need more content, you need to login", "", "info"); } }); hideSpinner(); } else { hideSpinner(); window.scrollTo({ top: 0, behavior: 'smooth' }); MathJax.Hub.Typeset(); } } // subscribe alert function hideSpinner() { $("#spinner-gif").hide(); $("#spinner-gif_1").hide(); $("#spinner-gif_2").hide(); $("#spinner-gif_3").hide(); $("#spinner-gif_4").hide(); $("#spinner-gif_5").hide(); $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } </script> <script> /**** Livewire Alert Scripts ****/ (()=>{var __webpack_modules__={757:(e,t,r)=>{e.exports=r(666)},666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof y?t:y,i=Object.create(o.prototype),a=new x(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===_)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=_;var s=u(e,t,r);if("normal"===s.type){if(n=r.done?d:p,s.arg===h)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=d,r.method="throw",r.arg=s.arg)}}}(e,r,a),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",p="suspendedYield",_="executing",d="completed",h={};function y(){}function v(){}function b(){}var m={};s(m,i,(function(){return this}));var w=Object.getPrototypeOf,g=w&&w(w(D([])));g&&g!==r&&n.call(g,i)&&(m=g);var O=b.prototype=y.prototype=Object.create(m);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function L(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=u(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function D(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:S}}function S(){return{value:t,done:!0}}return v.prototype=b,s(O,"constructor",b),s(b,"constructor",v),v.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,c,"GeneratorFunction")),e.prototype=Object.create(O),e},e.awrap=function(e){return{__await:e}},E(k.prototype),s(k.prototype,a,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(O),s(O,c,"Generator"),s(O,i,(function(){return this})),s(O,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=D,x.prototype={constructor:x,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(757),_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function asyncGeneratorStep(e,t,r,n,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){asyncGeneratorStep(i,n,o,a,c,"next",e)}function c(e){asyncGeneratorStep(i,n,o,a,c,"throw",e)}a(void 0)}))}}function evalCallbacksOptions(options){for(var callbacksKeysAllowed=["allowOutsideClick","allowEscapeKey","allowEnterKey","loaderHtml","inputOptions","inputValidator","preConfirm","preDeny","didClose","didDestroy","didOpen","didRender","willClose","willOpen"],_i=0,_callbacksKeysAllowed=callbacksKeysAllowed;_i<_callbacksKeysAllowed.length;_i++){var callbackKey=_callbacksKeysAllowed[_i];options.hasOwnProperty(callbackKey)&&("string"==typeof options[callbackKey]||options[callbackKey]instanceof String)&&options[callbackKey]&&""!=options[callbackKey].trim()&&(options[callbackKey]=eval(options[callbackKey]))}}function afterAlertInteraction(e){if(e.confirmed)return"self"===e.onConfirmed.component?void Livewire.find(e.onConfirmed.id).dispatchSelf(e.onConfirmed.listener,e.result):void Livewire.dispatchTo(e.onConfirmed.component,e.onConfirmed.listener,e.result);if(e.isDenied)return"self"===e.onDenied.component?void Livewire.find(e.onDenied.id).dispatchSelf(e.onDenied.listener,e.result):void Livewire.dispatchTo(e.onDenied.component,e.onDenied.listener,e.result);if(e.onProgressFinished&&e.dismiss===Swal.DismissReason.timer)return"self"===e.onProgressFinished.component?void Livewire.find(e.onProgressFinished.id).dispatchSelf(e.onProgressFinished.listener,e.result):void Livewire.dispatchTo(e.onProgressFinished.component,e.onProgressFinished.listener,e.result);if(e.onDismissed){if("self"===e.onDismissed.component)return void Livewire.find(e.onDismissed.id).dispatch(e.onDismissed.listener,e.result);Livewire.dispatchTo(e.onDismissed.component,e.onDismissed.listener,e.result)}}window.addEventListener("alert",function(){var e=_asyncToGenerator(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){var r,n,o,i,a,c,s,l;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.detail.message,i=null!==(r=t.detail.type)&&void 0!==r?r:null,a=t.detail.data,c=t.detail.events,evalCallbacksOptions(s=t.detail.options),e.next=8,Swal.fire(_objectSpread({title:o,icon:i},s));case 8:afterAlertInteraction(_objectSpread(_objectSpread(_objectSpread({confirmed:(l=e.sent).isConfirmed,denied:l.isDenied,dismiss:l.dismiss,result:_objectSpread(_objectSpread({},l),{},{data:_objectSpread(_objectSpread({},a),{},{inputAttributes:null!==(n=s.inputAttributes)&&void 0!==n?n:null})})},c),l),s));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),window.flashAlert=function(){var e=_asyncToGenerator(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark((function e(t){var r,n,o,i,a,c,s;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.events,a=t.events.data,evalCallbacksOptions(c=t.options),e.next=6,Swal.fire(_objectSpread({title:null!==(r=t.message)&&void 0!==r?r:"",icon:null!==(n=t.type)&&void 0!==n?n:null},c));case 6:afterAlertInteraction(_objectSpread(_objectSpread({confirmed:(s=e.sent).isConfirmed,denied:s.isDenied,dismiss:s.dismiss,result:_objectSpread(_objectSpread({},s),{},{data:_objectSpread(_objectSpread({},a),{},{inputAttributes:null!==(o=c.inputAttributes)&&void 0!==o?o:null})})},i),t.options));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})()})(); </script> <script> </script> <script> </script> <!---Global page js----> <script src="https://sattacademy.com/public/custom/js/globalPage.js"></script> <script src="https://sattacademy.com/public/assets/plugins/global/plugins.bundle.js"></script> <!---Dependable category ----> <script src="https://sattacademy.com/public/js/custom.js"></script> <!--end::Page Custom Javascript--> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script> <!--Toastr Notification --> <script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script> <script> </script> <!--import cart script--> <!--import Global search script--> <script type="text/javascript"> //Margin remove function function revomeMargin(){ $('.search-question').find('p').css({ 'margin' : '0px' }); } //Global search $(document).ready(function() { var timeout = null; $(document).on('keyup', '.global-search-input', function() { var this_input = $(this); //console.log(id) clearTimeout(timeout); timeout = setTimeout(() => { var val = $(this).val(); if (val == "") { $('.global-search-spinner').addClass('d-none'); $('#global-search-result').html(''); } //If val is not empty. else { //show spinner $('.global-search-spinner').removeClass('d-none'); //AJAX is called. $.ajax({ type: "POST", url: "https://sattacademy.com/public/index.php/global-search", headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: { //Assigning value of "val" into "search_txt" variable. search_txt: val, }, //If result found, this funtion will be called. success: function(data) { //console.log(data) $('.global-search-spinner').addClass('d-none'); $('#global-search-result').html(data.html); }, complete:function(){ revomeMargin(); } }); } }, 1000); }); $(document).on('click', '#go-to-search', function(){ //console.log('here'); var val = $('.global-search-input').val(); var url = "/search-results?search_txt="+val; window.location.href = url ; }) }) </script> <script> $(document).ready(function() { $('.select2').select2(); }); document.addEventListener('livewire:navigated', () => { $('.sa-avatar').click(function(e) { $('#profile-menu').addClass('d-flex'); }); // Search $('.fa-search').click(function(e) { $('#global-menu').addClass('d-flex'); }); $(document).click(function(e) { if (e.target.id != 'profile-menu' && !e.target.classList.contains('sa-avatar')) { $('#profile-menu').removeClass('d-flex'); } // Search if (e.target.closest('#global-menu') == null && !e.target.classList.contains('fa-search')) { $('#global-menu').removeClass('d-flex'); } }); }); </script> <script type="text/javascript"> //check mobile device function isMobileDevice() { var check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; }; //Toolbar btn **Menu Show Hide**// $(document).ready(function(){ $(document).on('click', '.toolbar-btn', function(){ $(this).toggleClass('show'); $(this).toggleClass('menu-dropdown'); $(this).closest('div').find('.menu').toggleClass('show'); if(isMobileDevice() == 'false' || isMobileDevice() == false){ $(this).closest('div').find('.menu').css({ 'z-index':'105', 'position':'absolute', 'margin':'0px', 'inset' : '70px 0px auto auto', // 'transform' : 'traslate3d(-30px, 65px, 0px)' }); }else{ $(this).closest('div').find('.menu').css({ 'z-index':'105', 'position':'absolute', 'margin':'0px', 'inset' : '170px 15px auto auto', // 'transform' : 'traslate3d(-15px, 55px, 0px)' }); } }); $('#kt_post').on('click', (evt) => { //console.log(evt.target.classList); const hasClass = evt.target.classList.contains('toolbar-btn'); if(!hasClass){ let isVisible = $('.toolbar-btn').siblings('div.menu-sub').is(":visible"); if(isVisible == true){ $('.toolbar-btn').removeClass('show').removeClass('menu-dropdown'); $('.toolbar-btn').closest('div').find('.menu').removeClass('show'); } } }); }); /**###### begin::vote||love ##########**/ $(document).on('click', '.vote', function(){ var id = $(this).data('id'); var val = $(this).find('span.vote_value').text(); var type = $(this).data('type'); var click_element = $(this); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/vote"+'/'+id+'/'+type, dataType: 'json', success:function(data){ if(data.success){ //console.log(data); click_element.find('span.vote_value').text(parseInt(val)+1); click_element.find('i.fa-heart').addClass('text-danger'); click_element.removeClass('vote'); click_element.addClass('undo-vote'); click_element.data('vote_id', data.vote); //toastr.success(data.message); }else{ toastr.error(data.message); } } }) }); /**####### end::vote ##########**/ /**###### begin::undo vote #######**/ $(document).on('click', '.undo-vote', function(){ var id = $(this).data('vote_id'); var question_id = $(this).data('id'); var val = $(this).find('span.vote_value').text(); var type = $(this).data('type'); //console.log(id); var thisbtn = $(this); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/undo-vote", data:{ 'vote_id': id, 'question_id': question_id, 'type': type }, dataType: 'json', success:function(data){ thisbtn.find('span.vote_value').text(parseInt(val)-1); thisbtn.find('i.fa-heart').removeClass('text-danger'); thisbtn.removeClass('undo-vote'); thisbtn.addClass('vote'); } }); }) /**##### end::undo vote ########**/ /**#### begin::description like #####**/ $(document).on('click', '.description-like', function(){ var id = $(this).data('description_id'); var val = $(this).find('span.des-like').text(); var type = $(this).data('btntype'); var click_element = $(this); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/description/like"+'/'+id, data:{ btntype : type }, dataType: 'json', success:function(data){ if(data.success){ click_element.find('span.des-like').text(parseInt(val)+1); if(type == 'like'){ click_element.find('i.fa-thumbs-up').addClass('text-primary'); }else{ click_element.find('i.fa-thumbs-down').addClass('text-primary'); } click_element.removeClass('description-like'); click_element.addClass('undo-description-like'); click_element.data('vote_id', data.vote); //toastr.success(data.message); }else{ toastr.error(data.message); } } }) }) /**#### end::description like ######**/ /**##### begin::undo-description-like ######**/ $(document).on('click', '.undo-description-like', function(){ var id = $(this).data('vote_id'); var description_id = $(this).data('description_id'); var val = $(this).find('span.des-like').text(); var type = $(this).data('btntype'); //console.log(type); var thisbtn = $(this); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/undo-description-like", data:{ 'vote_id': id, 'description_id': description_id, 'btntype' : type }, dataType: 'json', success:function(data){ if(data.success){ thisbtn.removeClass('undo-description-like'); thisbtn.addClass('description-like'); thisbtn.find('span.des-like').text(parseInt(val) - 1); if(type == 'like'){ thisbtn.find('i.fa-thumbs-up').removeClass('text-primary'); }else{ thisbtn.find('i.fa-thumbs-down').removeClass('text-primary'); } }else{ toastr.error(data.message); } } }); }) /**##### end::undo-description-like #####**/ /**begin::Question Edit**/ //edit Question $(document).on('click', '.editQuestion', function() { var id = $(this).data('id'); var question = $(this).data('question'); var type = $(this).data('type'); //console.log(question); Swal.fire({ text: "Are you sure you want to edit this question?", icon: "warning", showCancelButton: !0, buttonsStyling: !1, confirmButtonText: "Confirm", cancelButtonText: "No, cancel", customClass: { confirmButton: "btn fw-bold btn-danger", cancelButton: "btn fw-bold btn-active-light-primary" } }).then((function (o) { if(o.value){ //if agree if(type == 'written'){ myEditor3.setData(question); $("input[name='question']").val(question); $("input[name='question_id']").val(id); $("#kk_edit_written_question_modal").modal('show'); // $.ajax({ // type:"GET", // url: "https://sattacademy.com/public/index.php/question/edit-written-question"+'/'+id, // dataType: 'json', // success:function(data){ // $("#edit_question_data").html(data.html); // $("#kk_edit_question_modal").modal('show'); // } // }); }else if(type == 'mcq'){ $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/edit-question"+'/'+id, dataType: 'json', success:function(data){ $("#edit_question_data").html(data.html); $("#kk_edit_question_modal").modal('show'); } }); }else if(type == 'samprotik'){ $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/samprotik-question/edit"+'/'+id, dataType: 'json', success:function(data){ $("#edit_question_data").html(data.html); $("#kk_edit_question_modal").modal('show'); } }); } } })) }); //edit question cancel button $(document).on('click', '#kk_modal_new_service_cancel', function(){ //console.log('here'); $('.indicator-label').show() $('.indicator-progress').hide() $('#kk_modal_new_service_submit').removeAttr('disabled') $("#kk_edit_question_modal").modal('hide'); $("#kk_edit_written_question_modal").modal('hide'); }) //update mcq edited question $(document).on('submit', '#kk_modal_question_update_form', function(e){ e.preventDefault() //console.log('here') $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/question/edit-question/update", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger alert-dismissable">' + data.message + '</div>'; $('#kk_modal_question_update_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_question_update_form')[0].reset(); $("#kk_edit_question_modal").modal('hide'); toastr.success(data.message); } $('.indicator-label').show() $('.indicator-progress').hide() $('#kk_modal_new_service_submit').removeAttr('disabled') } }); }) /**end::Question Edit**/ //update written edited question $(document).on('submit', '#kk_modal_written_question_update_form', function(e){ e.preventDefault() //console.log('here') $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/written-question/edited-question/store", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger alert-dismissable">' + data.message + '</div>'; $('#kk_modal_written_question_update_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_written_question_update_form')[0].reset(); $("#kk_edit_written_question_modal").modal('hide'); toastr.success(data.message); } $('.indicator-label').show() $('.indicator-progress').hide() $('#kk_modal_new_service_submit').removeAttr('disabled') } }); }) //update samprotik edited question $(document).on('submit', '#kk_modal_samprotik_question_update_form', function(e){ e.preventDefault() //console.log('here') $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/samprotik-question/edit-question/update", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger alert-dismissable">' + data.message + '</div>'; $('#kk_modal_samprotik_question_update_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_samprotik_question_update_form')[0].reset(); $("#kk_edit_question_modal").modal('hide'); toastr.success(data.message); } $('.indicator-label').show() $('.indicator-progress').hide() $('#kk_modal_new_service_submit').removeAttr('disabled') } }); }) /**end::Question Edit**/ /**#########begin::Description ########**/ //get description// $(document).on('click', '.getDescription', function(){ var id = $(this).data('id'); var type = $(this).data('type'); //console.log(type); var thisbtn = $(this); $.ajax({ type:"GET", beforeSend: function(){ thisbtn.closest('span').find('.indicator-progress').show(); }, url: "https://sattacademy.com/public/index.php/description/get-des"+'/'+id+'/'+type, dataType: 'json', success:function(data){ thisbtn.parents('div.card-footer').find('div.all-description').html(data.html); thisbtn.removeClass('getDescription'); $('.indicator-progress').hide(); MathJax.Hub.Typeset(); }, complete: function(){ //call the function on page load tableWrap(); imageSize(); $('.indicator-progress').hide(); } }); }) //add new description $(document).on('click', '.addDescription', function() { var id = $(this).data('id'); var type = $(this).data('type'); //console.log(id); $('.with-errors').text(''); $('.messages').text(''); myEditor.setData(''); $('#kk_modal_new_question_des_form')[0].reset(); $('input[name="question_id"]').val(id); $('input[name="type"]').val(type); $('#kk_modal_new_question_des').modal('show'); }); //new description save// $('#kk_modal_new_question_des_form').on('submit',function(e){ e.preventDefault() $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); formData.append('description', myEditor.getData()); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/description/store", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_new_question_des_form').find('.messages').html(alertBox).show(); }else{ // empty the form myEditor.setData(''); $('#kk_modal_new_question_des_form')[0].reset(); $("#kk_modal_new_question_des").modal('hide'); toastr.success(data.message); } $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } }); }) //add description cancel button// $(document).on('click', '#kk_modal_add_description_cancel', function(){ $('.with-errors').text(''); $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); $('#kk_modal_new_question_des_form')[0].reset(); $("#kk_modal_new_question_des").modal('hide'); }) /**########begin::edit-description#########**/ $(document).on('click', '.edit-description', function(){ var des_id = $(this).data('description_id'); var description = $(this).data('description'); var question_id = $(this).data('question_id'); var type = $(this).data('type'); //console.log(des_id); Swal.fire({ text: "Are you sure you want to edit this description?", icon: "warning", showCancelButton: !0, buttonsStyling: !1, confirmButtonText: "Confirm", cancelButtonText: "No, cancel", customClass: { confirmButton: "btn fw-bold btn-danger", cancelButton: "btn fw-bold btn-active-light-primary" } }).then((function (o) { if(o.value){ //if agree myEditor4.setData(description); $("textarea[name='description']").val(description); $("input[name='description_id']").val(des_id); $("input[name='question_id']").val(question_id); $("input[name='type']").val(type); $("#kk_modal_edit_description").modal('show'); // $("#kk_modal_edit_description").modal({ // focus: false // }); // $.ajax({ // type:"GET", // url: "https://sattacademy.com/public/index.php/description/edit-des", // dataType: 'json', // data:{ // 'description_id' : des_id // }, // success:function(data){ // $("#edit_description_data").html(data.html); // $("#kk_modal_edit_description").modal('show'); // } // }); } })) }); //update description// $(document).on('submit', '#kk_modal_edit_description_form',function(e){ e.preventDefault() $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); //formData.append('description', myEditor.getData()); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/description/update", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_edit_description_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_edit_description_form')[0].reset(); $("#kk_modal_edit_description").modal('hide'); toastr.success(data.message); } $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } }); }) //description edit cancel button// $(document).on('click', '#kk_modal_edit_description_cancel', function(){ $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); $('#kk_modal_edit_description_form')[0].reset(); $("#kk_modal_edit_description").modal('hide'); }) /**######### Show Hide Description #######*/ $(document).on('click', '.show-des', function(){ $(this).closest('span').find('.fa-caret-right').css({ "transform" : "rotate(90deg)" }); $(this).addClass('hide-des'); $(this).parents('div.card-footer').find('div.all-description').removeClass('d-none'); }) $(document).on('click', '.hide-des', function(){ $(this).closest('span').find('.fa-caret-right').css({ "transform" : "rotate(360deg)" }); $(this).parents('div.card-footer').find('div.all-description').addClass('d-none'); $(this).removeClass('hide-des'); }) /**########## end::Description #######**/ /**###### begin:: Bookmark ######**/ $(document).ready(function(){ var thisbtn ; $(document).on('click', '.bookmark', function() { var id = $(this).data('id'); var catid = $(this).data('catid'); var type = $(this).data('type'); //console.log('type'); // console.log(catid); thisbtn = $(this); $('.with-errors').text(''); $('#kk_modal_new_bookmark_form')[0].reset(); //append category_id and question_id into bookmark form $('input[name="question_id"]').val(id); $('input[name="catid"]').val(catid); $('input[name="type"]').val(type); $('#kk_modal_new_bookmark').modal('show'); }); //new bookmark save// $('#kk_modal_new_bookmark_form').on('submit',function(e){ e.preventDefault() $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/question/bookmark", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger alert-dismissable">' + data.message + '</div>'; $('#kk_modal_new_bookmark_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_new_bookmark_form')[0].reset(); $("#kk_modal_new_bookmark").modal('hide'); toastr.success(data.message); //footer btn change on footer btn click thisbtn.addClass('remove-bookmark'); thisbtn.data('bookmark_id', data.bookmark.id); thisbtn.removeClass('bookmark') thisbtn.children().addClass('text-primary'); //tolbar html change on footer btn click thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').addClass('remove-bookmark'); thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').data('bookmark_id', data.bookmark.id); thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').removeClass('bookmark'); thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').text('Remove Bookmark'); //toolbar btn chnage on toolbar btn click thisbtn.parent('div.bookmark-btn').find('a').text('Remove Bookmark'); thisbtn.parent('div.bookmark-btn').find('a').addClass('remove-bookmark'); thisbtn.parent('div.bookmark-btn').find('a').removeClass('bookmark'); //footer button change on toolbar btn click thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').addClass('remove-bookmark'); thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').data('bookmark_id', data.bookmark.id); thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').children().addClass('text-primary'); } $('.indicator-progress').hide(); $('.indicator-label').show(); } }); }); //cancel button// $('#kk_modal_bookmark_cancel').on('click', function(){ $('.messages').empty(); $('.with-errors').text(''); $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_bookmark_form')[0].reset(); $('#kk_modal_new_bookmark').modal('hide'); }) }); /**####### end:: Bookmark ###########**/ /**######## begin::remove from bookmark ########**/ $(document).on('click', '.remove-bookmark', function(){ var id = $(this).data('bookmark_id'); //console.log('remove'); var thisbtn = $(this); Swal.fire({ text: "Are you sure you want to remove this Question from your bookmarks?", icon: "warning", showCancelButton: !0, buttonsStyling: !1, confirmButtonText: "Yes, remove", cancelButtonText: "No, cancel", customClass: { confirmButton: "btn fw-bold btn-danger", cancelButton: "btn fw-bold btn-active-light-primary" } }).then((function (o) { if(o.value){ //if agree $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/remove-from-bookmark", dataType: 'json', data:{ 'id' : id }, success:function(data){ toastr.success(data.message); //footer btn change on footer btn click thisbtn.removeClass('remove-bookmark'); thisbtn.addClass('bookmark'); thisbtn.children().removeClass('text-primary'); //tolbar html change on footer btn click thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').addClass('bookmark'); thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').removeClass('remove-bookmark'); thisbtn.parents('div.card-footer').siblings('div.card-header').find('div.bookmark-btn').find('a').text('Add Bookmark'); //toolbar btn chnage on toolbar btn click thisbtn.parent('div.bookmark-btn').find('a').text('Add Bookmark'); thisbtn.parent('div.bookmark-btn').find('a').addClass('bookmark'); thisbtn.parent('div.bookmark-btn').find('a').removeClass('remove-bookmark'); //footer button change on toolbar btn click thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').addClass('bookmark'); thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').removeClass('remove-bookmark'); thisbtn.parents('div.card-header').siblings('div.card-footer').find('div.footer-bookmark').find('a').children().removeClass('text-primary'); } }); } })) }) /**####### end::remove from bookmark ##########**/ /**####### begin::Video section ######**/ $(document).on('click', '.add-video', function() { $('#kk_modal_show_video').modal('hide'); var id = $(this).data('id'); // console.log(id); var type = $(this).data('type'); $('input[name="data_id"]').val(id); $('input[name="type"]').val(type); $('#kk_modal_add_video').modal('show'); }); $(document).on('click', '#kk_modal_add_video_cancel', function(){ $('.messages').empty(); $('.with-errors').text(''); $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_add_video').modal('hide'); }) //add video// $(document).on('submit', '#kk_modal_new_video_form',function(e){ e.preventDefault(); $('.messages').empty(); $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/question/video/store", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_new_video_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_new_video_form')[0].reset(); $("#kk_modal_add_video").modal('hide'); toastr.success(data.message); } $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } }); }) //show video// $(document).on('click', '.show-video', function() { var id = $(this).data('id'); // console.log(id); var type = $(this).data('type'); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/video/show"+ '/' + id + '/' + type, dataType: 'json', beforeSend:function(){ $('#kk_modal_add_video').modal('hide'); }, success:function(data){ $("#video_data").html(data.html); $("#kk_modal_show_video").modal('show'); }, complete:function(){ var w = window.innerWidth; var h = window.innerHeight; // console.log(w); // console.log(h); if(w <= 390 ){ $('iframe').css({ 'width' : '100%', 'height' : 'auto' }) }else if(w > 390 && w <= 576){ $('iframe').css({ 'width' : '100%', 'height' : '200px' }) }else if(w > 576 && w <= 768){ $('iframe').css({ 'width' : '100%', 'height' : '250px' }) }else{ $('iframe').css({ 'width' : '100%', 'height' : '315px' }) } } }); }); $(document).on('click', '#kk_modal_show_video_cancel', function(){ $('#kk_modal_show_video').modal('hide'); }) /**###### end::Video section ########**/ /**####### begin::add tag ###########**/ //add new// $(document).on('click', '.tag', function() { var id = $(this).data('id'); var subject_id = $(this).data('subject_id'); var type = $(this).data('type'); // console.log(id); // console.log(subject_id); //clear $('input[name="question_id"]').val(''); $('input[name="subject_id"]').val(''); $('input[name="type"]').val(''); $('input[name="tag"]').val(''); $('div.result').html(''); $('div.tag-div_2').html(''); //append subject_id and question_id into tag modal// $('input[name="question_id"]').val(id); $('input[name="subject_id"]').val(subject_id); $('input[name="type"]').val(type); $('#kk_modal_add_tag').modal('show'); }); //search tag// $(document).ready(function() { var timeout = null; $(document).on('keyup', '.search_tag', function() { var question_id = $('input[name="question_id"]').val(); var subject_id = $('input[name="subject_id"]').val(); var type = $('input[name="type"]').val(); var this_input = $(this); //console.log(id) clearTimeout(timeout); timeout = setTimeout(() => { var val = $(this).val(); if (val == "") { $('.result').html(''); } //If val is not empty. else { //AJAX is called. $.ajax({ type: "POST", url: "https://sattacademy.com/public/index.php/question/tag/search", headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: { //Assigning value of "val" into "search" variable. search: val, question_id : question_id, subject_id : subject_id, type : type }, //If result found, this funtion will be called. success: function(data) { //console.log(data) this_input.closest('div').find('.result').html(data); //this_input.closest('#result').hide() //$('#result').html(data); } }); } }, 700); }); }) $(document).on('click', '#kk_modal_tag_close', function(){ //clear $('input[name="question_id"]').val(''); $('input[name="subject_id"]').val(''); $('input[name="tag"]').val(''); $('input[name="type"]').val(''); $('div.result').html(''); $('div.tag-div_2').html(''); $('#kk_modal_add_tag').modal('hide'); }) //add tag $(document).on('click', '.add-tag', function(){ var sid = $(this).data('sid'); var qid = $(this).data('qid'); var type = $(this).data('type'); var thisElement = $(this); //AJAX is called. $.ajax({ type: "POST", url: "https://sattacademy.com/public/index.php/question/tag/tag-added", headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: { //Assigning value of "val" into "search" variable. subject_id: sid, question_id : qid, type : type }, //If result found, this funtion will be called. success: function(data) { if(data.success){ toastr.success(data.message); // $('#kk_modal_add_tag').modal('hide'); // $('.result').html(''); // $('.search_tag').val(''); thisElement.removeClass('add-tag'); thisElement.addClass('remove-tag'); let html = `<span class="badge badge-info cursor-pointer fs-8 mb-3 me-2 remove-tag" data-sid="${data.subject.id}" data-qid="${data.question_id}" data-type="${data.type}" title="Remove">${data.subject.name}</span>`; thisElement.parents('div.modal-body').find('div.tag-div_2').append(html); } else{ toastr.error(data.message); } } }); }) //remove tag// $(document).on('click', '.remove-tag', function(){ var sid = $(this).data('sid'); var qid = $(this).data('qid'); var type = $(this).data('type'); //console.log(sid); //console.log(type); var thisBtn = $(this); console.log(thisBtn); //AJAX is called. $.ajax({ type: "POST", url: "https://sattacademy.com/public/index.php/admin/question/remove-tag", headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: { //Assigning value of "val" into "search" variable. subject_id: sid, question_id : qid, type : type }, //If result found, this funtion will be called. success: function(data) { if(data.success){ toastr.success(data.message); thisBtn.removeClass('remove-tag'); thisBtn.addClass('add-tag'); thisBtn.parents('div.modal-body').find('.tag-div_2 span[data-sid="'+ sid +'"]').remove(); //location.reload(); } else{ toastr.error(data.message) } } }); }) /**####### end::Tag #########**/ /*##### begin::Error Report #####*/ function cleanForm(){ $('.messages').empty(); $('.with-errors').text(''); $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_error_report_form')[0].reset(); } $(document).on('click', '.error-report', function(){ const id = $(this).data('id'); const type = $(this).data('type'); cleanForm(); $('input[name="id"]').val(id); $('input[name="type"]').val(type); $('#kk_modal_error_report').modal('show'); }) $(document).on('click', '#kk_modal_error_report_cancel', function(){ cleanForm(); $('#kk_modal_error_report').modal('hide'); }) //submit $(document).on('submit', '#kk_modal_error_report_form',function(e){ e.preventDefault(); $('.messages').empty(); $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/error-report/store", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_error_report_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_error_report_form')[0].reset(); $("#kk_modal_error_report").modal('hide'); toastr.success(data.message); } $('.indicator-label').show(); $('.indicator-progress').hide(); } }); }) /*##### end::Error Report #####*/ /* begin::voteing script */ $(document).on('click', '.choosen-option', function(){ if($(this).is(':checked')) { var choosen = $(this).val(); }else{ var choosen = 0; } let ques_id = $(this).data('ques_id'); //console.log(choosen); //set & get local storage data let previous = localStorage.getItem('key'); localStorage.setItem('key', choosen); //console.log(previous); const thisElement = $(this); incrementDecrement(thisElement, choosen, previous); //AJAX is called. $.ajax({ type: "POST", url: "https://sattacademy.com/public/index.php/mcq-question/answer-vote", headers: {'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}, data: { ques_id: ques_id, choosen : choosen, }, //If result found, this funtion will be called. success: function(data) { if(data.success){ console.log(data.message); }else{ toastr.error(data.message); } } }); }) /* end::voteing script */ function onlyOne(checkbox) { let name = $(checkbox).attr('name'); var checkboxes = document.getElementsByName(name) checkboxes.forEach((item) => { if (item !== checkbox) item.checked = false }) } function incrementDecrement(thisElement, choosen, previous){ var option1 = thisElement.parents('div.parent-card-body').find('span.vote_option_1'); var option2 = thisElement.parents('div.parent-card-body').find('span.vote_option_2'); var option3 = thisElement.parents('div.parent-card-body').find('span.vote_option_3'); var option4 = thisElement.parents('div.parent-card-body').find('span.vote_option_4'); var option5 = thisElement.parents('div.parent-card-body').find('span.vote_option_5'); if(choosen == 1){ let val = parseInt(option1.text()); option1.text(val+1); }else if(choosen == 2){ let val = parseInt(option2.text()); option2.text(val+1); }else if(choosen == 3){ let val = parseInt(option3.text()); option3.text(val+1); }else if(choosen == 4){ let val = parseInt(option4.text()); option4.text(val+1); }else if(choosen == 5){ let val = parseInt(option5.text()); option5.text(val+1); } if(previous == 1){ let val = parseInt(option1.text()); if(val > 0){ option1.text(val-1); } }else if(previous == 2){ let val = parseInt(option2.text()); if(val > 0){ option2.text(val-1); } }else if(previous == 3){ let val = parseInt(option3.text()); if(val > 0){ option3.text(val-1); } }else if(previous == 4){ let val = parseInt(option4.text()); if(val > 0){ option4.text(val-1); } }else if(previous == 5){ let val = parseInt(option5.text()); if(val > 0){ option5.text(val-1); } } } </script> <script type="text/javascript"> /**######begin::test mode & reading mode hide show #######**/ $(document).ready(function(){ $('.test-mode-data').addClass('d-none'); $('input[name="active_mode"]').val('reading'); $('.test-mode').on('click', function(){ $('.test-mode-data').removeClass('d-none'); $('.reading-mode-data').addClass('d-none'); $('.edit-btn-div').addClass('d-none'); $(this).addClass('d-none'); $('.mark-count').removeClass('d-none'); $('.reading-mode').removeClass('d-none'); $('input[name="active_mode"]').val('test'); $('.toolbar-div').addClass('d-none'); $('.tag-div').addClass('d-none'); $('.activity').addClass('d-none'); }) $('.reading-mode').on('click', function(){ $('.reading-mode-data').removeClass('d-none'); $('.test-mode-data').addClass('d-none'); $('.edit-btn-div').removeClass('d-none'); $(this).addClass('d-none'); $('.mark-count').addClass('d-none'); $('.test-mode').removeClass('d-none'); $('input[name="active_mode"]').val('reading'); $('.toolbar-div').removeClass('d-none'); $('.tag-div').removeClass('d-none'); $('.activity').removeClass('d-none'); }) }) /**######end::test mode & reading mode hide show #######**/ /**######begin::Test #######**/ $(document).ready(function(){ $(document).on('click', '.click-option', function(){ var id = $(this).data('id') var option_value = $(this).data('option_value'); var answer = $(this).parents('div.parent-row').find('input[name="answer"]').val(); // console.log('question='+id); // console.log('option='+option_value); // console.log('answer='+answer); $(this).parents('div.parent-row').find('span').click(function() { return false; }); $(this).parents('div.parent-row').find('div.click-option').removeClass('cursor-pointer'); if(answer == 1){ $(this).parents('div.parent-row').find('i.option-1').removeClass('fa-dot-circle text-dark'); $(this).parents('div.parent-row').find('i.option-1').addClass('fa-check-circle fs-5 sa-success'); $(this).parents('div.parent-row').find('div.option-1-text').removeClass('text-dark'); $(this).parents('div.parent-row').find('div.option-1-text').addClass('sa-success fs-3 fw-bold'); }else if(answer == 2){ $(this).parents('div.parent-row').find('i.option-2').removeClass('fa-dot-circle text-dark'); $(this).parents('div.parent-row').find('i.option-2').addClass('fa-check-circle fs-5 sa-success'); $(this).parents('div.parent-row').find('div.option-2-text').removeClass('text-dark'); $(this).parents('div.parent-row').find('div.option-2-text').addClass('sa-success fs-3 fw-bold'); }else if(answer == 3){ $(this).parents('div.parent-row').find('i.option-3').removeClass('fa-dot-circle text-dark'); $(this).parents('div.parent-row').find('i.option-3').addClass('fa-check-circle fs-5 sa-success'); $(this).parents('div.parent-row').find('div.option-3-text').removeClass('text-dark'); $(this).parents('div.parent-row').find('div.option-3-text').addClass('sa-success fs-3 fw-bold'); }else if(answer == 4){ $(this).parents('div.parent-row').find('i.option-4').removeClass('fa-dot-circle text-dark'); $(this).parents('div.parent-row').find('i.option-4').addClass('fa-check-circle fs-5 sa-success'); $(this).parents('div.parent-row').find('div.option-4-text').removeClass('text-dark'); $(this).parents('div.parent-row').find('div.option-4-text').addClass('sa-success fs-3 fw-bold'); }else if(answer == 5){ $(this).parents('div.parent-row').find('i.option-5').removeClass('fa-dot-circle text-dark'); $(this).parents('div.parent-row').find('i.option-5').addClass('fa-check-circle fs-5 sa-success'); $(this).parents('div.parent-row').find('div.option-5-text').removeClass('text-dark'); $(this).parents('div.parent-row').find('div.option-5-text').addClass('sa-success fs-3 fw-bold'); } if(answer == option_value){ var val = $('#wright').html(); $('#wright').html(parseInt(val)+1); $(this).find('span.d-flex').append('<span class="ms-2"><i class="fas fa-check sa-success fs-3"></i></span>'); }else{ var val = $('#wrong').html(); //console.log(val) $('#wrong').html(parseInt(val)+1); $(this).find('span.d-flex').append('<span class="ms-2"><i class="fas fa-times sa-danger fs-3"></i></span>'); } }) }) /**######end::Test #######**/ /**begin::Question Edit**/ // //edit Question // $(document).on('click', '.editQuestion', function() { // var id = $(this).data('id'); // //console.log(id); // Swal.fire({ // text: "Are you sure you want to edit this Question?", // icon: "warning", // showCancelButton: !0, // buttonsStyling: !1, // confirmButtonText: "Confirm", // cancelButtonText: "No, cancel", // customClass: { // confirmButton: "btn fw-bold btn-danger", // cancelButton: "btn fw-bold btn-active-light-primary" // } // }).then((function (o) { // if(o.value){ //if agree // $.ajax({ // type:"GET", // url: "https://sattacademy.com/public/index.php/question/edit-question"+'/'+id, // dataType: 'json', // success:function(data){ // $("#edit_question_data").html(data.html); // $("#kk_edit_question_modal").modal('show'); // } // }); // } // })) // }); // //edit question cancel button // $(document).on('click', '#kk_modal_new_service_cancel', function(){ // $('.indicator-label').show() // $('.indicator-progress').hide() // $('#kk_modal_new_service_submit').removeAttr('disabled') // $("#kk_edit_question_modal").modal('hide'); // }) // //update edited question // $(document).on('submit', '#kk_modal_question_update_form', function(e){ // e.preventDefault() // //console.log('here') // $('.with-errors').text(''); // $('.indicator-label').hide(); // $('.indicator-progress').show(); // var formData = new FormData(this); // $.ajax({ // type:"POST", // url: "https://sattacademy.com/public/index.php/question/edit-question/update", // data:formData, // cache:false, // contentType: false, // processData: false, // success:function(data){ // if(data.success == false || data.success == "false"){ // var arr = Object.keys(data.errors); // var arr_val = Object.values(data.errors); // for(var i= 0;i < arr.length;i++){ // $('.'+arr[i]+'-error').text(arr_val[i][0]) // } // }else if(data.error || data.error == 'true'){ // var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; // $('#kk_modal_question_update_form').find('.messages').html(alertBox).show(); // }else{ // // empty the form // $('#kk_modal_question_update_form')[0].reset(); // $("#kk_edit_question_modal").modal('hide'); // toastr.success(data.message); // } // $('.indicator-label').show() // $('.indicator-progress').hide() // $('#kk_modal_new_service_submit').removeAttr('disabled') // } // }); // }) // /**end::Question Edit**/ /**########begin::edit-passage #########**/ $(document).on('click', '.edit-passage', function(){ var passage_id = $(this).data('passage_id'); //console.log(des_id); Swal.fire({ text: "Are you sure you want to edit this passage?", icon: "warning", showCancelButton: !0, buttonsStyling: !1, confirmButtonText: "Confirm", cancelButtonText: "No, cancel", customClass: { confirmButton: "btn fw-bold btn-danger", cancelButton: "btn fw-bold btn-active-light-primary" } }).then((function (o) { if(o.value){ //if agree $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/question/passage/edit", dataType: 'json', data:{ 'passage_id' : passage_id }, success:function(data){ $("#edit_passage").html(data.html); $("#kk_modal_edit_passage").modal('show'); } }); } })) }); //update passage $(document).on('submit', '#kk_modal_edit_passage_form',function(e){ e.preventDefault() $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); // formData.append('passage', myPassaseEditor.getData()); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/question/passage/update", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_edit_passage_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_edit_passage_form')[0].reset(); $("#kk_modal_edit_passage").modal('hide'); toastr.success(data.message); } $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } }); }) //passage edit cancel button $(document).on('click', '#kk_modal_edit_passage_cancel', function(){ $('.indicator-label').show(); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); $('#kk_modal_edit_passage_form')[0].reset(); $("#kk_modal_edit_passage").modal('hide'); }) /**#########end::edit-passage ##########**/ </script> <script type="text/javascript"> $(document).ready(function(){ $(document).on('click', '.test-yourself', function(){ $(this).text('Loading...'); var id = $(this).data('subject_id'); var total_ques = $(this).data('total_ques'); //console.log(id); $('.with-errors').text(''); $('#error-message').html(''); $('.messages').html(''); $('#kk_modal_self_test_form')[0].reset(); $('input[name="subject_id"]').val(id); var val = '<label class="d-flex align-items-center fs-6 fw-bold mb-2"><span class="">Subject Total Question</span> </label>' val += '<span class="badge badge-primary badge-lg " id="total">' + total_ques + '</span>' $('#total_question').html(val); $('#kk_modal_new_service_submit_btn').attr('disabled' , true); $('#kk_modal_self_test').modal('show'); setTimeout(() => { $(this).text('TEST'); }, 2000); }); //calculate the mark, time, cut mark function calculatePassMark(totalQuestion, value) { let val = Math.round((value * totalQuestion) / 100); return val ; } function calculateDuration(totalQuestion, value) { let val = Math.round((value * totalQuestion) / 100); return val ; } //empty the error message $(document).on('keyup', ".number_of_ques", function () { if(isNaN($(this).val()) || $(this).val() == NaN || $(this).val() == '') { $('#error-message').html(''); $('#kk_modal_new_service_submit_btn').attr('disabled', true); $('input[name="duration"]').val(''); $('input[name="cut_mark"]').val(''); $('input[name="total_mark"]').val(''); } }) //count input number of question value $(document).on('keyup', ".number_of_ques", function () { //console.log('here'); var input_total = 0; input_total += parseInt($(this).val()) var total_question = parseInt($('#total').text()); // console.log(total_question) $('#error-message').html(''); if(isNaN(input_total) || input_total == NaN) { input_total = 0; //console.log(input_total); } if(input_total > 0) { //set the total mark value $('input[name="total_mark"]').val(input_total); let pass_mark = calculatePassMark(input_total, 40); $('input[name="cut_mark"]').val(pass_mark); let exam_duration = calculateDuration(input_total, 60); $('input[name="duration"]').val(exam_duration); }else { $('input[name="duration"]').val(''); $('input[name="cut_mark"]').val(''); $('input[name="total_mark"]').val(''); } if ( input_total > total_question || input_total > 200 || input_total < 5 && input_total > 0){ $('#error-message').html( `<span class="text-danger">Number of input question must be grater than or equal <span class="fw-bolder">5</span> and less than <span class="fw-bolder">100</span>.</span>` ); $('#kk_modal_new_service_submit_btn').attr('disabled', true); }else{ $('#error-message').html(''); $('#kk_modal_new_service_submit_btn').attr('disabled', false); } }) $(document).on('click', '#kk_modal_self_test_cancel', function(){ $('.with-errors').text(''); $('.messages').html(''); $('.test-yourself').text('TEST'); $('.indicator-label').show(); $('#error-message').html(''); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); $('#kk_modal_self_test_form')[0].reset(); $('#kk_modal_self_test').modal('hide'); }) //submit// $(document).on('submit', '#kk_modal_self_test_form', function(e){ e.preventDefault() $('.with-errors').text(''); $('.indicator-label').hide(); $('.indicator-progress').show(); var formData = new FormData(this); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/test", data:formData, cache:false, contentType: false, processData: false, success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger alert-dismissable">' + data.message + '</div>'; $('#kk_modal_self_test_form').find('.messages').html(alertBox).show(); }else{ // empty the form $('#kk_modal_self_test_form')[0].reset(); $("#kk_modal_self_test").modal('hide'); $('.messages').html(''); //console.log(data); window.location.href = data.data.url+'?s_id='+data.data.subject_id+ '&n_o_q='+data.data.number_of_question+ '&t_m='+data.data.total_mark+ '&c_m='+data.data.cut_mark+ '&n_m='+data.data.negative_mark+ '&du='+data.data.duration; } $('.indicator-label').show(); $('.test-yourself').text('TEST'); $('#error-message').html(''); $('.indicator-progress').hide(); $('#kk_modal_new_service_submit').removeAttr('disabled'); } }); }) }); </script> <script type="text/javascript"> $(document).on('click', '.kt_user_follow_button', function(){ //console.log('Follow btn click'); var id = $(this).data('id'); var thisBtn = $(this); $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/user-follow" + "/" + id, data:{}, beforeSend:function(){ thisBtn.find('.indicator-label').hide(); thisBtn.find('.indicator-progress').show(); }, success:function(data){ if(data.success){ if(data.value == 'follow'){ $('.indicator-label').show(); $('.indicator-progress').hide(); thisBtn.removeClass('btn-primary').addClass('btn-success'); thisBtn.find('.indicator-label').text('Following'); let followers = parseInt(thisBtn.parent('div.d-flex').find('.follower_count').html()); thisBtn.parent('div.d-flex').find('.follower_count').html(`${followers + 1}`); }else{ $('.indicator-label').show(); $('.indicator-progress').hide(); thisBtn.removeClass('btn-success').addClass('btn-primary'); thisBtn.find('.indicator-label').text('Follow'); let followers = parseInt(thisBtn.parent('div.d-flex').find('.follower_count').html());; thisBtn.parent('div.d-flex').find('.follower_count').html(`${followers - 1}`); } }else{ toastr.error(data.message); $('.indicator-label').show(); $('.indicator-progress').hide(); } } }); }); </script> <script type="text/javascript"> //user short statistics $(document).on('mouseover', '.user-statistics', function(){ let id = $(this).data('id'); let flug = $(this).data('flug'); //console.log(flug); const thisElement = $(this); if(flug == '-1'){ $.ajax({ type:"GET", url: "https://sattacademy.com/public/index.php/user-short-statistics"+'/'+id, data:{}, dataType: 'json', success:function(data){ if(data.success == true || data.success == 'true'){ thisElement.prepend(data.html); thisElement.data('flug', '1'); }else{ toastr.error(data.message); } } }); } }); // //close $(document).on('mouseleave', '.user-statistics', function(){ //console.log('leave'); let flug = $(this).data('flug', '-1'); $('div.statistics-data').hide(); }) </script> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"></script> <script type="text/javascript"> $(document).ready(function() { //call the function on page load tableWrap(); imageSize(); //table wrap function function tableWrap() { $("table").wrap(`<div class="table-responsive w-100"></div>`); $("table").addClass('table table-striped table-bordered'); $("table").find('thead').addClass('thead-dark fw-bolder fs-4'); $("table").find('th').addClass('ps-2'); $("table").find('td').addClass('ps-2'); $("table").css({ 'max-width': '100%', 'margin-top': '10px', 'margin-bottom': '10px', }); $("table").find('thead').css({ 'background-color': 'gray', 'color': 'white' }); }; //image sizeing function function imageSize() { $("img").not('.toolbar-img').wrap(`<div class="w-100"></div>`); $("img").css({ 'max-width': '100%', 'margin-top': '10px', 'margin-bottom': '10px', }); } /*toggle btn*/ $('#toggle-subject-chapter').on('click', function() { $("#toggle-div").slideToggle(500); $(this).find('i.fas').toggleClass('fa-chevron-down fa-chevron-up'); }) }) </script> <script type="text/javascript"> //Newsletter Subscriber $(document).on('click', '#kk_newsletter_subscriber', function(e){ e.preventDefault() //console.log('here') $('.with-errors').text('') var thisaddbtn = $(this); var email = $('input[name=email]').val(); // console.log(email); $.ajax({ type:"POST", url: "https://sattacademy.com/public/index.php/newsletter-subscriber/store", data:{ "_token": "ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO", email : email, }, dataType: "json", success:function(data){ if(data.success == false || data.success == "false"){ var arr = Object.keys(data.errors); var arr_val = Object.values(data.errors); for(var i= 0;i < arr.length;i++){ $('.'+arr[i]+'-error').text(arr_val[i][0]) } }else if(data.error || data.error == 'true'){ var alertBox = '<div class="alert alert-danger" alert-dismissable">' + data.message + '</div>'; $('#kk_modal_new_question_form').find('.messages').html(alertBox).show(); }else{ toastr.success(data.message); $("#subscriber_email").val(''); } } }); }) </script> <script src="/livewire/livewire.min.js?id=87e1046f" data-csrf="ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" data-update-uri="/livewire/update" data-navigate-once="true"></script> <!--begin::dynamic promotion | Adveritsement--> <script type="text/javascript"> function card(content, options = { withLink: true, countClick: true }) { let card = ''; if (content.target_url && options?.withLink) { card += `<a href="/promotion-link?id=${content.id}&countClick=${options?.countClick}&_token=ujfPPfcf9qZhR9lQSjd1h0xkM8Gmo19TighzKbAO" target="_blank">`; } card += `<div class="card card-rounded promotion-card">`; if (content.content_header) { card += `<div class="p-4 fw-bolder fs-6" style="border-bottom: 1px solid #eff2f5;"> ${content.content_header} </div>`; } if (content.type == 'custom') { card += `<div class="card-body p-4"> ${content.content} </div>`; } else if (content.type == 'image') { card += `<img src="${content.image}" style="height: 100%;" />`; } else if (content.type == 'video') { if (content.video.includes('youtube.com/') || content.video.includes('vimeo.com/')) { card += `<iframe src="${convertToEmbedUrl(content.video)}" style="width: 100%; aspect-ratio: 16/9;" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`; } else { card += `<video src="${content.video}" class="rounded my-auto promoted-video" style="width: 100%;" controls autoplay loop muted playsinline />`; } } else if (content.type == 'book') { card += ` <div class="row g-0 h-100"> <div class="col-4"> <img src="${content.book.cover_image}" class="img-fluid rounded-start" style="height: 100%; object-fit: cover; max-height: 200px;" alt="..."> </div> <div class="col-8"> <div class="card-body p-4"> <span class="fs-9 text-muted">BOOK</span> <h5 class="card-title"> ${content.book.name} </h5> <div class="my-1"> ${content.book.author_name ? '<span class="fs-7 text-gray-700">' + content.book.author_name + '</span>' : ''} <span class="fs-7 text-gray-700"> by ${content.book.business?.name || 'Satt Academy'}</span><br> </div> <div class="d-flex align-items-center justify-content-between"> <span class=""> ${content.book.price == 0 || content.book.price == '0' || content.book.price == null ? '<span class="badge badge-success">Free</span>' : '<span class="fw-bold text-danger fs-6">৳' + content.book.price + '</span>'} </span> <span> <i class="fs-5 fas fa-${content.book.book_type == 'soft_copy' ? 'file-pdf text-danger' : 'book text-info'}"></i> </span> </div> </div> </div> </div> `; } else if (content.type == 'course') { //console.log(content); card += ` <div class="row g-0 h-100"> <div class="col-4"> <img src="${content.course.cover_photo}" class="img-fluid rounded-start" style="height: 100%; object-fit: cover;" alt="..."> </div> <div class="col-8"> <div class="card-body p-4"> <span class="fs-9 text-muted">COURSE</span> <h5 class="card-title"> ${content.course.name} </h5> <div class="my-1"> ${content.course.author_name ? '<span class="fs-7 text-gray-700">' + content.course.author_name + '</span>' : ''} <span class="fs-7 text-gray-700"> by ${content.course.business?.name || 'Satt Academy'}</span><br> </div> <div class="d-flex align-items-center justify-content-between"> <span class=""> ${content.course.price == 0 || content.course.price == '0' || content.course.price == null ? '<span class="badge badge-success">Free</span>' : '<span class="fw-bold text-danger fs-6">৳' + content.course.price + '</span>'} </span> <span class="rounded text-white p-1 fs-9" style="background-color: #D82D2F">${content.course.course_level.toUpperCase()}</span> </div> </div> </div> </div> `; } else if (content.type == 'exam') { card += ` <div class="row g-0 h-100"> <div class="col-12"> <div class="card-body p-4"> <span class="fs-8 pb-3">MODEL TEST || SATT ACADEMY</span> <h5 class="text-primary text-capitalize fs-3 fw-bold mb-1"> ${content.exam.name} </h5> <p class="m-0">by ${ content.exam.business?.name ?? 'Satt Academy' }</p> <div class="d-flex mt-2 gap-2 justify-content-between align-items-end"> <div class="d-flex align-items-center gap-2"> <span class="badge badge-secondary">${content.exam.duration} min</span> <span class="badge badge-secondary">${content.exam.number_of_question} questions</span> <span class="badge badge-secondary">${content.exam.total_mark} marks</span> </div> <div class="btn btn-primary sa-btn-primary py-2 px-3 fs-7">Attend now!</div> </div> </div> </div> </div> `; } if (content.content_footer) { card += `<div class="card-footer p-4"> ${content.content_footer} </div>`; } card += `</div>`; if (content.target_url && options?.withLink) { card += `</a>`; } return card; } function convertToEmbedUrl(videoUrl) { // YouTube URL patterns const youtubePattern1 = /youtube\.com\/watch\?v=([^&]+)/; const youtubePattern2 = /youtu\.be\/([^?]+)/; // Vimeo URL pattern const vimeoPattern = /vimeo\.com\/(\d+)/; // Check for YouTube URL (full or shortened) let match = videoUrl.match(youtubePattern1) || videoUrl.match(youtubePattern2); if (match) { const videoId = match[1]; return `https://www.youtube.com/embed/${videoId}?autoplay=1&loop=1&playlist=${videoId}`; } // Check for Vimeo URL match = videoUrl.match(vimeoPattern); if (match) { const videoId = match[1]; return `https://player.vimeo.com/video/${videoId}`; } // Return the original URL if it's not a valid YouTube or Vimeo URL return videoUrl; } </script> <script type="text/javascript"> let offcanvasEl = document.getElementById('satt_dynamic_offcanvas'); let offcanvas = offcanvasEl && new bootstrap.Offcanvas(offcanvasEl); $(document).ready(function() { setTimeout(() => { loadPromotionData(); setTimeout(() => { initVideoObserver(); if (isMobile()) { $('#header-promotion-content, #footer-promotion-content').slick({ arrows: false, autoplay: true, //adaptiveHeight: true, }); } }, 500); // Remove promotion content when modal or offcanvas is closed $('.promotion-close-btn').on('click', function() { $('.promotion-body').html(''); }); $('#satt_dynamic_modal').on('hidden.bs.modal', function() { $('.promotion-body').html(''); }); $('#satt_dynamic_offcanvas').on('hidden.bs.offcanvas', function() { $('.promotion-body').html(''); }); }, 1000); }); // Insert inner promotion content divs let $contentListItems = $('.content-list-item'); let insertAfterEach = 3; if ($contentListItems.length >= insertAfterEach) { $contentListItems.each((index, el) => { // Insert a div after each 3 items if ((index + 1) % insertAfterEach === 0) { $(el).after('<div class="inner-promotion-content"></div>'); } }) } function isMobile() { return window.matchMedia("only screen and (max-width: 767px)").matches; } function loadPromotionData() { let route = "academy.subject.chapter"; //console.log(route); $.ajax({ type: "GET", url: "https://sattacademy.com/public/index.php/dynamic-promotion-content" + "?_token=" + $('meta[name="csrf-token"]').attr( 'content') + "&route=" + route + "&sidebar=" + $( '#sidebar-promotion-content').length + "&inner=" + $('.inner-promotion-content').length, dataType: 'json', success: function(data) { if (data) { const headerContents = data.headerContents; const footerContents = data.footerContents; const innerContents = data.innerContents; const sidebarContents = data.sidebarContents; const modalContents = data.modalContents; const offcanvasContents = data.offcanvasContents; let headerCards = ''; let footerCards = ''; let innerCards = ''; let sidebarCards = ''; let modalCards = ''; let offcanvasCards = ''; if (headerContents && headerContents.length > 0) { headerContents.forEach((content) => { headerCards += card(content); }); } if (footerContents && footerContents.length > 0) { footerContents.forEach((content) => { footerCards += card(content); }); } if (innerContents && innerContents.length > 0) { let $innerPromotionContentEls = $('.inner-promotion-content'); innerContents.forEach((content, index) => { // innerCards += card(content); $innerPromotionContentEls.eq(index).html(card(content)); }); } if (sidebarContents && sidebarContents.length > 0) { sidebarContents.forEach((content) => { sidebarCards += card(content); }); } if (modalContents && modalContents.length > 0) { modalContents.forEach((content) => { modalCards += card(content); }); $('#satt_dynamic_modal .dynamic-modal-body').html(modalCards); $('#satt_dynamic_modal').modal('show'); } if (offcanvasContents && offcanvasContents.length > 0) { let positions = ['left', 'right']; let offcanvasPosition = positions[Math.floor(Math.random() * positions.length)]; offcanvasContents.forEach((content) => { offcanvasCards += card(content); }); if (offcanvasPosition == 'left') { offcanvasEl?.classList.add('offcanvas-start'); } else if (offcanvasPosition == 'top') { offcanvasEl?.classList.add('offcanvas-top'); } else if (offcanvasPosition == 'bottom') { offcanvasEl?.classList.add('offcanvas-bottom'); } else { offcanvasEl?.classList.add('offcanvas-end'); } $('#satt_dynamic_offcanvas .offcanvas-body')?.html(offcanvasCards); offcanvas?.show(); } $('#header-promotion-content').html(headerCards); $('#footer-promotion-content').html(footerCards); $('#sidebar-promotion-content').html(sidebarCards); // $('#inner-promotion-content').html(innerCards); } } }); } function initVideoObserver() { const videos = document.querySelectorAll('video.promoted-video'); const observerOptions = { root: null, rootMargin: '0px', threshold: 0.5 }; const observerCallback = (entries, observer) => { entries.forEach(entry => { const video = entry.target; if (entry.isIntersecting) { video.play(); } else { video.pause(); } }); }; const observer = new IntersectionObserver(observerCallback, observerOptions); videos.forEach(video => { observer.observe(video); }); } </script> <!--end::Javascript--> <script src="https://sattacademy.com/public/js/sideLoginFormScript.js"></script> </body> <!--end::ddBody--> </html>