├── .gitignore ├── Company ├── round.gif ├── css │ └── company.css ├── js │ └── index.js └── company.html ├── Dashboard ├── avtar.png ├── cirtificate.png ├── css │ └── dashboard.css ├── js │ └── dashboard.js └── dashboard.html ├── Homepage ├── test-img.gif ├── css │ └── homepage.css └── JS │ └── homepage.js ├── .vscode └── settings.json ├── Questions ├── css │ └── questions.css ├── question.html └── js │ └── questions.js ├── LICENSE ├── Guidelines ├── js │ └── guidlines.js ├── css │ └── guidlines.css └── guidelines.html ├── index.html └── Common ├── js └── sweetalert.min.js └── css └── animate.min.css /.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Company/round.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haris-Mohanty/Education-App-Development/HEAD/Company/round.gif -------------------------------------------------------------------------------- /Dashboard/avtar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haris-Mohanty/Education-App-Development/HEAD/Dashboard/avtar.png -------------------------------------------------------------------------------- /Homepage/test-img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haris-Mohanty/Education-App-Development/HEAD/Homepage/test-img.gif -------------------------------------------------------------------------------- /Dashboard/cirtificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haris-Mohanty/Education-App-Development/HEAD/Dashboard/cirtificate.png -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501, 3 | "git.branchRandomName.enable": false, 4 | "git.autorefresh": true, 5 | "git.enabled": false, 6 | "editor.autoSurround": "languageDefined" 7 | } -------------------------------------------------------------------------------- /Questions/css/questions.css: -------------------------------------------------------------------------------- 1 | 2 | @import url('https://fonts.googleapis.com/css2?family=Moon+Dance&family=Roboto&family=Sofia+Sans:wght@100&display=swap'); 3 | *{ 4 | margin: 0; 5 | padding: 0; 6 | box-sizing: border-box; 7 | } 8 | body{ 9 | background-image: linear-gradient(to right, #5f2c82, #49a09d); 10 | display: flex; 11 | justify-content: center; 12 | align-items: center; 13 | min-height: 100vh; 14 | 15 | } 16 | .main{ 17 | background-color: rgb(249, 242, 247); 18 | padding: 22px; 19 | } 20 | .main h2{ 21 | font-weight: bold; 22 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 23 | } 24 | .main label{ 25 | font-size: 16px; 26 | font-weight: bold; 27 | font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; 28 | 29 | } 30 | .next-btn{ 31 | background-color: green; 32 | width: 35%; 33 | color: white; 34 | cursor: pointer; 35 | } 36 | input{ 37 | cursor: pointer; 38 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Haris-Mohanty 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Guidelines/js/guidlines.js: -------------------------------------------------------------------------------- 1 | let brandCode = sessionStorage.getItem("brandCode"); 2 | let enrollment = sessionStorage.getItem("enrollment"); 3 | let allSubject = []; 4 | let selectSubjectEl = document.querySelector("#select-subject"); 5 | //GET SUBJECT FROM LOCALSTORAGE CODE START 6 | if (localStorage.getItem(brandCode + "_allSubject") != null) { 7 | allSubject = JSON.parse(localStorage.getItem(brandCode + "_allSubject")); 8 | allSubject.forEach((subject, index) => { 9 | selectSubjectEl.innerHTML += ` 10 | 11 | `; 12 | }); 13 | } 14 | //GET SUBJECT FROM LOCALSTORAGE CODE END 15 | //GET COOKIE CODE START 16 | selectSubjectEl.addEventListener("change", ()=>{ 17 | let allCookie = []; 18 | let cookie = document.cookie.split(";"); 19 | cookie.forEach((data)=>{ 20 | allCookie.push(data.trim()); 21 | }); 22 | if(cookie.indexOf(brandCode+"_"+selectSubjectEl.value+"_"+enrollment+"=done") != -1){ 23 | swal("Already Attempted!", "Please Change another Subject !", "warning"); 24 | startExambtn.disabled = true; 25 | }else{ 26 | startExambtn.disabled = false; 27 | } 28 | }); 29 | 30 | //GET COOKIE CODE END 31 | 32 | //START EXAM BUTTON CODE START 33 | let startExambtn = document.querySelector(".start-exam-btn"); 34 | startExambtn.onclick = function () { 35 | if (selectSubjectEl.value != "Choose Subject") { 36 | let subject = selectSubjectEl.value; 37 | sessionStorage.setItem("subject", subject); 38 | window.location = "../Questions/question.html"; 39 | } else { 40 | swal("Select Subject!", "Please Select a Subject !", "warning"); 41 | } 42 | }; 43 | 44 | //START EXAM BUTTON CODE END 45 | -------------------------------------------------------------------------------- /Guidelines/css/guidlines.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin: 0; 4 | } 5 | body{ 6 | background-image: linear-gradient(to right, #E8CBC0 ,#636FA4); 7 | } 8 | h1{ 9 | color: blueviolet; 10 | margin-top: 2%; 11 | text-align: center; 12 | font-weight: bold; 13 | font-family: Georgia, 'Times New Roman', Times, serif; 14 | font-size: 43px; 15 | letter-spacing: 1.5px; 16 | } 17 | .container{ 18 | margin-top: 3%; 19 | padding: 55px 0px 22px 0px; 20 | background-image: linear-gradient(to right, #E8CBC0 ,#636FA4); 21 | box-shadow: rgba(0, 0, 0, 0.56) 0px 22px 50px 4px; 22 | } 23 | .container h3{ 24 | color: rgb(15, 117, 185); 25 | font-weight: bold; 26 | font-family: Verdana, Geneva, Tahoma, sans-serif; 27 | letter-spacing: 0.4px; 28 | margin-bottom: 35px; 29 | font-size: 29px; 30 | } 31 | .container ul{ 32 | color: forestgreen; 33 | font-family: cursive; 34 | font-weight: bold; 35 | font-size: 16px; 36 | } 37 | .container ul li{ 38 | margin: 9px; 39 | } 40 | .container .form-select{ 41 | font-size: 21px; 42 | font-family: 'Times New Roman', Times, serif; 43 | font-weight: 400; 44 | color: rgb(68, 5, 123); 45 | cursor: pointer; 46 | } 47 | button{ 48 | width: 70%; 49 | color: black; 50 | background-image: linear-gradient(to right, rgb(62, 218, 238) , rgb(192, 244, 249)); 51 | letter-spacing: 1.4px; 52 | font-size: 25px; 53 | font-weight: bold; 54 | border: none; 55 | font-family: 'Moon Dance', cursive; 56 | transition: all 0.7s ease-in-out; 57 | border-radius: 10px; 58 | margin-left: 84px; 59 | } 60 | button:hover{ 61 | width: 73%; 62 | color: aliceblue; 63 | letter-spacing: 1.6px; 64 | background-color: green; 65 | background-image: linear-gradient(to right, rgb(11, 200, 81), rgb(15, 98, 15)); 66 | font-family: 'Moon Dance', cursive; 67 | transform: translateY(-5px); 68 | } -------------------------------------------------------------------------------- /Homepage/css/homepage.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin: 0; 4 | } 5 | body{ 6 | background-color: rgb(8, 239, 204); 7 | font-family: sans-serif; 8 | } 9 | .container{ 10 | /* color: aqua; */ 11 | } 12 | .container h1{ 13 | color: rgb(246, 241, 247); 14 | font-weight: bolder; 15 | /* font-family: 'font-effect-fire-animation'; */ 16 | font-family: 'Moon Dance', cursive; 17 | letter-spacing: 1.2px; 18 | } 19 | .container h2{ 20 | color: rgb(13, 8, 10); 21 | text-align: center; 22 | margin-top: 23px; 23 | font-family: 'Times New Roman', Times, serif; 24 | font-weight: 600; 25 | font-size: 1.875rem; 26 | letter-spacing: 0.8px; 27 | } 28 | .input-group-text{ 29 | background-color: rgb(15, 230, 158); 30 | font-family: Arial, Helvetica, sans-serif; 31 | font-family: cursive; 32 | font-weight: bold; 33 | color: white; 34 | font-size: 18px; 35 | } 36 | .form-control{ 37 | cursor: pointer; 38 | font-family: 'Times New Roman', Times, serif; 39 | font-size: 22px; 40 | font-weight: bold; 41 | box-shadow: none !important; 42 | } 43 | .form-select{ 44 | box-shadow: none !important; 45 | font-weight: bold; 46 | } 47 | button{ 48 | width: 100%; 49 | color: black; 50 | background-color: rgb(23, 240, 244); 51 | letter-spacing: 1.4px; 52 | font-size: 25px; 53 | font-weight: bold; 54 | border: none; 55 | font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif; 56 | transition: all 0.5s; 57 | } 58 | button:hover{ 59 | color: aliceblue; 60 | background-color: green; 61 | font-family: 'Moon Dance', cursive; 62 | transition: 0.7s ease-in-out; 63 | transform: translateY(-3px); 64 | } 65 | button::after{ 66 | content: '\00bb'; 67 | right: -20px; 68 | opacity: 0; 69 | padding: 5px; 70 | transition: 0.5s ease-in-out; 71 | } 72 | button:hover::after { 73 | opacity: 1; 74 | right: 0; 75 | } -------------------------------------------------------------------------------- /Questions/question.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Question Set 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 36 | 37 | 38 | 39 |
40 |

Q.1 : Whats the nbs dj?

41 |
42 | 43 |

44 | 45 |

46 | 47 |

48 | 49 |

50 |
51 | 52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Homepage 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 36 | 37 | 38 | 39 |
40 |

41 | Wel-Come to Online Examination Centre 42 |

43 |
44 |
45 | 46 |
47 |
48 |

Student & Teacher Login Form

49 |
50 | Choose Brand Code 51 | 54 |
55 |
56 | Enrollment 57 | 58 |
59 |
60 | Passsword 61 | 62 |
63 | 64 | 65 | Create Your Space 66 | 67 |
68 |
69 |
70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Homepage/JS/homepage.js: -------------------------------------------------------------------------------- 1 | //GET BRANDCODE FROM LOCALSTORAGE CODE START 2 | let i; 3 | let allBrandKey = []; 4 | for (i = 0; i < localStorage.length; i++) { 5 | let allKeys = localStorage.key(i); 6 | if (allKeys.match("_brand")) { 7 | allBrandKey.push(allKeys.replace("_brand", "")); 8 | } 9 | } 10 | // //GET BRANDCODE FROM LOCALSTORAGE CODE END 11 | 12 | // //SHOW BRANDCODE IN "CHOOSE BRAND CODE" OPTION CODE START 13 | let brandCode_El = document.querySelector("#brand-code-el"); 14 | allBrandKey.forEach((bcode, index) => { 15 | brandCode_El.innerHTML += ` 16 | 17 | `; 18 | }); 19 | // //SHOW BRANDCODE IN "CHOOSE BRAND CODE" OPTION CODE END 20 | 21 | //LOGIN CODE START 22 | // let loginForm = document.querySelector(".login-form"); 23 | let allLoginInput = document.querySelectorAll("INPUT"); 24 | let loginBtn = document.querySelector(".login-btn"); 25 | let brandCode; 26 | let allUserData = []; 27 | brandCode_El.addEventListener("change", () => { 28 | if (brandCode_El.value != "Choose Brand Code") { 29 | sessionStorage.setItem("brandcode", brandCode_El.value); 30 | allLoginInput[0].disabled = false; 31 | allLoginInput[1].disabled = false; 32 | loginBtn.disabled = false; 33 | brandCode = sessionStorage.getItem("brandcode"); 34 | loginUserFun(); 35 | } else { 36 | allLoginInput[0].disabled = true; 37 | allLoginInput[1].disabled = true; 38 | loginBtn.disabled = true; 39 | swal("Unselected Brandcode!", "Please Select a Brandcode !", "warning"); 40 | } 41 | }); 42 | 43 | const loginUserFun = () => { 44 | if (localStorage.getItem(brandCode + "_registrationData") != null) { 45 | allUserData = JSON.parse( 46 | localStorage.getItem(brandCode + "_registrationData") 47 | ); 48 | } 49 | loginBtn.onclick = function () { 50 | for (i = 0; i < allUserData.length; i++) { 51 | if (allUserData[i].enrollment == allLoginInput[0].value) { 52 | if(allUserData[i].password == allLoginInput[1].value){ 53 | if(allUserData[i].userType == "Teacher"){ 54 | sessionStorage.setItem("brandCode", brandCode); 55 | window.location = "../Dashboard/dashboard.html" 56 | }else{ 57 | sessionStorage.setItem("enrollment", allUserData[i].enrollment); 58 | sessionStorage.setItem("name", allUserData[i].name); 59 | sessionStorage.setItem("address", allUserData[i].address); 60 | sessionStorage.setItem("fatherName", allUserData[i].fatherName); 61 | sessionStorage.setItem("brandCode", brandCode); 62 | sessionStorage.setItem("imgUrl", allUserData[i].profilePic) 63 | window.location = "../Guidelines/guidelines.html" 64 | } 65 | }else{ 66 | swal("Incorrect Password!", "Please Contact your Brand Admin !", "error"); 67 | return; 68 | } 69 | return; 70 | } else { 71 | swal("Incorrect Enrollment!", "Please Contact your Brand Admin !", "warning"); 72 | } 73 | } 74 | }; 75 | console.log(allUserData) 76 | }; 77 | // // //LOGIN CODE END 78 | -------------------------------------------------------------------------------- /Guidelines/guidelines.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Exam Guidlines 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 36 | 37 | 38 | 39 |

Read The Guidlines and Select the Subject to Give Exam.

40 |
41 |
42 |
43 |
44 |

Read all the Guidlines Carefully

45 |
    46 |
  • Please Select / Choose the Subject First.
  • 47 |
  • After Select the Subject Click "Start Exam" Button.
  • 48 |
  • Each Question has Four Options and you have to Select one options For one questions.
  • 49 |
  • Be careful that you mark multiple choice answers properly. Incorrect entries may lose you Marks.
  • 50 |
  • Keep silent during Exams.
  • 51 |
  • You will not be allowed to leave the Exam room during the Exam.
  • 52 |
  • If you have time when you finish the Exam, check your answers.
  • 53 |
  • When you finished Exam Click the "Submit" button to Finish the Exam.
  • 54 |
  • Thank You.
  • 55 |
56 |
57 |
58 |
59 | 62 | 65 |
66 |
67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Company/css/company.css: -------------------------------------------------------------------------------- 1 | * { 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | } 6 | body { 7 | width: 100%; 8 | height: 100vh; 9 | background-color: #8ca2f8 !important; 10 | background-image: linear-gradient(to right , rgb(15, 42, 68) , rgb(17, 26, 73)); 11 | } 12 | .main-box { 13 | width: 80%; 14 | height: auto; 15 | border-radius: 10px; 16 | padding: 20px 30px 0 ; 17 | background-color: black !important; 18 | box-shadow: 8px 8px 17px 17px rgb(53, 241, 201); 19 | } 20 | /* WHOLE NAVBAR */ 21 | .main-box .navbar { 22 | border-radius: 10px; 23 | } 24 | /* NAVBAR TOGGLER COLOR CHANGE */ 25 | .main-box .navbar .navbar-toggler{ 26 | background-color: rgb(18, 236, 233); 27 | } 28 | /* BRAND CODE */ 29 | .main-box .navbar .navbar-brand { 30 | font-size: 25px; 31 | font-weight: bold; 32 | color: #24cdf3; 33 | } 34 | /* NAVBAR ALL CONTENT */ 35 | .main-box .navbar .nav-link { 36 | color: #fc91bc; 37 | font-family: sans-serif; 38 | } 39 | /* NAVBAR BUTTON */ 40 | .main-box .navbar .btn { 41 | background-color: #fc91bc; 42 | color: aliceblue; 43 | } 44 | 45 | /* START LOGIN AND SIGN UP CODING */ 46 | .main-box .login-box , .main-box .signup-box{ 47 | width: 100%; 48 | padding-left: 18px; 49 | } 50 | .main-box .login-box h2{ 51 | color: #617eff; 52 | font-family: sans-serif; 53 | font-size: 35px; 54 | font-weight: bold; 55 | } 56 | .main-box .login-box label , .main-box .signup-box label{ 57 | color: #fc91bc; 58 | font-family: sans-serif; 59 | width: 75%; 60 | letter-spacing: 2px; 61 | font-size: 18px; 62 | } 63 | .main-box .login-box input , .main-box .signup-box input , .main-box .signup-box textarea{ 64 | border: none; 65 | border-radius: 0; 66 | border-bottom: 3px solid #1095f4; 67 | box-shadow: none; 68 | cursor: pointer; 69 | width: 85%; 70 | background-color: black !important; 71 | color: #24cdf3; 72 | font-weight: bold; 73 | padding-left: 0; 74 | } 75 | .main-box .login-box button , .main-box .signup-box button{ 76 | background-color: #fc91bc; 77 | border-radius: 0; 78 | color: aliceblue; 79 | font-family: Verdana, Geneva, Tahoma, sans-serif; 80 | width: 85%; 81 | } 82 | .main-box .login-box{ 83 | height: 0; 84 | opacity: 0; 85 | transition: 1s ease-in-out; 86 | overflow: hidden; 87 | } 88 | .main-box .signup-box{ 89 | height: 0; 90 | opacity: 0; 91 | transition: 1s ease-in-out; 92 | overflow: hidden; 93 | } 94 | /* ADD ACTIVE CLASS BY JAVASCRIPT */ 95 | .main-box .login-box.active{ 96 | height: auto; 97 | opacity: 1; 98 | } 99 | .main-box .signup-box.active{ 100 | height: auto; 101 | opacity: 1; 102 | } 103 | /* BUTTON */ 104 | #form-login-btn , #form-signup-btn{ 105 | width: 85%; 106 | color: rgb(226, 46, 214); 107 | font-family: 'Nunito', sans-serif; 108 | font-size: 22px; 109 | text-transform: uppercase; 110 | letter-spacing: 1.4px; 111 | font-weight: bolder; 112 | background: linear-gradient( rgb(73, 212, 246) 0%, rgb(200, 228, 237) 100%); 113 | border: none; 114 | border-radius: 10px; 115 | box-shadow: 12px 12px 24px rgba(77, 167, 235, 0.64); 116 | cursor: pointer; 117 | outline: none; 118 | position: relative; 119 | margin-bottom: 12px; 120 | } 121 | #form-login-btn:hover , #form-signup-btn:hover{ 122 | color: #01070b; 123 | transform: translateY(-3px); 124 | box-shadow: 12px 6px 6px #fbb4f8; 125 | background: linear-gradient( #ea3bf3, #f6a7ef, #e6e8e3); 126 | font-size: 25px; 127 | letter-spacing: 1.5px; 128 | } -------------------------------------------------------------------------------- /Company/js/index.js: -------------------------------------------------------------------------------- 1 | //NAVBAR SIGNIN AND SIGNUP BUTTON CODING START 2 | let signupBtn = document.querySelector(".signup-btn"); 3 | let loginBtn = document.querySelector(".login-btn"); 4 | let loginBox = document.querySelector(".login-box"); 5 | let signupBox = document.querySelector(".signup-box"); 6 | 7 | signupBtn.addEventListener("click", () => { 8 | signupBox.classList.add("active"); 9 | loginBox.classList.remove("active"); 10 | loginBtn.classList.remove("d-none"); 11 | signupBtn.classList.add("d-none"); 12 | }); 13 | 14 | loginBtn.addEventListener("click", () => { 15 | signupBox.classList.remove("active"); 16 | loginBox.classList.add("active"); 17 | loginBtn.classList.add("d-none"); 18 | signupBtn.classList.remove("d-none"); 19 | }); 20 | //NAVBAR SIGNIN AND SIGNUP BUTTON CODING END 21 | 22 | //SIGN UP CODING START 23 | let signupForm = document.querySelector(".signup-form"); 24 | let signupAllinput = signupForm.querySelectorAll("INPUT"); 25 | let signupTextarea = signupForm.querySelector("TEXTAREA"); 26 | let formSignupbtn = document.getElementById("form-signup-btn"); 27 | 28 | signupForm.addEventListener("submit", (e) => { 29 | e.preventDefault(); 30 | signupData(); 31 | }); 32 | 33 | const signupData = () => { 34 | formSignupbtn.innerHTML = "Registration Processing..." 35 | formSignupbtn.style.fontSize = "18px"; 36 | formSignupbtn.style.textTransform = "capitalize" 37 | formSignupbtn.disabled = true; 38 | //USING SET TIMEOUT TO DISPLAY REGISTRATION PROCESSING... 39 | setTimeout(function(){ 40 | //CREATE A KEY TO SET IN LOCALSTORAGE 41 | if (localStorage.getItem(signupAllinput[0].value + "_brand") == null) { 42 | const userData = { 43 | brandCode: signupAllinput[0].value, 44 | brandName: signupAllinput[1].value, 45 | website: signupAllinput[2].value, 46 | contact: signupAllinput[3].value, 47 | address: signupTextarea.value, 48 | userName: signupAllinput[4].value, 49 | password: signupAllinput[5].value, 50 | }; 51 | //SET DATA TO LOCAL STORAGE CODE START 52 | const userString = JSON.stringify(userData); 53 | localStorage.setItem(signupAllinput[0].value + "_brand", userString); 54 | //SET DATA TO LOCAL STORAGE CODE END 55 | signupForm.reset(""); 56 | swal("Congrats !", "Your Registration has been Successfully Completed !", "success"); 57 | } else { 58 | swal("Please Change Brand Code !", "This brand code is already exits !", "warning"); 59 | } 60 | //CHANGE BUTTON STYLE TO DEFALUT 61 | formSignupbtn.innerHTML = "Sign Up" 62 | formSignupbtn.style.fontSize = "22px"; 63 | formSignupbtn.style.textTransform = "uppercase" 64 | formSignupbtn.disabled = false; 65 | },2000); 66 | }; 67 | //SIGN UP CODING END 68 | 69 | //LOGIN CODEING START 70 | let loginForm = document.querySelector(".login-form"); 71 | let loginAllinput = loginForm.querySelectorAll("INPUT"); 72 | let formLoginbtn = document.getElementById("form-login-btn"); 73 | 74 | loginForm.addEventListener("submit", (e) => { 75 | e.preventDefault(); 76 | loginData(); 77 | }); 78 | 79 | const loginData = () => { 80 | if (localStorage.getItem(loginAllinput[0].value + "_brand") != null) { 81 | //GET DATA FROM LOCAL STORAGE 82 | let allData = JSON.parse(localStorage.getItem(loginAllinput[0].value + "_brand")); 83 | if (allData.userName == loginAllinput[1].value) { 84 | if(allData.password == loginAllinput[2].value){ 85 | formLoginbtn.innerHTML = "Please wait..." 86 | formLoginbtn.disabled = true; 87 | setTimeout(function(){ 88 | window.location = "../dashboard/dashboard.html"; 89 | sessionStorage.setItem("brandCode" , loginAllinput[0].value); 90 | },3000); 91 | }else{ 92 | swal("Incorrect Password !", "Please Enter a Valid Password!", "error"); 93 | } 94 | } else { 95 | swal("Incorrect User Name !", "Please Check Username!", "error"); 96 | } 97 | } else { 98 | swal("Incorrect Brand Code !", "Brand Code is not registered in our Database!", "error"); 99 | } 100 | }; 101 | //LOGIN CODEING END -------------------------------------------------------------------------------- /Company/company.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Company 28 | 29 | 30 |
31 |
32 | 33 | 51 | 52 |
53 |
54 | 55 | 70 | 71 | 72 | 91 | 92 |
93 |
94 | 95 |
96 |
97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Questions/js/questions.js: -------------------------------------------------------------------------------- 1 | //RECEIVE SESSIONSTORAGE DATA CODE START 2 | let nameEl = sessionStorage.getItem("name"); 3 | let address = sessionStorage.getItem("address"); 4 | let fatherName = sessionStorage.getItem("fatherName"); 5 | let enrollment = sessionStorage.getItem("enrollment"); 6 | let subject = sessionStorage.getItem("subject"); 7 | let brandCode = sessionStorage.getItem("brandCode"); 8 | let imgUrl = sessionStorage.getItem("imgUrl"); 9 | //RECEIVE SESSIONSTORAGE DATA CODE END 10 | let allQuestion = []; 11 | //GET QUESTION FROM LOCALSTORAGE CODE START 12 | if (localStorage.getItem(brandCode + "_" + subject + "_question") != null) { 13 | allQuestion = JSON.parse( 14 | localStorage.getItem(brandCode + "_" + subject + "_question") 15 | ); 16 | } 17 | //GET QUESTION FROM LOCALSTORAGE CODE END 18 | 19 | //SHOWING QUESTION IN PAGE CODE START 20 | let index = 0; 21 | let rightAns = 0; 22 | let wrongAns = 0; 23 | let totalQues = allQuestion.length; 24 | let questionEl = document.querySelector(".question-el"); 25 | let allOptions = document.querySelectorAll(".option"); 26 | const getQuestionFun = () => { 27 | if (index == totalQues) { 28 | return endExam(); 29 | } 30 | resetFunc(); //RESET function call 31 | let data = allQuestion[index]; 32 | questionEl.innerHTML = `Q.${index + 1}: ${data.question}`; 33 | allOptions[0].nextElementSibling.innerHTML = data.optionOne; 34 | allOptions[1].nextElementSibling.innerHTML = data.optionTwo; 35 | allOptions[2].nextElementSibling.innerHTML = data.optionThree; 36 | allOptions[3].nextElementSibling.innerHTML = data.optionFour; 37 | }; 38 | getQuestionFun(); 39 | //SHOWING QUESTION IN PAGE CODE END 40 | 41 | //NEXT BUTTON CODE START 42 | let nextBtn = document.querySelector(".next-btn"); 43 | nextBtn.addEventListener("click", () => { 44 | let data = allQuestion[index]; 45 | let ans = getAnswer(); 46 | if (ans == data.optionAns) { 47 | rightAns++; 48 | } else { 49 | wrongAns++; 50 | } 51 | index++; 52 | getQuestionFun(); //NEXT page question showing. 53 | return; 54 | }); 55 | const getAnswer = () => { 56 | let answer; 57 | allOptions.forEach((input) => { 58 | if (input.checked) { 59 | answer = input.value; //Get options value to Match. 60 | } 61 | }); 62 | return answer; 63 | }; 64 | //NEXT BUTTON CODE END 65 | 66 | //WHEN CLICK ON NEXT BUTTON :- AUTO SELECT OFF. 67 | function resetFunc() { 68 | allOptions.forEach((input) => { 69 | input.checked = false; 70 | }); 71 | } 72 | 73 | //AFTER QUESTION FINISH :- (FINISH MESSAGE SHOWING IN MAIN DIV). 74 | let mainBox = document.querySelector(".main"); 75 | const endExam = () => { 76 | mainBox.innerHTML = ` 77 |

Click On Submit to Complete The Examination.

78 |
79 | 80 |
81 | `; 82 | //SUBMIT BUTTON CODE 83 | let submitBtn = document.querySelector(".submit-btn"); 84 | //Fix replace code Start 85 | if (localStorage.getItem(brandCode+"_"+subject+"_result") != null) { 86 | allUserResult = JSON.parse(localStorage.getItem(brandCode+"_"+subject+"_result")); 87 | } 88 | if (localStorage.getItem(brandCode+"_"+enrollment+"_result") != null) { 89 | particularUserResult = JSON.parse(localStorage.getItem(brandCode+"_"+enrollment+"_result")); 90 | } 91 | //end replace 92 | submitBtn.onclick = function () { 93 | //set cookie 94 | document.cookie = brandCode+"_"+subject+"_"+enrollment+"=done;max-age = 86400;path=/"; //86400s means 1day 95 | allUserResultfunc(); 96 | particularUserResultFunc(); 97 | this.innerHTML = "Redirecting to Homepage..."; 98 | this.disabled = true; 99 | }; 100 | }; 101 | //Updating in LocalStorage 102 | let allUserResult = []; 103 | const allUserResultfunc = () => { 104 | allUserResult.push({ 105 | name: nameEl, 106 | enrollment: enrollment, 107 | rightAns: rightAns, 108 | wrongAns: wrongAns, 109 | subject: subject, 110 | maxMark: totalQues, 111 | }); 112 | localStorage.setItem(brandCode + "_" + subject + "_result", JSON.stringify(allUserResult)); 113 | //After Submit button click Redirecting to Homepage. 114 | setTimeout(function () { 115 | sessionStorage.removeItem("name"); 116 | sessionStorage.removeItem("address"); 117 | sessionStorage.removeItem("enrollment"); 118 | sessionStorage.removeItem("fatherName"); 119 | sessionStorage.removeItem("brandCode"); 120 | sessionStorage.removeItem("subject"); 121 | window.location = "../../index.html"; 122 | }, 2000); 123 | }; 124 | 125 | //Result Store in LocalStorage by (Enrollment). 126 | particularUserResult = []; 127 | const particularUserResultFunc = () =>{ 128 | particularUserResult.push({ 129 | name : nameEl, 130 | fatherName : fatherName, 131 | enrollment : enrollment, 132 | subject : subject, 133 | rightAns : rightAns, 134 | wrongAns : wrongAns, 135 | maxMark : totalQues, 136 | profilePic : imgUrl 137 | }); 138 | localStorage.setItem(brandCode+"_"+enrollment+"_result", JSON.stringify(particularUserResult)); 139 | setTimeout(function () { 140 | sessionStorage.removeItem("name"); 141 | sessionStorage.removeItem("address"); 142 | sessionStorage.removeItem("enrollment"); 143 | sessionStorage.removeItem("fatherName"); 144 | sessionStorage.removeItem("brandCode"); 145 | sessionStorage.removeItem("subject"); 146 | window.location = "../../index.html"; 147 | }, 2000); 148 | }; -------------------------------------------------------------------------------- /Dashboard/css/dashboard.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding: 0; 3 | margin: 0; 4 | box-sizing: border-box; 5 | font-family: Verdana, Geneva, Tahoma, sans-serif; 6 | /* overflow: hidden; */ 7 | /* padding: 3px; */ 8 | } 9 | .side-nav{ 10 | position: fixed; 11 | top: 0; 12 | left: 0; 13 | width: 250px; 14 | height: 100vh; 15 | background-color: rgb(43, 112, 106); 16 | display: flex; 17 | justify-content: start; 18 | align-items: center; 19 | padding: 20px 0px; 20 | flex-direction: column; 21 | transition: 0.5s ease-in-out; 22 | z-index: 1000; 23 | } 24 | .side-nav .profile-pic{ 25 | width: 150px; 26 | height: 150px; 27 | background-image: url(../avtar.png); 28 | background-repeat: no-repeat; 29 | background-size: cover; 30 | border-radius: 50%; 31 | } 32 | .side-nav ul{ 33 | width: 100%; 34 | margin: 20px 0px 0px; 35 | padding: 4px; 36 | } 37 | .side-nav ul li{ 38 | border-radius: 0; 39 | margin: 10px 0px 0px; 40 | background-color: transparent; 41 | font-size: 18px; 42 | color: aliceblue; 43 | transition: 1s ease-in-out; 44 | font-family: "Sofia", sans-serif; 45 | } 46 | .side-nav ul li i{ 47 | margin: 8px; 48 | } 49 | .side-nav ul li:hover{ 50 | background-color: rgb(52, 181, 250); 51 | color: rgb(42, 38, 244); 52 | cursor: pointer; 53 | font-weight: bold; 54 | } 55 | .side-nav button{ 56 | position: absolute; 57 | bottom: 0; 58 | width: 100%; 59 | padding: 11px; 60 | background-color: aqua; 61 | color: darkblue; 62 | font-size: 20px; 63 | font-weight: bold; 64 | border: 2px solid black; 65 | font-family: "Audiowide", sans-serif; 66 | } 67 | 68 | /* START MAIN BOX CODING */ 69 | .main-box{ 70 | background-color: #fff; 71 | } 72 | .brand-box li{ 73 | border-radius: 0; 74 | background-color: rgb(120, 8, 164); 75 | color: #f4eaea; 76 | font-family: "Sofia", sans-serif; 77 | } 78 | .main-box .teacher-box li{ 79 | font-family: "Audiowide", sans-serif; 80 | border-radius: 0; 81 | background-color: aqua; 82 | text-align: center; 83 | font-weight: bold; 84 | font-size: 21px; 85 | color: rgb(145, 10, 236); 86 | } 87 | .main-box .teacher-box .content-box{ 88 | width: 100%; 89 | height: 150px; 90 | display: flex; 91 | justify-content: center; 92 | align-items: center; 93 | } 94 | .main-box .teacher-box .content-box .number-box{ 95 | width: 120px; 96 | font-family: "Audiowide", sans-serif; 97 | height: 120px; 98 | border: 5px solid rgb(69, 189, 254); 99 | border-radius: 50%; 100 | display: flex; 101 | justify-content: center; 102 | align-items: center; 103 | font-weight: bold; 104 | font-size: 20px; 105 | } 106 | .accordion-body .btn{ 107 | font-family: "Audiowide", sans-serif; 108 | background-color: rgb(31, 196, 238); 109 | } 110 | /* Show Subject Related Questions */ 111 | .visible-question i{ 112 | font-size: 23px; 113 | } 114 | .visible-question span{ 115 | font-size: 20px; 116 | } 117 | .visible-question .bg-info{ 118 | color: aliceblue; 119 | } 120 | /* Modal Coding */ 121 | .user-profile-box .modal-header{ 122 | background-color: aquamarine; 123 | } 124 | .user-profile-box .profile-box{ 125 | width: 100%; 126 | height: auto; 127 | background-color: aliceblue; 128 | display: flex; 129 | justify-content: center; 130 | align-items: center; 131 | text-align: center; 132 | flex-direction: column; 133 | position: relative; 134 | } 135 | .user-profile-box .profile-box .img-box{ 136 | width: 150px; 137 | height: 150px; 138 | background-image: url(../avtar.png); 139 | background-size: cover; 140 | background-repeat: no-repeat; 141 | background-position: center; 142 | border-radius: 50%; 143 | } 144 | .user-profile-box .profile-box .btn{ 145 | position: absolute; 146 | right: 0; 147 | top: 0; 148 | font-size: 34px; 149 | } 150 | .user-profile-box .profile-box input{ 151 | position: absolute; 152 | right: 0; 153 | top: 18px; 154 | width: 50px; 155 | opacity: 0; 156 | } 157 | .user-profile-box .date-box{ 158 | width: 100%; 159 | height: 150px; 160 | background-color: aliceblue; 161 | display: flex; 162 | justify-content: space-between; 163 | align-items: center; 164 | flex-direction: column; 165 | font-weight: bold; 166 | } 167 | .user-profile-box .date-box .icon-box{ 168 | width: 100%; 169 | height: 40px; 170 | background-color: aquamarine; 171 | display: flex; 172 | justify-content: space-between; 173 | align-items: center; 174 | } 175 | .user-profile-box .date-box .icon-box i{ 176 | font-size: 35px; 177 | }.user-profile-box .date-box h1{ 178 | font-weight: bold; 179 | } 180 | .user-profile-box .modal-footer .modal-edit{ 181 | width: 100px; 182 | background-color: aquamarine; 183 | font-size: 20px; 184 | font-weight: bold; 185 | } 186 | i{ 187 | cursor: pointer; 188 | } 189 | /* Start Certificate Coding */ 190 | .certificate-main{ 191 | width: 860px; 192 | height: 1000px; 193 | position: absolute; 194 | top: 40%; 195 | left: 25%; 196 | transform: translate(-0%, -0%); 197 | border: 7px groove slateblue; 198 | opacity: 0; 199 | z-index: -100; 200 | } 201 | .certificate-main.active{ 202 | opacity: 1; 203 | z-index: 100; 204 | animation-name: slideInDown; 205 | animation-duration: 1s; 206 | } 207 | .certificate-main .main-box{ 208 | width: 100%; 209 | height: 100%; 210 | /* background-image: linear-gradient(to right, rgb(192, 192, 252) , rgb(249, 252, 252)); */ 211 | position: absolute; 212 | top: 55px; 213 | left: 0; 214 | padding: 0px 50px; 215 | } 216 | .certificate-main .main-box .name-box{ 217 | width: 95%; 218 | height: 200px; 219 | border: 1px solid #ccc; 220 | display: flex; 221 | justify-content: center; 222 | align-items: center; 223 | } 224 | .certificate-main .main-box .name-box .img-box{ 225 | width: 30%; 226 | height: 90%; 227 | margin: 0px auto; 228 | display: flex; 229 | flex-direction: column; 230 | justify-content: space-between; 231 | } 232 | .certificate-main .main-box .name-box .img-box p{ 233 | font-weight: bold; 234 | font-size: 20px; 235 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 236 | } 237 | .certificate-main .main-box .signature-box{ 238 | width: 95%; 239 | height: 170px; 240 | border: 2px solid black; 241 | display: flex; 242 | align-items: center; 243 | } 244 | .certificate-main .main-box .signature-box .sign-box{ 245 | width: 30%; 246 | height: 100%; 247 | margin: 0px auto; 248 | display: flex; 249 | flex-direction: column; 250 | justify-content: space-between; 251 | align-items: center; 252 | justify-content: center; 253 | font-weight: bolder; 254 | font-family: Verdana, Geneva, Tahoma, sans-serif; 255 | font-size: 31px; 256 | } 257 | .certificate-main .certificate-close-btn{ 258 | position: absolute; 259 | right: -5px; 260 | top: -7px; 261 | font-size: 31px; 262 | color: aliceblue; 263 | transition: 1s ease; 264 | } 265 | .certificate-main .certificate-close-btn:hover{ 266 | color: rgb(231, 37, 44); 267 | font-size: 35px; 268 | transform: translateY(-4px); 269 | } 270 | .certificate-main .main-box .table .cir-data{ 271 | border-bottom: 3px solid black; 272 | } 273 | .certificate-main .main-box .table .cir-head{ 274 | border-bottom: 3px solid black; 275 | } 276 | 277 | /* Toggler coding */ 278 | .toggler-box{ 279 | opacity: 0; 280 | } 281 | .toggler-box .toggler-icon{ 282 | position: fixed; 283 | padding: 15px; 284 | right: 0; 285 | top: 0; 286 | z-index: 100; 287 | background-color: blueviolet; 288 | color: aliceblue; 289 | border-radius: 10px; 290 | } 291 | @media(max-width : 991px){ 292 | .side-nav{ 293 | transform: translateX(-255px) 294 | } 295 | .side-nav.active{ 296 | transform: translateX(0px) 297 | } 298 | .toggler-box{ 299 | opacity: 1; 300 | } 301 | } -------------------------------------------------------------------------------- /Dashboard/js/dashboard.js: -------------------------------------------------------------------------------- 1 | // GET DATA FROM SESSION STORAGE AND SHOW LOGIN USER START 2 | let brandcode; 3 | brandcode = sessionStorage.getItem("brandCode"); 4 | if (brandcode == null) { 5 | document.body.innerHTML = ""; 6 | document.body.style.background = "black"; 7 | swal("Unauthorised User!", "Please Login Again to Enter!", "warning"); 8 | //Redirecting to Login page 9 | setTimeout(function () { 10 | window.location = "../company/company.html"; 11 | }, 2000); 12 | } 13 | let allUserData = JSON.parse(localStorage.getItem(brandcode + "_brand")); 14 | let brand_name = document.getElementById("brand-name"); 15 | brand_name.innerHTML = "Wel Come : " + allUserData.brandName; 16 | 17 | // GET DATA FROM SESSION STORAGE AND SHOW LOGIN USER END 18 | 19 | //LOGOUT CODE START 20 | let log_out_btn = document.getElementById("log-out-btn"); 21 | log_out_btn.addEventListener("click", (e) => { 22 | e.target.innerHTML = "Please wait..."; 23 | e.target.style.background = "#253c42"; 24 | setTimeout(function () { 25 | window.location = "../company/company.html"; 26 | sessionStorage.removeItem("brandCode"); 27 | }, 3000); 28 | }); 29 | //LOGOUT CODE END 30 | 31 | //SUBJECT CODING START 32 | let visibleSubject = document.querySelector(".visible-subject"); 33 | let inputSubjectValue = document.querySelector(".subject"); 34 | let subjectBtn = document.querySelector(".subject-btn"); 35 | //Create a empty array to push objects 36 | let allSubject = []; 37 | //STORE BTN BUTTON 38 | subjectBtn.addEventListener("click", (e) => { 39 | e.preventDefault(); 40 | StoreSubjectBtn(); 41 | }); 42 | const StoreSubjectBtn = () => { 43 | if (inputSubjectValue.value != "") { 44 | newSubject(); //Create a function 45 | swal("Congrats!", "Your Subject has been stored successful !", "success"); 46 | inputSubjectValue.value = ""; 47 | } else { 48 | swal("Subject Name is empty!", "Please Enter a Subject Name !", "warning"); 49 | } 50 | updateSubject(); 51 | }; 52 | 53 | const newSubject = (subject, index) => { 54 | //Call the above function newSubject() 55 | let subject_name = inputSubjectValue.value; 56 | if (subject) { 57 | subject_name = subject.subjectName; 58 | } 59 | visibleSubject.innerHTML += ` 60 |
61 |

${subject_name}

62 |
63 | 64 | 65 | 66 |
67 |
68 | `; 69 | //SUBJECT "DELETE" CODE START 70 | let delAllBtn = visibleSubject.querySelectorAll(".del-btn"); 71 | let i; 72 | for (i = 0; i < delAllBtn.length; i++) { 73 | delAllBtn[i].onclick = function () { 74 | let parent = this.parentElement.parentElement; 75 | //sweet alert code start 76 | swal({ 77 | title: "Are you sure?", 78 | text: "Once deleted, you will not be able to recover this imaginary file!", 79 | icon: "warning", 80 | buttons: true, 81 | dangerMode: true, 82 | }).then((willDelete) => { 83 | if (willDelete) { 84 | parent.remove(); //Remove data from page but not local storage 85 | updateSubject(); //Update local storage data 86 | swal("Poof! Your imaginary file has been deleted!", { 87 | icon: "success", 88 | }); 89 | } else { 90 | swal("Your imaginary file is safe!"); 91 | } 92 | }); 93 | //sweet alert code end 94 | }; 95 | } 96 | //SUBJECT "DELETE" CODE END 97 | 98 | //SUBJECT "EDIT" BUTTON CODE START 99 | let editAllBtn = visibleSubject.querySelectorAll(".edit-btn"); 100 | for (i = 0; i < editAllBtn.length; i++) { 101 | editAllBtn[i].onclick = function () { 102 | let parent = this.parentElement.parentElement; 103 | let saveBtn = parent.querySelector(".save-btn"); 104 | let h3 = parent.getElementsByTagName("H3"); 105 | h3[0].contentEditable = true; 106 | h3[0].focus(); 107 | this.classList.add("d-none"); 108 | saveBtn.classList.remove("d-none"); 109 | saveBtn.onclick = function () { 110 | let editedSub = h3[0].innerHTML; 111 | let id = h3[0].getAttribute("index"); 112 | updateSubject(editedSub, id); 113 | this.classList.add("d-none"); 114 | editAllBtn[id].classList.remove("d-none"); 115 | h3[0].contentEditable = false; 116 | }; 117 | }; 118 | } 119 | //SUBJECT "EDIT" BUTTON CODE END 120 | }; 121 | 122 | //SUBJECT NAME GET FROM LOCAL STORAGE START 123 | if (localStorage.getItem(brandcode + "_allSubject") != null) { 124 | allSubject = JSON.parse(localStorage.getItem(brandcode + "_allSubject")); 125 | allSubject.forEach((subject, index) => { 126 | newSubject(subject, index); 127 | }); 128 | } 129 | //SUBJECT NAME GET FROM LOCAL STORAGE END 130 | 131 | //UPDATE SUBJECT NAME IN LOCAL STORAGE START 132 | function updateSubject(subject, id) { 133 | if (subject != undefined && id != undefined) { 134 | allSubject[id] = { 135 | subjectName: subject, 136 | }; 137 | } else { 138 | let subjectBox = visibleSubject.querySelectorAll(".subject-box"); 139 | let i; 140 | allSubject = []; 141 | for (i = 0; i < subjectBox.length; i++) { 142 | let h3 = subjectBox[i].getElementsByTagName("H3"); 143 | allSubject.push({ 144 | subjectName: h3[0].innerHTML, 145 | }); 146 | } 147 | } 148 | //SET SUBJECT IN LOCAL STORAGE 149 | localStorage.setItem(brandcode + "_allSubject", JSON.stringify(allSubject)); 150 | } 151 | //UPDATE SUBJECT NAME IN LOCAL STORAGE END 152 | 153 | //SUBJECT CODING END 154 | 155 | //CREATE QUESTIONS (CHOOSE SUBJECT VALUE SHOW) CODE START 156 | let choose_subject = document.getElementById("choose-subject"); 157 | let question_form = document.querySelector(".question-form"); 158 | let allQuestionInput = question_form.querySelectorAll("INPUT"); 159 | let choose_options = document.querySelector("#choose-options"); 160 | let select_subject = document.querySelector("#select-subject"); 161 | let subjectResultEl = document.querySelector("#subject-result-el"); 162 | let allQuestion = []; 163 | let subject; 164 | question_form.addEventListener("submit", (e) => { 165 | e.preventDefault(); 166 | insertQuestionFunc(); 167 | }); 168 | const chooseSubjectFunction = () => { 169 | allSubject.forEach((subject, index) => { 170 | choose_subject.innerHTML += ` 171 | 172 | `; //"Create Subject Related Questions":-Choose Subject 173 | select_subject.innerHTML += ` 174 | 175 | `;//"Show Subject Related Questions" :- Choose Subject 176 | subjectResultEl.innerHTML += ` 177 | 178 | `;//"Get Subject Related Result" :- Choose Subject 179 | }); 180 | }; 181 | chooseSubjectFunction(); //Page reload call 182 | 183 | //SHOW SUBJECT RELATED QUESTION (Choose value) 184 | //First option select start 185 | 186 | choose_subject.addEventListener("change", () => { 187 | checkSubject(); 188 | checkSubjectKey(); 189 | }); 190 | function checkSubject() { 191 | subject = choose_subject.value; 192 | } 193 | checkSubject(); //Page reload call 194 | //Question update in localstorage successfully code start 195 | function checkSubjectKey() { 196 | if (localStorage.getItem(brandcode + "_" + subject + "_question") != null) { 197 | allQuestion = JSON.parse( 198 | localStorage.getItem(brandcode + "_" + subject + "_question") 199 | ); 200 | } else { 201 | allQuestion = []; 202 | } 203 | } 204 | checkSubjectKey(); //Page reload call 205 | //Question update in localstorage successfully code end 206 | 207 | function insertQuestionFunc(sub, id, ques, op1, op2, op3, op4, correctAns) { 208 | if (sub != undefined && id != undefined) { 209 | allQuestion[id] = { 210 | question: ques, 211 | optionOne: op1, 212 | optionTwo: op2, 213 | optionThree: op3, 214 | optionFour: op4, 215 | optionAns: correctAns, 216 | }; 217 | localStorage.setItem( 218 | brandcode + "_" + sub + "_question", 219 | JSON.stringify(allQuestion) 220 | ); 221 | swal("Updated!", "Question has been Updated successfully !", "success"); 222 | } else { 223 | if (choose_subject.value != "choose subject") { 224 | //"choose subject" is