From b3b83c0eee962dfe3881ce95034088e70ec41b8c Mon Sep 17 00:00:00 2001 From: Sharath Date: Fri, 20 Oct 2023 15:00:31 +0530 Subject: [PATCH] SECTION MOVE & DRAG AND DROP QN -SV --- addform.html | 440 +++++++++++++++++++++++++++++++++++++++++++-------- savexml.js | 22 ++- 2 files changed, 385 insertions(+), 77 deletions(-) diff --git a/addform.html b/addform.html index 093dc3e..60703d6 100644 --- a/addform.html +++ b/addform.html @@ -342,6 +342,90 @@ + + @@ -409,6 +493,8 @@
+ + @@ -499,6 +585,21 @@
+ + +
+ +
@@ -574,6 +675,9 @@ @@ -2729,6 +2907,128 @@ function removeClonedQroupQuestion(index) } } + + diff --git a/savexml.js b/savexml.js index 36b8934..8c006e7 100644 --- a/savexml.js +++ b/savexml.js @@ -8,7 +8,7 @@ require('dotenv').config(); //Get the value from .env const isEncrypted = process.env.ENCRYPTED; -function saveXmlToFile(xmlData, filePath) { +function saveXmlToFile(xmlData, filePath,reorder=false) { console.log(filePath); // Check if the file path is provided if (!filePath) { @@ -31,13 +31,16 @@ function saveXmlToFile(xmlData, filePath) { } }); localStorage.clear(); - -// window.location.href = 'dashboard.html'; - +if(reorder){ + window.location.reload(); +}else{ + window.location.href = 'dashboard.html'; +} + } -function savexml(UserFilename) { +function savexml(UserFilename,reorder=false) { // Get the XML string from localStorage var xmlString = localStorage.getItem("xml"); @@ -67,8 +70,13 @@ function savexml(UserFilename) { const xmlfilePath = `${xmlPath}` + xmlfilename; // const jsonfilePath = process.cwd() + '/xml/' + jsonfilename; - // Call the function to save the XML file - saveXmlToFile(enc, xmlfilePath); + if(reorder){ + saveXmlToFile(enc, xmlfilePath,reorder=true); + }else{ + // Call the function to save the XML file + saveXmlToFile(enc, xmlfilePath); + } + }