diff --git a/addform.html b/addform.html index 093dc3e..3344bbe 100644 --- a/addform.html +++ b/addform.html @@ -411,7 +411,6 @@
-
@@ -809,6 +808,7 @@ navpane(); html2json(); +// function for ONMOUSE HOVER to SHOW the side ADD BUTTONS function showButtons(container) { const buttons = container.querySelector('.buttons'); const onhover = container.querySelector('.onhover'); @@ -820,6 +820,7 @@ function showButtons(container) { } +// function for ONMOUSE HOVER to HIDE the side ADD BUTTONS function hideButtons(container) { const buttons = container.querySelector('.buttons'); const onhover = container.querySelector('.onhover'); @@ -1188,12 +1189,15 @@ function addQuestionGroup(idObj)
-
- +
-
+
+    +     +
+
@@ -1210,21 +1214,20 @@ function addQuestionGroup(idObj)
-
- +
- +
${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}
- +
${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_description : ""}
@@ -1451,7 +1454,6 @@ const value = localStorage.getItem('JSON_FOR_NAV') // 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) { - const ChoiceGroupFixed_UUID = uuidv4(); var groupQuestion = ""; @@ -1501,8 +1503,9 @@ function groupQuestion(question_id = false, section_id = false , group_question_
@@ -1574,7 +1577,6 @@ function groupQuestion(question_id = false, section_id = false , group_question_ ${Choice ? Choice[0].choice_name : ""}
-       MATH
@@ -1953,8 +1955,8 @@ function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionR ${choiceName ? choiceName : ""}
-     -   MATH +   MATH    +
` @@ -2157,8 +2159,9 @@ textQuestion +=
@@ -2419,6 +2422,86 @@ var inputElement = document.getElementById(Textid); } +//function for Questions REORDER in the SECTION Level +function ReArrangeQuestions(e){ + + var currentID= e.target.parentElement.parentElement.parentElement.id; + console.log(currentID) + var currentItemID = document.getElementById(currentID); + console.log('currentItemID'); + console.log(currentItemID); + + if (e.target.classList.contains('up-icon')) { + + console.log('FORWORD'); + const question_ListItem = e.target.parentElement.parentElement; + console.log('question_ListItem'); + console.log(question_ListItem); + + const question_PrevItem = question_ListItem.previousElementSibling; + 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'); + const question_ListItem = e.target.parentElement.parentElement; + console.log('question_ListItem'); + console.log(question_ListItem); + + const question_nextItem = question_ListItem.nextElementSibling; + console.log('question_nextItem'); + console.log(question_nextItem ); + + if (question_nextItem) { + currentItemID.insertBefore(question_nextItem, question_ListItem); + } + } +} + +//function for REORDER the Question Group in the SECTION Level +function ReArrangeQuestionsGroup(e){ + + var currentID= e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.id; + console.log(currentID) + var currentItemID = document.getElementById(currentID); + console.log('currentItemID'); + console.log(currentItemID); + + if (e.target.classList.contains('up-icon')) { + + console.log('FORWORD'); + const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; + console.log('question_ListItem'); + console.log(question_ListItem); + + const question_PrevItem = question_ListItem.previousElementSibling; + 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'); + const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement; + console.log('question_ListItem'); + console.log(question_ListItem); + + const question_nextItem = question_ListItem.nextElementSibling; + console.log('question_nextItem'); + console.log(question_nextItem ); + + if (question_nextItem) { + currentItemID.insertBefore(question_nextItem, question_ListItem); + } + } +} + //Function for Add Group Question inside the Group QUestion Like Question function MultiLevelQuestionGroup(e) { @@ -2508,6 +2591,7 @@ function cloneQuestion(e,type) // remove the cloned text type questions function function removeClonedTextQuestion(index) { + alert('hi text'); var element = document.getElementById('removeAndCloneTextQuestion_'+ index); if (element) { element.remove(); @@ -2517,6 +2601,8 @@ function removeClonedTextQuestion(index) // remove the cloned choice or group type questions function function removeClonedQroupQuestion(index) { + alert('hi choice'); + var element = document.getElementById('removeAndCloneQroupQuestion_'+ index); if (element) { element.remove(); diff --git a/assets/css/theme-default.css b/assets/css/theme-default.css index 32d0dde..b8dd5fb 100644 --- a/assets/css/theme-default.css +++ b/assets/css/theme-default.css @@ -22,7 +22,7 @@ body { p { - font-weight: 500;/* Change this into 400 aadhavan */ + font-weight: 400;/* Change this into 400 aadhavan */ font-style: normal; font-family: 'Rubik', sans-serif; color: #6d6d6d; diff --git a/mark_calc.js b/mark_calc.js index 002d27c..c0ef262 100644 --- a/mark_calc.js +++ b/mark_calc.js @@ -95,7 +95,10 @@ function generateSingleQuestions(ParentObjects) var parentMarks = ParentObjects.parentMarks; var parentAttemptAny = ParentObjects.parentAttemptAny; - var MarkDivideValue = parentMarks / parentAttemptAny; + var DivideValue = parentMarks / parentAttemptAny; + const twoDigitsAfterDecimal = DivideValue.toFixed(2); + var MarkDivideValue = parseFloat(twoDigitsAfterDecimal); + // console.log(MarkDivideValue) // console.log('parentMarks : ', parentMarks); // console.log('new_parentAttemptAny : ', parentAttemptAny); diff --git a/nav_pane.js b/nav_pane.js index d57d05b..8c6cfd2 100644 --- a/nav_pane.js +++ b/nav_pane.js @@ -6,7 +6,7 @@ function navpane() { let currentlyHighlightedElement = null; // Track the currently highlighted element // console.log('navpane called'); var jsonData = JSON.parse(localStorage.getItem('JSON_FOR_NAV')); - console.log(jsonData); + // console.log(jsonData); // var arr = JSON.parse( localStorage.getItem('memoriesdata') ); // var jsonData2 = JSON.parse(jsonData); // console.log(typeof jsonData); @@ -38,7 +38,7 @@ function navpane() { var splitedSectionId = sectionId.split("_")[3]; var SectionBox_RawID = 'SectionBox_'+splitedSectionId; var SectionBoxID = document.getElementById(SectionBox_RawID) - console.log(SectionBoxID); + // console.log(SectionBoxID); // Check if the section should be initially expanded based on expandedSections @@ -146,7 +146,7 @@ function navpane() { // nodeDiv.id = nodeData.textQuestion_Id || nodeData.choice_question_id; const nodeDataId = nodeData.question_Id const nodeDataType = nodeData.question_type - console.log('nodeDataType:',nodeDataType); + // console.log('nodeDataType:',nodeDataType); @@ -189,7 +189,7 @@ function navpane() { } var QuestionID = document.getElementById(RawID) - console.log(QuestionID) + // console.log(QuestionID) const questionLink = document.createElement('a'); questionLink.href = '#' + nodeDataId; @@ -219,6 +219,7 @@ function navpane() { questionLink.style.fontWeight = questionLink.style.fontWeight === 'bold' ? 'normal' : 'bold'; } else { questionLink.style.fontWeight = 'bold'; + QuestionID.style.fontWeight = 'normal'; currentlyHighlightedElement = questionLink; } }); @@ -248,12 +249,12 @@ function navpane() { groupTitleDiv.setAttribute('data-id', groupTitleId); groupTitleDiv.className = 'question-group'; - console.log(groupTitleId); + // console.log(groupTitleId); var splitedGroupId = groupTitleId.split("_")[3]; var SplitedGroupRawID = 'QuestionGroupButtons_'+splitedGroupId; var GroupBoxID = document.getElementById(SplitedGroupRawID); - console.log(GroupBoxID); + // console.log(GroupBoxID); // Check if the group should be initially expanded based on expandedSections @@ -332,6 +333,7 @@ function navpane() { groupQuestionLink.style.fontWeight = groupQuestionLink.style.fontWeight === 'bold' ? 'normal' : 'bold'; } else { groupQuestionLink.style.fontWeight = 'bold'; + GroupBoxID.style.fontWeight = 'normal'; currentlyHighlightedElement = groupQuestionLink; } }); diff --git a/savexml.js b/savexml.js index 36b8934..620c3da 100644 --- a/savexml.js +++ b/savexml.js @@ -32,7 +32,7 @@ function saveXmlToFile(xmlData, filePath) { }); localStorage.clear(); -// window.location.href = 'dashboard.html'; + window.location.href = 'dashboard.html'; } diff --git a/style.css b/style.css index ae3d022..0ecc7ec 100644 --- a/style.css +++ b/style.css @@ -3557,10 +3557,13 @@ input:disabled { .math{ font-weight: 500; + font-size: 14px; } .mathQuestions{ font-weight: 500; float: right; + font-size: 14px; + }