diff --git a/QuestionPaperPreview.js b/QuestionPaperPreview.js index 6ab282b..94be003 100644 --- a/QuestionPaperPreview.js +++ b/QuestionPaperPreview.js @@ -1,3 +1,4 @@ + function QuestionPaperPreview(jsonData){ // The provided JSON data // console.log(jsonData) @@ -68,9 +69,10 @@ function QuestionPaperPreview(jsonData){ const questionPaperTitle = data.question_paper_title; const questionPaperDescription = data.question_paper_description; + var title = removeHtmlTags(questionPaperTitle) // Wrap the heading elements in
elements with CSS for centering - questionPaper += `

${questionPaperTitle}

`; + questionPaper += `

${title}

`; questionPaper += `
${questionPaperDescription}
`; // questionPaper += "


"; // Add a newline for separation @@ -217,4 +219,13 @@ function QuestionPaperPreview(jsonData){ const formattedQuestionPaper = convertJSONToQuestionPaper(jsonData, 0, 1, 1); const questionPaperElement = document.getElementById("questionPaper"); questionPaperElement.innerHTML = formattedQuestionPaper; // Use innerHTML here + } + +function removeHtmlTags(inputString) { + + const cheerio = require('cheerio'); + const $ = cheerio.load(inputString); + const text = $.text(); + + return text; } \ No newline at end of file diff --git a/QuestionPreview.html b/QuestionPreview.html index 5ced434..b7d2e41 100644 --- a/QuestionPreview.html +++ b/QuestionPreview.html @@ -104,6 +104,10 @@ font-weight: 500; } + hr{ + border-top: 2px solid rgba(0,0,0,.1) !important; + } + /* Questions Mark */ .question_Text{ @@ -180,32 +184,14 @@ } -/* Style for the Choose File button */ -.file-input { - background-color: #533dfd; - color: #fff; - border: none; - padding: 10px 20px; - border-radius: 5px; - cursor: pointer; - } - - /* Style for the Submit button */ - .submit-button { - background-color: #2ecc71; - color: #fff; - border: none; - padding: 10px 20px; - height: 55px; - border-radius: 5px; - cursor: pointer; - } body { background-image: url('assets/images/bg1-1.png'); background-size: cover; /* Adjust as needed */ background-repeat: no-repeat; background-attachment: fixed; + background-color: #00000073; + } @@ -252,7 +238,56 @@ /* p.question_Text:not(:first-of-type) { margin-left: 34px; } */ - + +.main-header { +position: fixed!important; +top: 0!important; +width: 100%!important; +background-color: #fff!important; +box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)!important; +z-index: 999!important; +border-bottom: 2px solid #A8DADC !important; +} + +.nav-menu { +margin-top: -9px!important; +} + +.logo-d{ +width: 150px!important; +padding-top: 10px !important; +} + +.heder-menu ul li a { +font-weight: 400 !important; +color: #1d3557 !important; +} +.heder-menu ul li a:hover { + filter: invert(23%) sepia(67%) saturate(2476%) hue-rotate(335deg) brightness(89%) contrast(89%); +} + +/* .row.section { + box-shadow: 8px 9px 35px 0px rgb(145 145 145 / 24%) !important; + background: #fff !important; +} */ + +.QuestionPaperClass{ + width: 100%; + position: relative; + padding: 55px 60px 55px 60px !important; + margin-top: 50px; + background-color: #FFFFFF; + color: #1D3557; + border-radius: 10px; + margin-bottom: 50px; + border-bottom: 4px solid; + box-shadow: 13px 14px 40px 5px rgba(8, 8, 8, 0.24); +} + +.QuestionPaperClass h1{ + color: #1d3557 !important; +} + @@ -272,15 +307,14 @@
-
-
- -
-
- -
-
- -
-
-
+
+

             
@@ -315,7 +335,7 @@
- © 2023 Project-B. All rights reserved. + © 2023 Project-B. All rights reserved.
diff --git a/addform.html b/addform.html index 156ca5d..7005100 100644 --- a/addform.html +++ b/addform.html @@ -55,15 +55,6 @@ color:#3399FF; } - - ul, #myUL { - list-style-type: none; - } - - #myUL { - margin: 0; - padding: 0; - } .caret { cursor: pointer; @@ -94,27 +85,6 @@ display: block; } - #myUL{ - display: flex; - } - - #myUL ul { - list-style-type: none; - padding: 0; - } - - #myUL li { - margin-bottom: 5px; - } - - #myUL a { - text-decoration: none; - color: #333; - } - - #myUL a:hover { - color: #000; - } .nested { border-left: 2px dotted #000; @@ -134,12 +104,13 @@ /* Initially hide the icon */ .drag-handle { - display: none; + /* display: none; */ + color: transparent; } /* Show the icon when hovering over the parent element with .hidedrag */ - .hidedrag:hover .drag-handle { - display: block; + .element:hover .drag-handle { + color: blueviolet; } body { @@ -147,14 +118,15 @@ background-size: cover; background-repeat: no-repeat; background-attachment: fixed; + background-color: #00000073; } [contentEditable=true]:empty:not(:focus):before { content: attr(data-text) - } + } .highlight { - background-color: rgb(230, 221, 235); /* Change to your preferred highlight color */ + background-color: rgb(230, 221, 235); } /* Define the transition for the animation */ @@ -164,9 +136,9 @@ /* Style for the placeholder element with a slow animation */ .placeholder { - height: 20px; /* Adjust the height as needed to create the desired gap */ - background-color: transparent; /* Set the background to transparent or match your layout */ - transition: height 0.5s ease; /* Adjust the duration and easing for the gap animation */ + height: 20px; + background-color: transparent; + transition: height 0.5s ease; } math-field{ @@ -178,9 +150,9 @@ .buttons { position: absolute; - top: 0px; - right: -192px; - /* display: none; */ + top: 58px; + right: -185px; + float: right; text-align: -webkit-right; } @@ -198,6 +170,13 @@ } .menu-symbol::before { + content: '\2715';/* Unicode character for the menu symbol (x) */ + font-size: 25px; + /* position: absolute; + left: 4px; + top: 2px; */ + } + .menu-symbol1::before { content: '\2630'; /* Unicode character for the menu symbol (☰) */ font-size: 24px; /* Adjust the font size as needed */ } @@ -213,7 +192,7 @@ /* Style for the collapsible content */ .content { display: none; - margin-left: 20px; + margin-left: 9px; } .content.visible { @@ -232,13 +211,19 @@ #sidebar-wrapper { min-height: 100vh; + flex-basis:20%; width:300px; margin-left: -15rem; transition: margin 0.25s ease-out; - background-color: #ffffff8f!important; + background-color: #ffffff!important; position: relative; overflow-y: auto; - border-radius: 40px; + /* border-radius: 40px; */ + } + + #sidebar-wrapper~.container{ + flex-basis:80%; + max-width:1024px; } #sidebar-wrapper .sidebar-heading { @@ -250,11 +235,9 @@ width: 15rem; } #questionPaper{ - position: fixed; - top: 151px; - left: 0; + margin-top:65px; overflow-y: auto; - overflow-x: scroll; + overflow-x: clip; max-height: 532px; padding:0 10px 20px; width: 235px; @@ -267,6 +250,10 @@ body.sb-sidenav-toggled #wrapper #sidebar-wrapper { margin-left: 0; } + body.sb-sidenav-toggled #sidebar-wrapper~.container{ + flex-basis:100%; + max-width:1140px; + } @media (min-width: 100px) { #sidebar-wrapper { @@ -279,6 +266,9 @@ body.sb-sidenav-toggled #wrapper #sidebar-wrapper { margin-left: -19rem; } + body.sb-sidenav-toggled #wrapper #sidebar-wrapper .sidebar-fixed{ + left:-19rem; + } } @@ -311,42 +301,50 @@ } /*navigation botton */ - .menu-symbol { + .menu-symbol1{ background-color: transparent; - margin-top: 14px; - margin-right: -69%; - margin-left: -108px; + position: fixed; + top:81px; + left: 10px; border: none; - border-radius: 50%; /* Make the button round */ + border-radius: 15%; /* Make the button round */ width: 40px; /* Set the width and height of the button */ height: 40px; + transition: box-shadow 0.3s, background-color 0.3s; + color: #bf303b; + /* background: #bf303b; */ + } + .menu-symbol { + position:absolute; + right:0; + background-color: transparent; + margin-top: 14px; + border-radius: 20%; + width: 35px; + height: 35px; + color: #BF303B; + /* border: 2px solid #a09c9c; */ + /* background: #BF303B; */ transition: box-shadow 0.3s, background-color 0.3s; /* Add a smooth transition to the shadow and background-color */ } + /* .menu-symbol { + position:absolute; + right:0; + background-color: transparent; + margin-top: 14px; + border: none; + border-radius: 50%; + width: 40px; + height: 40px; + transition: box-shadow 0.3s, background-color 0.3s; + } */ - .menu-symbol:hover { - box-shadow: 0 0 10px rgba(0, 0, 0, 0); /* Add a transparent shadow on hover */ + /* .menu-symbol:hover { + box-shadow: 0 0 10px rgba(0, 0, 0, 0); background-color: #e4d3f8b4; - } - - /* @media not (pointer: coarse) { - math-field::part(virtual-keyboard-toggle) { - display: none; - } - -} */ - -/* body { - --keycap-height: 24px; - --keycap-font-size: 16px; - --keycap-shift-font-size: 9px; - --keycap-small-font-size: 9px; - --keycap-extra-small-font-size: 9px; - --keyboard-toolbar-font-size: 16px; - --keycap-gap: 1px; -} */ - - + } */ + @@ -422,9 +420,9 @@ .dropdown-content { display: none; position: absolute; - background-color: #f9f9f9; + /* background-color: #f9f9f9; */ min-width: 56px; - box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + /* box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); */ z-index: 1; right:12px; } @@ -438,6 +436,55 @@ .dropdown:hover .dropdown-content { display: block; } + + +.main-header { +position: fixed!important; +top: 0!important; +width: 100%!important; +background-color: #fff!important; +box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1)!important; +z-index: 999!important; +border-bottom: 2px solid #A8DADC !important; +} + +.nav-menu { +margin-top: -9px!important; +} + +.logo-d{ +width: 150px!important; +padding-top: 10px !important; +} + +.heder-menu ul li a { +font-weight: 400 !important; +color: #1d3557 !important; +} +.heder-menu ul li a:hover { + +filter: invert(23%) sepia(67%) saturate(2476%) hue-rotate(335deg) brightness(89%) contrast(89%); + +} + +.heder-menu { + display: inline-block; + position: relative !important; + right: -15px !important; +} +/* a .addPageMenu:hover {.buttons +} */ + + +h1.title{ + font-size: 20px; + text-align: center; + font-weight: 400; + color: #1d3557; + padding-bottom: 10px; +} + + @@ -453,80 +500,68 @@ -
-
-
-
- + +
-
+
- - -
+
+

Questionnaire Details

-
+
- +
-
+
+
@@ -560,7 +595,7 @@
- +
@@ -575,6 +610,7 @@
+
@@ -593,6 +629,12 @@
+ +
+
+ © 2023 Project-B. All rights reserved. +
+
@@ -624,7 +666,7 @@ // Clear the content of the popup by setting its innerHTML to an empty string // popup.innerHTML = ''; - console.log("popup:",popup); + // console.log("popup:",popup); // Hide the popup by setting its display style to "none" popup.style.display = 'none'; json2nav(); @@ -633,12 +675,7 @@ }); - -
-
- © 2023 Project-B. All rights reserved. -
-
+ @@ -745,6 +782,10 @@ var FileName = params.get('filename');// Get the value of a specific parameter var xmlPath ="" //get the xml filepath in .env file local variable $(document).ready(function() { + + const targetId = 'Question_title'; + scrollToElementWithoutLink(targetId); + require('dotenv').config(); const path = require('path'); @@ -759,7 +800,7 @@ $(document).ready(function() { if(FileName == "" || FileName == null ) { var random_no = Date.now(); - addSection(false, false, random_no, false, false, false, false); //Call the Default section on the QUestion paper + addSection(false, false, random_no, false, false, false, false, 1); //Call the Default section on the QUestion paper }else { loadXML(FileName); //send filename to read xml files to using this function @@ -872,9 +913,28 @@ function loadXML(xmlFileName) { // Function for Save the XML File function saveFile(flag=0) { - html2json(); - json2xml(); - console.log("flag",flag); + + var title_id = localStorage.getItem('JSON_FOR_EMPTY_QUESTION'); + console.log(title_id); + + var count = ""; + if(title_id !== '' && title_id !== null) + { + var parsedArray = JSON.parse(title_id); + var count = parsedArray.length; + console.log('count - ' + count) + } + else + { + count = 0 + } + + + if (count > 0) { + check_Empty_Question() + } else { + html2json(); + json2xml(); if(FileName == "" || FileName == null ){ setTimeout(promptBox, 1000); @@ -888,10 +948,13 @@ function saveFile(flag=0) { }else{ savexml(newFileName); } - } + + } +} }; - + + @@ -956,6 +1019,25 @@ rtc_hide_and_show(questionDescriptionRtc); }); +var checkboxElement = document.createElement('input'); +checkboxElement.type = 'checkbox'; +checkboxElement.id = 'myCheckbox'; +checkboxElement.textContent = 'myCheckbox'; +checkboxElement.style.width = '14px'; +checkboxElement.style.height = '14px'; +var parentElement = document.getElementById(questionDescriptionRtc); + + +var labelElement = document.createElement('label'); +labelElement.htmlFor = 'myCheckbox'; +labelElement.textContent = 'Math'; + +console.log(parentElement); +parentElement.appendChild(checkboxElement); +parentElement.appendChild(labelElement); + + + var inputElement2 = document.getElementById('Question_title'); inputElement2.addEventListener("keyup", function(event) { @@ -992,10 +1074,21 @@ function hideButtons(container) { var i = 0; +var array_of_Id = []; +var questionGroupTitle = ""; +var checktextquestona= 0; +var checkchoicequestona= 0; +var questionIncrement = 1; + + + //Function for Create a New Section in the Question Paper -function addSection(title = false, description = false, random_no = false, section_uuid = false, section_marks = false, sectionDispalyMarks = false, sectionAttemptAny = false) +function addSection(title = false, description = false, random_no = false, section_uuid = false, section_marks = false, sectionDispalyMarks = false, sectionAttemptAny = false, scrollval = false) { - + checktextquestona = 0 + questionIncrement = 1; + + questionGroupTitle =""; const Section_UUID = uuidv4(); var addsection = ""; @@ -1018,99 +1111,95 @@ function addSection(title = false, description = false, random_no = false, secti i = i + 1; addsection += ` -
-
- -   - Section:${i} -
- -
-
- -
-
+
+ +
+

Section ${i}

+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
-
- -
-
- -
-
-
-
+
+ +
${title ? title : ''}
+
+
-
- -
+
+
+ +
${description ? description : ''}
+
+
-
- -
${title ? title : ''}
-
-
+
+ Display Marks + +
-
-
- -
${title ? description : ''}
-
-
+
+
+
Attempt Any:
+ +
+
-
- Display Marks - -
- -
-
-
Attempt Any :
- -
-
+
+
+
Marks:
+ +
+
+
+
+
+
+
+
+
+
+
- -
-
-
Marks :
- -
-
-
-
-
-
-
-
-
-
-
`; var formContainer = document.getElementById('addNewSection'); formContainer.insertAdjacentHTML('beforeend', addsection); + + array_of_Id.push('section_title_text_' + sectionRandomID); var addNewButtonId = 'addNewButton_' + sectionRandomID; var SectionButtonId = 'sectionButton_' + sectionRandomID; @@ -1189,7 +1278,8 @@ function addSection(title = false, description = false, random_no = false, secti - var collapseSectionId = (random_no == false) ? 'collapseSection_' + text_field_created_time : 'collapseSection_' + random_no; + var collapseSectionId = (random_no == false) ? 'collapseSection2_' + text_field_created_time : 'collapseSection2_' + random_no; + var contentId = (random_no == false) ? 'question_area_' + text_field_created_time : 'question_area_' + random_no; var sessionTitleId = (random_no == false) ? 'section_title_' + text_field_created_time : 'section_title_' + random_no; @@ -1201,16 +1291,14 @@ function addSection(title = false, description = false, random_no = false, secti $(document).ready(function () { $('#' + collapseSectionId).on('click', function () { - if (content.style.display === 'none' || content.style.display === '') { + if (content.style.display === 'none') { + $(this).removeClass('fa-angle-down').addClass('fa-angle-up'); content.style.display = 'block'; sessionTitle.style.display = 'block'; - addNewButton.style.display = 'block'; - $(this).removeClass('fa-angle-up').addClass('fa-angle-down'); } else { content.style.display = 'none'; sessionTitle.style.display = 'none'; - addNewButton.style.display = 'none'; - $(this).removeClass('fa-angle-down').addClass('fa-angle-up'); + $(this).removeClass('fa-angle-up').addClass('fa-angle-down'); } }); }); @@ -1236,7 +1324,7 @@ function addSection(title = false, description = false, random_no = false, secti var NewRTEId = (random_no == false) ? 'section_title_rtc_' + text_field_created_time : 'section_title_rtc_' + random_no; var section_title_previousDiv = $('#'+section_title_Div).prev(); section_title_previousDiv.attr("id", NewRTEId); - $('#'+section_title_Div).click(function() { + $('#'+section_title_Div).focus(function() { rtc_hide_and_show(NewRTEId); @@ -1246,7 +1334,7 @@ function addSection(title = false, description = false, random_no = false, secti var NewRTEId2 = (random_no == false) ? 'section_description_rtc_' + text_field_created_time : 'section_description_rtc_' + random_no; var section_description_previousDiv = $('#'+section_description_Div).prev(); section_description_previousDiv.attr("id", NewRTEId2); - $('#'+section_description_Div).click(function() { + $('#'+section_description_Div).focus(function() { rtc_hide_and_show(NewRTEId2); @@ -1255,15 +1343,18 @@ function addSection(title = false, description = false, random_no = false, secti $(section_description_previousDiv).hide(); $(section_title_previousDiv).hide(); - + + var sectionID = 'section_title_text_' + sectionRandomID; var inputElement = document.getElementById(sectionID); + var tempSectionTitle = document.getElementById('section_title_text_'+ sectionRandomID).querySelector('.ql-editor').innerHTML; inputElement.addEventListener("keyup", function(event) { json2nav(); clearSidebarWrapper(); navpane(); + check_Remove_Empty_Question(sectionID); }); @@ -1306,15 +1397,20 @@ navpane(); //function for new section add to go that section prevent default var EditScroll = localStorage.getItem('scroll') -console.log('sectionEditScroll : ', EditScroll) -if(EditScroll !== '1') +if(EditScroll !== '1' && scrollval == false) { const targetId = 'section_title_text_' + sectionRandomID; scrollToElementWithoutLink(targetId); } - + + + + const arrayString = JSON.stringify(array_of_Id); + collect_Empty_Question_Id(arrayString, sectionID); + + } @@ -1361,38 +1457,40 @@ function addQuestionGroup(idObj)
+
-
- +
+
+ +
+

Question Group

       -
+        +
-
-
- -
- +
${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}
@@ -1451,7 +1549,9 @@ function addQuestionGroup(idObj) var formContainer = document.getElementById(add_question_group_id); formContainer.insertAdjacentHTML('beforeend', addQuestionGroup); - } + } + + array_of_Id.push('subSection_title_text_' + QuestionGroup_ID); var addNewButtonId = 'addNewButtonSectionQroup_' + QuestionGroup_ID ; var textButtonId = 'textButtonSectionQroup_' + QuestionGroup_ID ; @@ -1519,7 +1619,7 @@ function addQuestionGroup(idObj) var NewRTEId = 'subsection_title_rtc_' + QuestionGroup_ID; var sub_section_title_previousDiv = $('#'+sub_section_title_Div).prev(); sub_section_title_previousDiv.attr("id", NewRTEId); - $('#'+sub_section_title_Div).click(function() { + $('#'+sub_section_title_Div).focus(function() { rtc_hide_and_show(NewRTEId) @@ -1530,7 +1630,7 @@ function addQuestionGroup(idObj) var NewRTEId2 = 'subsection_description_rtc_' + QuestionGroup_ID; var sub_section_description_previousDiv = $('#'+sub_section_description_Div).prev(); sub_section_description_previousDiv.attr("id", NewRTEId2); - $('#'+sub_section_description_Div).click(function() { + $('#'+sub_section_description_Div).focus(function() { rtc_hide_and_show(NewRTEId2) @@ -1558,16 +1658,17 @@ function addQuestionGroup(idObj) DisplayMark_ID.checked = true; } - - - var question_groupid = 'subSection_title_text_'+ QuestionGroup_ID; var inputElement = document.getElementById(question_groupid); +attrId = document.getElementById('subSection_title_text_'+ QuestionGroup_ID).querySelector('.ql-editor').innerHTML; + inputElement.addEventListener("keyup", function(event) { json2nav(); clearSidebarWrapper(); navpane(); + check_Remove_Empty_Question(question_groupid); + // SetQuestionGroupTitle(QuestionGroup_ID, QuestionGroup_ID) }); @@ -1599,16 +1700,29 @@ markCalculation() const questionGroupId =question_groupid; const classes = findParent(parsedValue, questionGroupId); //this line goto checkParent.js and give the Parent count + // var removetagvalue = removeHtmlTags(classes.value2) + + // if(classes.value1 != 1 ){ + + // var parOfId = document.getElementById('partOf_'+QuestionGroup_ID) + // parOfId.innerHTML = `( part of ${questionGroupTitle})`; + // questionGroupTitle=removetagvalue; + // } + // else + // { + // questionGroupTitle=removetagvalue; + // } + let originalString = questionGroupId; let substringToRemove = "subSection_title_text_"; let modifiedString = originalString.replace(substringToRemove, ''); - console.log(modifiedString); + // console.log(modifiedString); // let finalString = "QuestionGroupButtons_" + modifiedString; let finalString ="draggedGroup_" +modifiedString; var element = document.getElementById(finalString); - console.log(element) - if (classes < 5) { + // console.log(element) + if (classes.value1 < 5) { // console.log("Div not found."); localStorage.setItem('QuestionGroupId', QuestionGroup_ID) @@ -1623,15 +1737,13 @@ markCalculation() element.parentNode.removeChild(element); // localStorage.removeItem('yourKey'); - console.log(element) - console.log("Div removed successfully."); + // console.log(element) + // console.log("Div removed successfully."); } // end of find QG level script //function for new QuestionGroup add scroll to the QuestionGroup prevent default var EditScroll = localStorage.getItem('scroll') -console.log('QuestionGroup-EditScroll : ', EditScroll) - if(EditScroll !== '1') { @@ -1639,6 +1751,10 @@ const targetId = 'subSection_title_text_' + QuestionGroup_ID; scrollToElementWithoutLink(targetId); } + + const arrayString = JSON.stringify(array_of_Id); + collect_Empty_Question_Id(arrayString, question_groupid); + // SetQuestionGroupTitle(QuestionGroup_ID, QuestionGroup_ID) } @@ -1646,7 +1762,6 @@ scrollToElementWithoutLink(targetId); // function groupQuestion( question_id = false, section_id = false , group_question_area_id = false, questionTitle = false, questionDescription = false, questionSubType = false, mathEnabled = false, Choice = false, questionAreaId = false, questionGroupId = false, questionRandomNo = false, QuestionGroupRandomNo = false, questionMarks = false, questionUUID = false, group_question_marks = false, group_question_uuid = false, questionDisplayMarks = false, group_question_Display_Marks = false) function groupQuestion(question_id = false, section_id = false , group_question_area_id = false, questionTitle = false, questionDescription = false, questionType = false, questionSubType = false, mathEnabled = false, Choice = false, questionAreaId = false, questionRandomNo = false, questionMarks = false, questionUUID = false, questionDisplayMarks = false) { - console.log(group_question_area_id); const ChoiceGroupFixed_UUID = uuidv4(); var groupQuestion = ""; @@ -1659,6 +1774,29 @@ function groupQuestion(question_id = false, section_id = false , group_question_ var UUID = false; + //for hide and the side button + var questiongrouparea = ""; + if(questionAreaId !== false) + { + questiongrouparea = questionAreaId.split("_")[0]; + } + else + { + questiongrouparea = 'false'; + } + + + var lineImg = '' + + if(questiongrouparea === 'group' || group_question_area_id !== false) + { + var lineImg = 'line2.svg'; + } + else{ + var lineImg = 'line.svg'; + } + + if(questionRandomNo) @@ -1689,14 +1827,13 @@ function groupQuestion(question_id = false, section_id = false , group_question_ UUID = ChoiceQuestion_UUID; } - - var sectionRandomID = localStorage.getItem('sectionId'); var QuestionGroup_ID = localStorage.getItem('QuestionGroupId'); groupQuestion += - `
+ `
+
@@ -1711,17 +1848,17 @@ function groupQuestion(question_id = false, section_id = false , group_question_
@@ -1733,13 +1870,13 @@ function groupQuestion(question_id = false, section_id = false , group_question_
@@ -1752,7 +1889,7 @@ function groupQuestion(question_id = false, section_id = false , group_question_
- +
${questionTitle ? questionTitle : ''}
@@ -1842,8 +1979,9 @@ function groupQuestion(question_id = false, section_id = false , group_question_ var sectionDiv = document.getElementById(group_question_area_id); sectionDiv.insertAdjacentHTML('beforeend', groupQuestion); } - - + + array_of_Id.push('textQuestionName_' + addChoiceAreaId); + var commentButtonId = 'commentButton_' + addChoiceAreaId; var commentFieldId = 'commentField_' + addChoiceAreaId; var imageButtonId = 'imageButton_' + addChoiceAreaId; @@ -1958,16 +2096,7 @@ function groupQuestion(question_id = false, section_id = false , group_question_ var QuestionGroupAddButtons_ID = document.getElementById(QuestionGroupAddButtons_Raw) var removeAndCloneTextQuestion_ID = document.getElementById(removeAndCloneTextQuestion_Raw); - //for hide and the side button - var questiongrouparea = ""; - if(questionAreaId !== false) - { - questiongrouparea = questionAreaId.split("_")[0]; - } - else - { - var questiongrouparea = 'false'; - } + if(group_question_area_id !== false) @@ -2057,7 +2186,7 @@ var textQuestionName_Div = 'textQuestionName_' + addChoiceAreaId; var textQuestionNewRTEId = 'typeTwotextQuestionName_rtc_' + addChoiceAreaId; var textQuestionName_previousDiv = $('#'+textQuestionName_Div).prev(); textQuestionName_previousDiv.attr("id", textQuestionNewRTEId); -$('#'+textQuestionName_Div).click(function() { +$('#'+textQuestionName_Div).focus(function() { rtc_hide_and_show(textQuestionNewRTEId); @@ -2068,7 +2197,7 @@ var textQuestionSubtitle_Div = 'textQuestionSubtitle_' + addChoiceAreaId; var textQuestionSubtitleNewRTEId = 'typeTwotextQuestionSubtitle_rtc_' + addChoiceAreaId; var textQuestionSubtitle_previousDiv = $('#'+textQuestionSubtitle_Div).prev(); textQuestionSubtitle_previousDiv.attr("id", textQuestionSubtitleNewRTEId); -$('#'+textQuestionSubtitle_Div).click(function() { +$('#'+textQuestionSubtitle_Div).focus(function() { rtc_hide_and_show(textQuestionSubtitleNewRTEId); @@ -2078,7 +2207,7 @@ var choiceTextField_Div = 'choiceTextField_' + addChoiceAreaId; var choiceTextNewRTEId = 'choiceTextField_rtc_' + addChoiceAreaId; var choiceTextField_previousDiv = $('#'+choiceTextField_Div).prev(); choiceTextField_previousDiv.attr("id", choiceTextNewRTEId); -$('#'+choiceTextField_Div).click(function() { +$('#'+choiceTextField_Div).focus(function() { rtc_hide_and_show(choiceTextNewRTEId); @@ -2106,12 +2235,15 @@ if (questionSubType === 'true') { var choiceid = 'textQuestionName_'+ addChoiceAreaId; -var inputElement = document.getElementById(choiceid); +var inputElement = document.getElementById(choiceid); +attrId = document.getElementById('textQuestionName_'+ addChoiceAreaId).querySelector('.ql-editor').innerHTML; $(inputElement).keyup(function(event) { json2nav(); clearSidebarWrapper(); navpane(); + check_Remove_Empty_Question(choiceid); + // SetQuestionGroupTitle(QuestionGroup_ID,addTextQuestionId); }); @@ -2132,18 +2264,26 @@ markCalculation(); //function for new ChoiceQuestion add scroll to the ChoiceQuestion prevent default var EditScroll = localStorage.getItem('scroll') -console.log('ChoiceQuestion-EditScroll : ', EditScroll) - if(EditScroll !== '1') { const targetId = 'textQuestionName_' + addChoiceAreaId; scrollToElementWithoutLink(targetId); } + + const arrayString = JSON.stringify(array_of_Id); + collect_Empty_Question_Id(arrayString, choiceid); + // if (checkchoicequestona != 0) { + // console.log(checktextquestona); + // // SetQuestionGroupTitle(QuestionGroup_ID,addChoiceAreaId); + // } + + // checkchoicequestona++ + } //Function for Create a New Choice Field in a Choice Question -function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionRandomNo = false, choiceID = false, choice_mathEnabled= false) +function addNewChoice(NewaddChoiceAreaId = false, focusval = false, choiceName = false, questionRandomNo = false, choiceID = false, choice_mathEnabled= false) // function addNewChoice(choiceObj) { @@ -2180,7 +2320,12 @@ function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionR NewaddChoiceAreaId.insertAdjacentHTML('beforeend', addChoice); } - + var newChoiceId = document.getElementById('newChoiceTextField_'+text_field_created_time+rnd_no); + if(focusval !== false) + { + newChoiceId.focus(); //these lines are create a new choice field to focus that field + } + var newChoiceCommentButtonId = document.getElementById('newChoiceCommentButton_'+text_field_created_time+rnd_no); var newChoiceCommentFieldId = document.getElementById('newChoiceCommentField_'+text_field_created_time+rnd_no); var newChoiceCommentFieldDeleteId = document.getElementById('newChoiceGroup_'+text_field_created_time+rnd_no); @@ -2205,13 +2350,13 @@ $(newChoiceDeleteButtonId).on('click', function() { placeholder: 'Enter Choice', }); - var newchoiceFieldId = 'newChoiceTextField_'+text_field_created_time+rnd_no; var newchoiceTextField_Div = document.getElementById(newchoiceFieldId); var newchoiceTextField_previousDiv = $(newchoiceTextField_Div).prev(); var newChoiceTextNewRTEId = "newChoiceTextField_rtc_"+text_field_created_time+rnd_no; newchoiceTextField_previousDiv.attr("id", newChoiceTextNewRTEId); + newchoiceTextField_Div.addEventListener('click', function() { @@ -2281,15 +2426,17 @@ $(newChoiceDeleteButtonId).on('click', function() { } -//Function for Create a New Text Question in the Section and Question Group +//Function for Create a New Text Question in the Section and Question Group function textQuestion(QuestionObj) { - - if(QuestionObj.hasOwnProperty('group_question_area_id')) + var group_area_id = "" + if(QuestionObj.hasOwnProperty('group_question_area_id')) { - console.log(QuestionObj.group_question_area_id); - var sectionDiv = document.getElementById(QuestionObj.group_question_area_id); - console.log(sectionDiv) + group_area_id = document.getElementById(QuestionObj.group_question_area_id); +} +else +{ + group_area_id = false; } var textQuestion = ""; @@ -2315,11 +2462,31 @@ else } +var questionAreaType = ""; +if(QuestionObj.hasOwnProperty('question_area_id')){ +questionAreaID = QuestionObj.question_area_id; +questionAreaType = questionAreaID.split("_")[0]; +} + +var lineImg = '' + +if(questionAreaType === 'group' || group_area_id !== false) +{ + var lineImg = 'line2.svg'; +} +else{ + var lineImg = 'line.svg'; +} + + + var sectionRandomID = localStorage.getItem('sectionId'); var QuestionGroup_ID = localStorage.getItem('QuestionGroupId'); + textQuestion += -`
+`
+
@@ -2334,17 +2501,17 @@ textQuestion +=
@@ -2356,13 +2523,13 @@ textQuestion +=
@@ -2371,7 +2538,7 @@ textQuestion +=
- +
${QuestionObj.hasOwnProperty('questionTitle') ? QuestionObj.questionTitle : ''}
@@ -2426,7 +2593,7 @@ else if(QuestionObj.hasOwnProperty('group_question_area_id')) var sectionDiv = document.getElementById(QuestionObj.group_question_area_id); sectionDiv.insertAdjacentHTML('beforeend', textQuestion); } - +array_of_Id.push('textQuestionName_' + addTextQuestionId); var ChoiceMathSwitch ='math_' + addTextQuestionId; var textQuestionSubtitle_math = 'textQuestionSubtitle_math_' + addTextQuestionId; @@ -2476,11 +2643,6 @@ var AddButtons_ID = document.getElementById(AddButtons_Raw) var QuestionGroupAddButtons_ID = document.getElementById(QuestionGroupAddButtons_Raw) var removeAndCloneTextQuestion_ID = document.getElementById(removeAndCloneTextQuestion_Raw); -var questionAreaType = ""; -if(QuestionObj.hasOwnProperty('question_area_id')){ -questionAreaID = QuestionObj.question_area_id; -questionAreaType = questionAreaID.split("_")[0]; -} var questionGroupID = "" if(QuestionObj.hasOwnProperty('group_question_area_id')) @@ -2559,7 +2721,7 @@ else var textQuestionNewRTEId = 'typeOnetextQuestionName_rtc_' + addTextQuestionId; var textQuestionName_previousDiv = $('#'+textQuestionName_Div).prev(); textQuestionName_previousDiv.attr("id", textQuestionNewRTEId); - $('#'+textQuestionName_Div).click(function() { + $('#'+textQuestionName_Div).focus(function() { rtc_hide_and_show(textQuestionNewRTEId); }); @@ -2569,12 +2731,33 @@ else var textQuestionSubtitleNewRTEId = 'typeOnetextQuestionSubtitle_rtc_' + addTextQuestionId; var textQuestionSubtitle_previousDiv = $('#'+textQuestionSubtitle_Div).prev(); textQuestionSubtitle_previousDiv.attr("id", textQuestionSubtitleNewRTEId); - $('#'+textQuestionSubtitle_Div).click(function() { + $('#'+textQuestionSubtitle_Div).focus(function() { rtc_hide_and_show(textQuestionSubtitleNewRTEId); }); + + + // var checkboxElement = document.createElement('input'); + // checkboxElement.type = 'checkbox'; + // checkboxElement.id = 'math_'+addTextQuestionId; + // checkboxElement.style.width = '14px'; + // checkboxElement.style.height = '14px'; + // var parentElement = document.getElementById(textQuestionSubtitleNewRTEId); + + + // var labelElement = document.createElement('label'); + // labelElement.htmlFor = 'math_'+addTextQuestionId; + // labelElement.textContent = 'Math'; + + // console.log(parentElement); + // parentElement.appendChild(checkboxElement); + // parentElement.appendChild(labelElement); + + + + $(textQuestionName_previousDiv).hide(); $(textQuestionSubtitle_previousDiv).hide(); @@ -2602,11 +2785,17 @@ else var Textid = 'textQuestionName_'+ addTextQuestionId; var inputElement = document.getElementById(Textid); +var tempQuestionTitle = inputElement.querySelector('.ql-editor').innerHTML; $(inputElement).keyup(function(event) { json2nav(); clearSidebarWrapper(); navpane(); + check_Remove_Empty_Question(Textid); + // SetQuestionGroupTitle(QuestionGroup_ID,addTextQuestionId) + + + }); // function for calling html2json using Mark Calculation @@ -2614,7 +2803,7 @@ var inputElement = document.getElementById(Textid); $('#'+textQuestionMarkField).keyup(function() { json2nav() - markCalculation() + markCalculation(); }); @@ -2626,17 +2815,175 @@ var inputElement = document.getElementById(Textid); //function for new TextQuestion add scroll to the TextQuestion prevent default var EditScroll = localStorage.getItem('scroll') -console.log('TextQuestion-EditScroll : ', typeof(EditScroll)); - if(EditScroll !== '1') { const targetId = 'textQuestionName_' + addTextQuestionId; scrollToElementWithoutLink(targetId); } +const arrayString = JSON.stringify(array_of_Id); +collect_Empty_Question_Id(arrayString, Textid); + +// if (checktextquestona != 0) { +// SetQuestionGroupTitle(QuestionGroup_ID,addTextQuestionId); +// } + +// checktextquestona++ + + } +function SetQuestionGroupTitle(QuestionGroup_ID,QuestionId){ + + json2nav(); + clearSidebarWrapper(); + navpane(); + + // const localquestionGroupID = localStorage.getItem('QuestionGroupId') + // const jsonvalue = localStorage.getItem('JSON_FOR_NAV') + // const parsedValue = JSON.parse(jsonvalue); + // const questionGroupId ='subSection_title_text_'+ localquestionGroupID; + // const parentList = findParent(parsedValue, questionGroupId); + + // console.log(parentList) + + // var removetagvalue = removeHtmlTags(parentList.value2); + + // if(parentList.value1 != 0 ){ + + // var parOfId = document.getElementById('partOf_'+QuestionId) + // if(parentList.value1 == 1) + // { + // parOfId.innerHTML = questionGroupTitle; + // questionGroupTitle=removetagvalue; + // if (questionIncrement != 1) { + // parOfId.innerHTML = `( part of ${questionGroupTitle})`; + // questionGroupTitle=removetagvalue; + // } + // questionIncrement++ + // } + + // else{ + // parOfId.innerHTML = `( part of ${questionGroupTitle})`; + // questionGroupTitle=removetagvalue; + // } + + // } + // else + // { + // questionGroupTitle=removetagvalue; + // } + + // json2nav(); + // clearSidebarWrapper(); + // navpane(); + +} + + +//function for find empty question id +function collect_Empty_Question_Id(arrayString, ID) { + + const input_text_value = document.getElementById(ID); + + var attrId = "" + if(input_text_value !== null) + { + attrId = input_text_value.querySelector('.ql-editor').innerHTML; + } + else{ + attrId = '


'; + } + + var value = localStorage.getItem('EditNavExpend'); + if (!value && attrId === '


') { + + localStorage.setItem('JSON_FOR_EMPTY_QUESTION', arrayString); + } + else{ + localStorage.removeItem('JSON_FOR_EMPTY_QUESTION'); + array_of_Id = []; + } +} + +function check_Empty_Question() +{ + var title_id = localStorage.getItem('JSON_FOR_EMPTY_QUESTION'); + if (title_id) { + var parsedArray = JSON.parse(title_id); + + parsedArray.forEach(function(Id, index) { + attrId = document.getElementById(Id).querySelector('.ql-editor').innerHTML; + if(attrId === '


') + { + scrollToElementWithoutLink(Id); + document.getElementById(Id).focus(); + } + }); + } +} + +function check_Remove_Empty_Question(IdToRemove) { +// console.log('IdToRemove : ', IdToRemove); + array_of_Id = []; + + var title_id = localStorage.getItem('JSON_FOR_EMPTY_QUESTION'); +// console.log(title_id) + + var count = ""; + if(title_id !== null && title_id !== '') + { + var parsedArray = JSON.parse(title_id); + var count = parsedArray.length; + } + else + { + count = 0 + } + + + + + const input_text_value = document.getElementById(IdToRemove); + const attrId = input_text_value.querySelector('.ql-editor')?.innerHTML; + var parsedArray = []; + if (count !== 0) { + + parsedArray = JSON.parse(title_id); + + for (let i = 0; i < parsedArray.length; i++) { + const Id = parsedArray[i]; + const element = document.getElementById(Id); + + if (element) { + const attrId = element.querySelector('.ql-editor')?.innerHTML; + + if (Id === IdToRemove) { + if (attrId !== '


' && attrId !== "") { + parsedArray.splice(i, 1); + i--; + } + + } + else{ + var newArray = parsedArray.push(IdToRemove); + const newArrayString = JSON.stringify(newArray); + collect_Empty_Question_Id(newArrayString); + } + } + } + const newArrayString = JSON.stringify(parsedArray); + collect_Empty_Question_Id(newArrayString); + + } else if(attrId == '


') { + + var newArray = parsedArray.push(IdToRemove); + const newArrayString = JSON.stringify(parsedArray); + collect_Empty_Question_Id(newArrayString); + } +} + @@ -2690,35 +3037,35 @@ function ReArrangeQuestions(e){ function ReArrangeQuestionsGroup(e){ var currentID= e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.id; - console.log(currentID) + // console.log(currentID) var currentItemID = document.getElementById(currentID); - console.log('currentItemID'); - console.log(currentItemID); + // console.log('currentItemID'); + // console.log(currentItemID); if (e.target.classList.contains('up-icon')) { - console.log('FORWORD'); + // console.log('FORWORD'); const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; - console.log('question_ListItem'); - console.log(question_ListItem); + // console.log('question_ListItem'); + // console.log(question_ListItem); const question_PrevItem = question_ListItem.previousElementSibling; - console.log('question_PrevItem'); - console.log(question_PrevItem ); + // console.log('question_PrevItem'); + // console.log(question_PrevItem ); if (question_PrevItem !== null) { currentItemID.insertBefore(question_ListItem, question_PrevItem); } } else if (e.target.classList.contains('down-icon')) { - console.log('BACKWORD'); + // console.log('BACKWORD'); const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; - console.log('question_ListItem'); - console.log(question_ListItem); + // console.log('question_ListItem'); + // console.log(question_ListItem); const question_nextItem = question_ListItem.nextElementSibling; - console.log('question_nextItem'); - console.log(question_nextItem ); + // console.log('question_nextItem'); + // console.log(question_nextItem ); if (question_nextItem) { currentItemID.insertBefore(question_nextItem, question_ListItem); @@ -2777,9 +3124,7 @@ function addNewQuestions(e, type) function addNewGroupQuestions(e, type) { - console.log('type : ',type) clone_id_time = e.target.id; - console.log(clone_id_time) var clone_id = clone_id_time.split("_")[1]; var group_question_area_id = 'group_question_area_'+clone_id; @@ -2805,7 +3150,7 @@ function ConstructAddNewChoiceID(e){ var addChoiceAreaTime = addChoiceArea.split("_")[1]; var addChoiceAreaId = 'addChoiceArea_'+addChoiceAreaTime; var addChoiceAreaId2 = document.getElementById(addChoiceAreaId); - addNewChoice(addChoiceAreaId2) + addNewChoice(addChoiceAreaId2, 1) } @@ -2844,6 +3189,78 @@ function removeClonedQroupQuestion(index) } } +// remove the section +function removeSection(RandomId, IndexValue) { + + var element = document.getElementById('reorder_'+ RandomId); + + var jsonData = JSON.parse(localStorage.getItem('JSON_FOR_NAV')); + var count = jsonData.sections.length; + console.log(`Count of sections: ${count}`); + + if(count > 1) + { + Swal.fire({ + title: 'Are you sure to Delete this Section?', + text: "You won't be able to revert this!", + icon: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, delete it!' + }).then((result) => { + if (result.isConfirmed) { + if (element) { + element.remove(); + + json2nav(); + clearSidebarWrapper(); + navpane(); + } + } + }) + + } + else{ + + Swal.fire( + 'Cannot Delete!', + 'Atleast one Section should Remain', + 'warning' + ); + } + +} + +// remove the Question Group type questions function +function removeQuestionGroup(index) { + + var element = document.getElementById('draggedGroup_'+ index); + Swal.fire({ + title: 'Are you sure to Delete this Question Group?', + text: "You won't be able to revert this!", + icon: 'warning', + showCancelButton: true, + confirmButtonColor: '#3085d6', + cancelButtonColor: '#d33', + confirmButtonText: 'Yes, delete it!' + }).then((result) => { + if (result.isConfirmed) { + if (element) { + element.remove(); + } + } + }) +} + +function removeHtmlTags(inputString) { + +const $ = cheerio.load(inputString); +const text = $.text(); + +return text; +} + @@ -2863,14 +3280,14 @@ function removeClonedQroupQuestion(index) const questionElement = dragHandle.closest('.question'); if (questionElement) { - console.log("draggHandle:",dragHandle); + // console.log("draggHandle:",dragHandle); // Initiate the drag operation for the .question draggedItemQuestion = questionElement; // Add a dragStart event listener to set data draggedItemQuestion.addEventListener('dragstart', function (e) { e.dataTransfer.setData('text/plain', draggedItemQuestion.id); - console.log(draggedItemQuestion.id); + // console.log(draggedItemQuestion.id); }); @@ -3043,7 +3460,7 @@ function removeClonedQroupQuestion(index) const reorderpop = document.getElementById('output'); const addsection= document.querySelector('#addNewSection'); // Replace with your actual right list ID - console.log("addsection:",addsection); + // console.log("addsection:",addsection); // Function to add a section name to the left side function addSectionName(section) { @@ -3051,13 +3468,13 @@ function removeClonedQroupQuestion(index) // // Remove

and

tags from the HTML content v = v.replace(/

|<\/p>/g, ''); - console.log("v",v); + // console.log("v",v); if (v === '
') { // If the innerHTML is empty, add sample text v = 'untitled' // console.log("v",v); } - console.log("v",v); + // console.log("v",v); const reorderpop_item = document.createElement('li'); // Set the inner HTML of the list item to the section title reorderpop_item.innerHTML = v; @@ -3090,45 +3507,45 @@ function removeClonedQroupQuestion(index) reorderpop.addEventListener('click', (e) => { if (e.target.classList.contains('up-icon')) { - console.log("up"); + // console.log("up"); const reorderpop_item = e.target.parentElement.parentElement; const prevItem = reorderpop_item.previousElementSibling; - console.log("reorderpop_item:",reorderpop_item); - console.log("prevItem:",prevItem); + // console.log("reorderpop_item:",reorderpop_item); + // console.log("prevItem:",prevItem); if (prevItem) { reorderpop.insertBefore(reorderpop_item, prevItem); // Remove the "reorder_" prefix from the ID const originalId = reorderpop_item.id; - console.log("originalId",originalId); + // console.log("originalId",originalId); const idWithoutPrefix = originalId.replace("reorder_section_title_text_", ""); - console.log("idWithoutPrefix",idWithoutPrefix); + // console.log("idWithoutPrefix",idWithoutPrefix); // Get the corresponding element in the right list const item_to_be_reorderd = document.getElementById('reorder_' +idWithoutPrefix); - console.log("item_to_be_reorderd",item_to_be_reorderd); + // console.log("item_to_be_reorderd",item_to_be_reorderd); // Find the previous element in the right list to determine where to insert const prevItemInRightSide = item_to_be_reorderd.previousElementSibling; - console.log("prevItemInRightSide",prevItemInRightSide); + // console.log("prevItemInRightSide",prevItemInRightSide); // Move the element to the right list addsection.insertBefore(item_to_be_reorderd, prevItemInRightSide); } } else if (e.target.classList.contains('down-icon')) { - console.log("down"); + // console.log("down"); const reorderpop_item = e.target.parentElement.parentElement; const nextItem = reorderpop_item.nextElementSibling; - console.log("reorderpop_item:",reorderpop_item); - console.log("nextItem:",nextItem); + // console.log("reorderpop_item:",reorderpop_item); + // console.log("nextItem:",nextItem); if (nextItem) { reorderpop.insertBefore(nextItem, reorderpop_item); // Add code to update the corresponding element in the right list if needed const originalId = reorderpop_item.id; - console.log("originalId",originalId); + // console.log("originalId",originalId); const idWithoutPrefix = originalId.replace("reorder_section_title_text_", ""); - console.log("idWithoutPrefix",idWithoutPrefix); + // console.log("idWithoutPrefix",idWithoutPrefix); const item_to_be_reorderd = document.getElementById('reorder_' + idWithoutPrefix); - console.log("item_to_be_reorderd",item_to_be_reorderd); + // console.log("item_to_be_reorderd",item_to_be_reorderd); const nextItemInRightSide = item_to_be_reorderd.nextElementSibling; - console.log("nextItemInRightSide",nextItemInRightSide); + // console.log("nextItemInRightSide",nextItemInRightSide); addsection.insertBefore(nextItemInRightSide,item_to_be_reorderd); } diff --git a/addform_old.html b/addform_old.html index a9f2aaa..d32782b 100644 --- a/addform_old.html +++ b/addform_old.html @@ -361,18 +361,6 @@

- -
-
- -
-
-
diff --git a/assets/images/Group.svg b/assets/images/Group.svg new file mode 100644 index 0000000..910ef9e --- /dev/null +++ b/assets/images/Group.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/bg1-1.png b/assets/images/bg1-1.png index 7275425..8dd824c 100644 Binary files a/assets/images/bg1-1.png and b/assets/images/bg1-1.png differ diff --git a/assets/images/bg1.png b/assets/images/bg1.png new file mode 100644 index 0000000..7275425 Binary files /dev/null and b/assets/images/bg1.png differ diff --git a/assets/images/choice.svg b/assets/images/choice.svg new file mode 100644 index 0000000..67c4df3 --- /dev/null +++ b/assets/images/choice.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/download.svg b/assets/images/download.svg new file mode 100644 index 0000000..b98a32d --- /dev/null +++ b/assets/images/download.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/download2.png b/assets/images/download2.png new file mode 100644 index 0000000..650783d Binary files /dev/null and b/assets/images/download2.png differ diff --git a/assets/images/edit.svg b/assets/images/edit.svg new file mode 100644 index 0000000..2d71c3c --- /dev/null +++ b/assets/images/edit.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/edit2.png b/assets/images/edit2.png new file mode 100644 index 0000000..2b53cb3 Binary files /dev/null and b/assets/images/edit2.png differ diff --git a/assets/images/edit3.svg b/assets/images/edit3.svg new file mode 100644 index 0000000..b1973e7 --- /dev/null +++ b/assets/images/edit3.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/file-1.png b/assets/images/file-1.png new file mode 100644 index 0000000..36d09ea Binary files /dev/null and b/assets/images/file-1.png differ diff --git a/assets/images/file-2.svg b/assets/images/file-2.svg new file mode 100644 index 0000000..7c9b4b3 --- /dev/null +++ b/assets/images/file-2.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/home.svg b/assets/images/home.svg new file mode 100644 index 0000000..c9556a9 --- /dev/null +++ b/assets/images/home.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/images/line.svg b/assets/images/line.svg new file mode 100644 index 0000000..9c182dd --- /dev/null +++ b/assets/images/line.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/line2.svg b/assets/images/line2.svg new file mode 100644 index 0000000..e8a8755 --- /dev/null +++ b/assets/images/line2.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/navchoice.svg b/assets/images/navchoice.svg new file mode 100644 index 0000000..70d7b27 --- /dev/null +++ b/assets/images/navchoice.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/navtext.svg b/assets/images/navtext.svg new file mode 100644 index 0000000..c1fa2ef --- /dev/null +++ b/assets/images/navtext.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/new.svg b/assets/images/new.svg new file mode 100644 index 0000000..75062e1 --- /dev/null +++ b/assets/images/new.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/images/open.svg b/assets/images/open.svg new file mode 100644 index 0000000..ed066d0 --- /dev/null +++ b/assets/images/open.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/preview.svg b/assets/images/preview.svg new file mode 100644 index 0000000..f7be146 --- /dev/null +++ b/assets/images/preview.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/project-b-logo.png b/assets/images/project-b-logo.png new file mode 100644 index 0000000..0bd3ef8 Binary files /dev/null and b/assets/images/project-b-logo.png differ diff --git a/assets/images/save.svg b/assets/images/save.svg new file mode 100644 index 0000000..b781d76 --- /dev/null +++ b/assets/images/save.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/images/section.svg b/assets/images/section.svg new file mode 100644 index 0000000..67ddd61 --- /dev/null +++ b/assets/images/section.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/images/text.svg b/assets/images/text.svg new file mode 100644 index 0000000..9fc80ad --- /dev/null +++ b/assets/images/text.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/images/view.svg b/assets/images/view.svg new file mode 100644 index 0000000..029c360 --- /dev/null +++ b/assets/images/view.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/images/view2.png b/assets/images/view2.png new file mode 100644 index 0000000..7b79962 Binary files /dev/null and b/assets/images/view2.png differ diff --git a/checkParent.js b/checkParent.js index 498719e..c8e61ba 100644 --- a/checkParent.js +++ b/checkParent.js @@ -1,17 +1,37 @@ function findParent(jsonData, targetId) { - function findParentChild(data, id, parentClasses, idKey) { + function findParentChild(data, id, parentClasses, idKey,qid) { for (let i = 0; i < data.length; i++) { const section = data[i]; + + // console.log(section); + if (section[idKey] === id) { parentClasses.push(i); // const childClassCount = (section.questions && section.questions.length > 0) ? section.questions.length : 0; - return parentClasses.length - 1 + // return parentClasses.length - 1, section.group_title + + + return { + value1: parentClasses.length - 1, + value2: section.group_title, + }; + } else if (section.questions) { + + // console.log(section.questions); + var a= section.questions + var qid = ''; + a.forEach(element => { + qid = element.question_Id + }); + // console.log(a.question_Id); + const newParentClasses = parentClasses.slice(); // Create a shallow copy of parentClasses array newParentClasses.push(i); - const childClass = findParentChild(section.questions, id, newParentClasses, idKey); + const childClass = findParentChild(section.questions, id, newParentClasses, idKey,qid); if (childClass) { + // console.log(childClass); return childClass; // If childClass is found, return it } } diff --git a/dashboard.html b/dashboard.html index ba02188..41ac827 100644 --- a/dashboard.html +++ b/dashboard.html @@ -48,86 +48,156 @@ - +.heder-menu ul li a { + font-weight: 400 !important; + color: #1d3557 !important; +} +.heder-menu ul li a:hover { + filter: invert(23%) sepia(67%) saturate(2476%) hue-rotate(335deg) brightness(89%) contrast(89%); +} + +.resent-post-single-box { + border-bottom: 1px solid #E8E8E8 !important; + padding-top: 10px !important; +} + +.landing-icons a { + margin-right: 25px; +} + +/* .icons i { + background-color: transparent; + border: none; + border-radius: 50%; + width: 80px; + height: 80px; + padding: 10px; +} + +.icons i:hover { + box-shadow: 0 0 10px rgba(0, 0, 0, 0); + background-color: #e4d3f8b4; +} */ + +.icons img:hover{ + + filter: invert(3%) sepia(5%) saturate(5916%) hue-rotate(172deg) brightness(103%) contrast(98%); +} + + @@ -142,94 +212,56 @@ -
-
-
-
- -
-
-
-
-
- -
-
- -
-
- - - - - - -
Recent
-
-
- -
-
-
-
-
+
+
-
+

Question Papers

+ +
+
+
+
+
+
+
+
+
+ +