SOLVED CONFLICT-SV
This commit is contained in:
commit
f3a5bf6440
@ -72,9 +72,13 @@ function CheakQnType(question, questionIndex, depth,nested) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
let count =0
|
var count =0
|
||||||
var count1 =0
|
var count1 =0
|
||||||
|
var romanNumerals = ["", "i", "ii", "iii", "iv", "v", "vi", "vii", "viii", "ix", "x"];
|
||||||
function processQuestion(question, questionIndex, depth,nested) {
|
function processQuestion(question, questionIndex, depth,nested) {
|
||||||
|
// console.log('question Data')
|
||||||
|
// console.log(question);
|
||||||
|
|
||||||
const questionTex = question.question;
|
const questionTex = question.question;
|
||||||
const questionText = questionTex.replace('<p>', '<p id="question_Text">');
|
const questionText = questionTex.replace('<p>', '<p id="question_Text">');
|
||||||
const questionDescription = question.question_description;
|
const questionDescription = question.question_description;
|
||||||
@ -83,15 +87,23 @@ function processQuestion(question, questionIndex, depth,nested) {
|
|||||||
const multipleAnswer =question.question_sub_type; // this gives true or false to chaeck multiple answers or not
|
const multipleAnswer =question.question_sub_type; // this gives true or false to chaeck multiple answers or not
|
||||||
// Add appropriate indentation for nested questions
|
// Add appropriate indentation for nested questions
|
||||||
const questionIndentation = " ".repeat(depth + 1);
|
const questionIndentation = " ".repeat(depth + 1);
|
||||||
|
console.log(questionIndentation)
|
||||||
if (nested == 1) {// this adds the inside the questionGroup
|
if (nested == 1) {// this adds the inside the questionGroup
|
||||||
count1++
|
count1++;
|
||||||
questionPaper += `<div class="text-qus-align">${questionIndentation}${count}.${count1}) ${convertToLatex(questionText, mathstatus)}${questionIndentation}</div><p id="question-mark">Marks :${questionMark}</p><div class="text-des">${convertToLatex(questionDescription, mathstatus)}</div>`;
|
var romanNumeral=romanNumerals[count1];
|
||||||
|
questionPaper += `<div class="text-qus-choice">${questionIndentation}${romanNumeral}) ${convertToLatex(questionText, mathstatus)}${questionIndentation}</div><p id="question-mark">Marks :${questionMark}</p><div class="text-des">${convertToLatex(questionDescription, mathstatus)}</div>`;
|
||||||
} else {
|
} else {
|
||||||
count++
|
count++
|
||||||
questionPaper += `<div class="text-qus-align">${questionIndentation}${count}) ${convertToLatex(questionText, mathstatus)}${questionIndentation}</div><p id="question-mark">Marks :${questionMark}</p><div class="text-des">${convertToLatex(questionDescription, mathstatus)}</div>`;
|
questionPaper += `<div class="text-qus-align">${questionIndentation}${count}) ${convertToLatex(questionText, mathstatus)}${questionIndentation}</div><p id="question-mark">Marks :${questionMark}</p><div class="text-des">${convertToLatex(questionDescription, mathstatus)}</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(questionPaper);
|
||||||
|
|
||||||
|
|
||||||
// If it's an MCQ question, add choices
|
// If it's an MCQ question, add choices
|
||||||
|
|
||||||
|
// If it's an MCquestionText
|
||||||
|
|
||||||
if (question.question_type === "group") {
|
if (question.question_type === "group") {
|
||||||
const answers = question.answers;
|
const answers = question.answers;
|
||||||
const alphabetOptions = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; // Define the alphabet options
|
const alphabetOptions = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; // Define the alphabet options
|
||||||
@ -138,7 +150,7 @@ function GroupQuestion(question, questionIndex, depth) {
|
|||||||
// Function to recursively convert JSON to a formatted question paper
|
// Function to recursively convert JSON to a formatted question paper
|
||||||
function convertJSONToQuestionPaper(data, depth = 0, sectionIndex = 1, questionIndex = 1) {
|
function convertJSONToQuestionPaper(data, depth = 0, sectionIndex = 1, questionIndex = 1) {
|
||||||
const sections = data.sections;
|
const sections = data.sections;
|
||||||
console.log(sections);
|
// console.log(sections);
|
||||||
// Extract the heading information
|
// Extract the heading information
|
||||||
const questionPaperTitle = data.question_paper_title;
|
const questionPaperTitle = data.question_paper_title;
|
||||||
const questionPaperDescription = data.question_paper_description;
|
const questionPaperDescription = data.question_paper_description;
|
||||||
@ -164,7 +176,7 @@ function convertJSONToQuestionPaper(data, depth = 0, sectionIndex = 1, questionI
|
|||||||
const indentation = " ".repeat(depth);
|
const indentation = " ".repeat(depth);
|
||||||
|
|
||||||
// questionPaper += `${indentation}${sectionTitle}${sectionAttempt}${sectionMark}${indentation}${sectionDescription}`;
|
// questionPaper += `${indentation}${sectionTitle}${sectionAttempt}${sectionMark}${indentation}${sectionDescription}`;
|
||||||
questionPaper += `${indentation}${modifiedSectionTitle}${sectionMark}${sectionAttempt}${indentation}${sectionDescription}`;
|
questionPaper += `${indentation}<hr id="horizontal">${modifiedSectionTitle}${sectionMark}${sectionAttempt}${indentation}${sectionDescription}`;
|
||||||
|
|
||||||
|
|
||||||
// Process each question in the section
|
// Process each question in the section
|
||||||
@ -183,6 +195,6 @@ function convertJSONToQuestionPaper(data, depth = 0, sectionIndex = 1, questionI
|
|||||||
// Call the function and display the formatted question paper
|
// Call the function and display the formatted question paper
|
||||||
const formattedQuestionPaper = convertJSONToQuestionPaper(jsonData, 0, 1, 1);
|
const formattedQuestionPaper = convertJSONToQuestionPaper(jsonData, 0, 1, 1);
|
||||||
const questionPaperElement = document.getElementById("questionPaper");
|
const questionPaperElement = document.getElementById("questionPaper");
|
||||||
|
console.log(questionPaperElement);
|
||||||
questionPaperElement.innerHTML = formattedQuestionPaper; // Use innerHTML here
|
questionPaperElement.innerHTML = formattedQuestionPaper; // Use innerHTML here
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -49,18 +49,33 @@
|
|||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
hr{
|
||||||
|
height: 2px;
|
||||||
|
}
|
||||||
|
#horizontal:first-of-type{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
p{
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
/* Question Group Mark */
|
/* Question Group Mark */
|
||||||
.text-qus-align{
|
/* .text-qus-align{
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
} */
|
||||||
.group_attempt_any{
|
.group_attempt_any{
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: 40px;
|
margin-right: 115px;
|
||||||
|
margin-top:-35px;
|
||||||
}
|
}
|
||||||
.group_marks{
|
.group_marks{
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-top:-35px;
|
||||||
|
margin-right: 4px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,6 +88,7 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-top:-25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section SectionAttempt SectionMark */
|
/* Section SectionAttempt SectionMark */
|
||||||
@ -84,11 +100,13 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
float: right;
|
float: right;
|
||||||
|
/* margin-top:-27px; */
|
||||||
}
|
}
|
||||||
#sectionMark{
|
#sectionMark{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
float: right;
|
float: right;
|
||||||
|
/* margin-top:-27px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* End the this */
|
/* End the this */
|
||||||
@ -105,13 +123,14 @@
|
|||||||
.MathJax.CtxtMenu_Attached_0{
|
.MathJax.CtxtMenu_Attached_0{
|
||||||
display: contents !important;
|
display: contents !important;
|
||||||
}
|
}
|
||||||
.text-qus-align{margin-left: -16px;padding-right: 250px; }
|
.text-qus-align{margin-left: -16px;padding-right: 250px;display:flex; }
|
||||||
.text-qus-align p{ margin:0; }
|
.text-qus-align p{ margin:0; }
|
||||||
.text-des{ margin-left: 20px;margin-top: 0px;} /* Change there aadhavan top-6px*/
|
.text-des{ margin-left: 20px;margin-top: 0px;} /* Change there aadhavan top-6px*/
|
||||||
.text-option-align{display:flex;margin-top: 0%;margin-left: 45px;} /* Change there aadhavan 10px*/
|
.text-option-align{display:flex;margin-top: 0%;margin-left: 45px;} /* Change there aadhavan 10px*/
|
||||||
.text-option-align p{ margin:0; }
|
.text-option-align p{ margin:0; }
|
||||||
#sectionTitle {border-top: 2px solid gray; width: 100%;}
|
/* #sectionTitle {border-top: 2px solid gray
|
||||||
#sectionTitle:first-of-type {border:none;}
|
; width:99%;} */
|
||||||
|
/* #sectionTitle:first-of-type {border:none;} */
|
||||||
mjx-container[jax="CHTML"][display="true"] {
|
mjx-container[jax="CHTML"][display="true"] {
|
||||||
display: block;
|
display: block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -292,7 +311,7 @@
|
|||||||
//XmlPath get from .env
|
//XmlPath get from .env
|
||||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
const xmlPath =path.join(__dirname,xmlPathenv);
|
const xmlPath =path.join(__dirname,xmlPathenv);
|
||||||
console.log(xmlFileName)
|
// console.log(xmlFileName)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.readFile(`${xmlPath}`+xmlFileName, 'utf8', (error, data) => {
|
fs.readFile(`${xmlPath}`+xmlFileName, 'utf8', (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -311,6 +330,9 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log()
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
313
addform.html
313
addform.html
@ -48,6 +48,14 @@
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
#editPreview{
|
||||||
|
color: #7018d4;
|
||||||
|
}
|
||||||
|
#editPreview:hover {
|
||||||
|
color:#3399FF;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ul, #myUL {
|
ul, #myUL {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
@ -384,10 +392,14 @@
|
|||||||
.popup-save{
|
.popup-save{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.popup-save button{
|
.popup-save button{
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border-color:#eee;
|
border-color:#eee;
|
||||||
|
margin-right: 0px;
|
||||||
|
margin-top: 16px;
|
||||||
}
|
}
|
||||||
.popupbox q{
|
.popupbox q{
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -457,7 +469,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="dashboard.html"><i class="fa fa-home" aria-hidden="true" style="font-size: 24px;"></i> Home</a></li>
|
<li><a href="dashboard.html"><i class="fa fa-home" aria-hidden="true" style="font-size: 24px;"></i> Home</a></li>
|
||||||
<li><a href="#" class="myBtn" onclick="saveFile()" id="SaveButton"><i class="fa fa-floppy-o" aria-hidden="true" style="font-size: 20px;"></i> Save</a></li>
|
<li><a href="#" class="myBtn" onclick="saveFile()" id="SaveButton"><i class="fa fa-floppy-o" aria-hidden="true" style="font-size: 20px;"></i> Save</a></li>
|
||||||
<li><a id="editPreview" style="color: #730fd5;"><i class="fa fa-eye" aria-hidden="true" style="font-size: 24px;"></i> Preview</a></li>
|
<li><a id="editPreview" ><i class="fa fa-eye" aria-hidden="true" style="font-size: 24px;"></i> Preview</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -497,7 +509,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- QuestionPapper Title Start-->
|
<!-- QuestionPapper Title Start-->
|
||||||
|
|
||||||
<div class="question-papper-title element" style="border-top: solid; margin-bottom: 15px;">
|
<div class="question-papper-title element" style="border-top: solid; margin-bottom: 15px;">
|
||||||
<input type="hidden" id="QuestionPaper_UUID_ID">
|
<input type="hidden" id="QuestionPaper_UUID_ID">
|
||||||
<div class="col-lg-12 col-md-12">
|
<div class="col-lg-12 col-md-12">
|
||||||
@ -594,8 +605,8 @@
|
|||||||
<div style="margin-bottom: 9px;">Reorder sections</div>
|
<div style="margin-bottom: 9px;">Reorder sections</div>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="popup-save">
|
<div class="popup-save form-button">
|
||||||
<button onclick="saveFile()" id="closePopupButton">Save</button>
|
<button onclick="saveFile(flag=1)" id="closePopupButton">Save</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <button id="closePopupButton">Close</button> -->
|
<!-- <button id="closePopupButton">Close</button> -->
|
||||||
@ -708,8 +719,7 @@
|
|||||||
|
|
||||||
const url = new URL(window.location.href);// Get the URL of the current page for JSON
|
const url = new URL(window.location.href);// Get the URL of the current page for JSON
|
||||||
const params = new URLSearchParams(url.search);// Create a URLSearchParams object from the query string
|
const params = new URLSearchParams(url.search);// Create a URLSearchParams object from the query string
|
||||||
var FileName = params.get('filename');// Get the value of a specific parameter
|
var FileName = params.get('filename');// Get the value of a specific parameter
|
||||||
|
|
||||||
var xmlPath ="" //get the xml filepath in .env file local variable
|
var xmlPath ="" //get the xml filepath in .env file local variable
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@ -762,10 +772,28 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//EditPreview and Create Previe
|
//EditPreview and Create Preview
|
||||||
var previewbutton = document.getElementById("editPreview");
|
var previewbutton = document.getElementById("editPreview");
|
||||||
previewbutton.addEventListener("click", async () => {
|
previewbutton.addEventListener("click", async () => {
|
||||||
if (FileName) {
|
if (FileName) {
|
||||||
|
const saveButton = document.getElementById('SaveButton');
|
||||||
|
if (saveButton) {
|
||||||
|
saveButton.click();
|
||||||
|
setTimeout(function() {
|
||||||
|
var popupInput = document.getElementById("swal2-input");
|
||||||
|
var submitButton = document.querySelector(".swal2-confirm.swal2-styled");
|
||||||
|
submitButton.addEventListener("click", function() {
|
||||||
|
FileName = popupInput.value;
|
||||||
|
FileName += ".xml"
|
||||||
|
if(FileName){
|
||||||
|
var anchorElement = document.getElementById("editPreview");
|
||||||
|
if (anchorElement) {
|
||||||
|
anchorElement.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
previewbutton.href = "QuestionPreview.html?filename=" + FileName;
|
previewbutton.href = "QuestionPreview.html?filename=" + FileName;
|
||||||
} else {
|
} else {
|
||||||
const saveButton = document.getElementById('SaveButton');
|
const saveButton = document.getElementById('SaveButton');
|
||||||
@ -822,7 +850,7 @@ function loadXML(xmlFileName) {
|
|||||||
function saveFile(flag=0) {
|
function saveFile(flag=0) {
|
||||||
html2json();
|
html2json();
|
||||||
json2xml();
|
json2xml();
|
||||||
|
console.log("flag",flag);
|
||||||
if(FileName == "" || FileName == null ){
|
if(FileName == "" || FileName == null ){
|
||||||
setTimeout(promptBox, 1000);
|
setTimeout(promptBox, 1000);
|
||||||
|
|
||||||
@ -830,7 +858,7 @@ function saveFile(flag=0) {
|
|||||||
|
|
||||||
const newFileName = FileName.split(".")[0];
|
const newFileName = FileName.split(".")[0];
|
||||||
//if 1 it is used for re-order and redirect to the qn paper itself
|
//if 1 it is used for re-order and redirect to the qn paper itself
|
||||||
if (flag=1){
|
if (flag==1){
|
||||||
savexml(newFileName,reorder=true);
|
savexml(newFileName,reorder=true);
|
||||||
//if 0 it is used as nrml save which will redierect to dashboard
|
//if 0 it is used as nrml save which will redierect to dashboard
|
||||||
}else{
|
}else{
|
||||||
@ -918,6 +946,7 @@ navpane();
|
|||||||
html2json();
|
html2json();
|
||||||
|
|
||||||
|
|
||||||
|
// function for ONMOUSE HOVER to SHOW the side ADD BUTTONS
|
||||||
function showButtons(container) {
|
function showButtons(container) {
|
||||||
const buttons = container.querySelector('.buttons');
|
const buttons = container.querySelector('.buttons');
|
||||||
const onhover = container.querySelector('.onhover');
|
const onhover = container.querySelector('.onhover');
|
||||||
@ -929,6 +958,7 @@ function showButtons(container) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function for ONMOUSE HOVER to HIDE the side ADD BUTTONS
|
||||||
function hideButtons(container) {
|
function hideButtons(container) {
|
||||||
const buttons = container.querySelector('.buttons');
|
const buttons = container.querySelector('.buttons');
|
||||||
const onhover = container.querySelector('.onhover');
|
const onhover = container.querySelector('.onhover');
|
||||||
@ -981,8 +1011,8 @@ function addSection(title = false, description = false, random_no = false, secti
|
|||||||
<div class="items align-items-center hideondrag" style="display: block;">
|
<div class="items align-items-center hideondrag" style="display: block;">
|
||||||
<div class="dropdown " id="toggle-menu">
|
<div class="dropdown " id="toggle-menu">
|
||||||
<i class="fa fa-ellipsis-v" style="font-size:20px" aria-hidden="true"></i>
|
<i class="fa fa-ellipsis-v" style="font-size:20px" aria-hidden="true"></i>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content ">
|
||||||
<button id="popupid_${sectionRandomID}" class="showPopupButton">Move</button>
|
<button id="popupid_${sectionRandomID}" class="showPopupButton ">Move</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1026,7 +1056,7 @@ function addSection(title = false, description = false, random_no = false, secti
|
|||||||
<div class="col-lg-5 col-md-5 mt-2">
|
<div class="col-lg-5 col-md-5 mt-2">
|
||||||
<span>Display Marks</span>
|
<span>Display Marks</span>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input type="checkbox" id="Section_Display_Marks_Id_${sectionRandomID}" checked>
|
<input type="checkbox" id="Section_Display_Marks_Id_${sectionRandomID}">
|
||||||
<span class="slider round"></span>
|
<span class="slider round"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@ -1217,36 +1247,17 @@ function addSection(title = false, description = false, random_no = false, secti
|
|||||||
var DisplayMark_RawID = 'Section_Display_Marks_Id_' + sectionRandomID
|
var DisplayMark_RawID = 'Section_Display_Marks_Id_' + sectionRandomID
|
||||||
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
||||||
|
|
||||||
if(sectionDispalyMarks === 'true'){
|
if(sectionDispalyMarks === 'false'){
|
||||||
|
|
||||||
DisplayMark_ID.checked = true;
|
|
||||||
}else{
|
|
||||||
DisplayMark_ID.checked = false;
|
DisplayMark_ID.checked = false;
|
||||||
|
}else{
|
||||||
|
DisplayMark_ID.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//mark calculation code for section
|
|
||||||
// var Section_Attempt_Any_raw_Id = 'Section_Attempt_Any_Id_' + sectionRandomID;
|
|
||||||
var Section_Marks_raw_Id = 'Section_Marks_Id_' + sectionRandomID;
|
var Section_Marks_raw_Id = 'Section_Marks_Id_' + sectionRandomID;
|
||||||
|
|
||||||
|
|
||||||
$('#'+Section_Marks_raw_Id).prop("disabled", true);
|
$('#'+Section_Marks_raw_Id).prop("disabled", true);
|
||||||
|
|
||||||
// $('#'+Section_Attempt_Any_raw_Id).keyup(function() {
|
|
||||||
// var inputValue = $(this).val();
|
|
||||||
|
|
||||||
// if(inputValue == ""){
|
|
||||||
// $('#'+Section_Marks_raw_Id).prop("disabled", true);
|
|
||||||
// }else{
|
|
||||||
// $('#'+Section_Marks_raw_Id).prop("disabled", false);
|
|
||||||
|
|
||||||
// }
|
|
||||||
// json2nav();
|
|
||||||
// });
|
|
||||||
//end of mark calculation code for section
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// function for calling html2json script using Mark Calculation
|
// function for calling html2json script using Mark Calculation
|
||||||
var Section_Attempt_Any_raw_Id = 'Section_Attempt_Any_Id_' + sectionRandomID;
|
var Section_Attempt_Any_raw_Id = 'Section_Attempt_Any_Id_' + sectionRandomID;
|
||||||
@ -1317,12 +1328,15 @@ function addQuestionGroup(idObj)
|
|||||||
<i id="collapseSubSection_${QuestionGroup_ID}" aria-hidden="true" style=" font-size: 24px; margin-right: 9px; margin-top: 25px;"></i>
|
<i id="collapseSubSection_${QuestionGroup_ID}" aria-hidden="true" style=" font-size: 24px; margin-right: 9px; margin-top: 25px;"></i>
|
||||||
<input type="hidden" id="Question_Group_UUID_ID_${QuestionGroup_ID}" value="${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.attributes.Id : QuestionGroup_UUID}">
|
<input type="hidden" id="Question_Group_UUID_ID_${QuestionGroup_ID}" value="${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.attributes.Id : QuestionGroup_UUID}">
|
||||||
<div class="groupsection" draggable='true' id="group_question_${QuestionGroup_ID}">
|
<div class="groupsection" draggable='true' id="group_question_${QuestionGroup_ID}">
|
||||||
<div class="sectionTitle" id="group_question_title_${QuestionGroup_ID}">
|
<div class="sectionTitle" id="group_question_title_${QuestionGroup_ID}">
|
||||||
|
|
||||||
<div class="col-lg-12 col-md-12">
|
<div class="col-lg-12 col-md-12">
|
||||||
|
|
||||||
<div onmouseover="showButtons(this)" id="QuestionGroupButtons_${QuestionGroup_ID}" class="row question element" style="border-top: 10px solid #a658f3; border-radius:10px; margin-top:5px;">
|
<div onmouseover="showButtons(this)" id="QuestionGroupButtons_${QuestionGroup_ID}" class="row question element" style="border-top: 10px solid #a658f3; border-radius:10px; margin-top:5px;">
|
||||||
|
|
||||||
|
<div class="items align-items-center">
|
||||||
|
<span onclick="ReArrangeQuestionsGroup(event)" id="forword_${QuestionGroup_ID}" class="fa fa-chevron-up up-icon"></span>
|
||||||
|
<span onclick="ReArrangeQuestionsGroup(event)" id="backword_${QuestionGroup_ID}" class="fa fa-chevron-down down-icon"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row" style="text-align:right; width: 100%">
|
<div class="row" style="text-align:right; width: 100%">
|
||||||
<div class="col-lg-10 col-md-12">
|
<div class="col-lg-10 col-md-12">
|
||||||
<div class=" button-group align-items-center">
|
<div class=" button-group align-items-center">
|
||||||
@ -1339,21 +1353,20 @@ function addQuestionGroup(idObj)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="dragHandle" class="drag-handle">
|
<div id="dragHandle" class="drag-handle">
|
||||||
<i class="fas fa-grip-horizontal"></i>
|
<i class="fas fa-grip-horizontal"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12 col-md-12">
|
<div class="col-lg-12 col-md-12">
|
||||||
<div class="form_box">
|
<div class="form_box">
|
||||||
<label>Quesions Group:</label>
|
<label>Questions Group:</label>
|
||||||
<div class="richText" id="subSection_title_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}</div>
|
<div class="richText" id="subSection_title_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-12 col-md-12 hideondrag">
|
<div class="col-lg-12 col-md-12 hideondrag">
|
||||||
<div class="form_box">
|
<div class="form_box">
|
||||||
<label>Quesions Group Description:</label>
|
<label>Questions Group Description:</label>
|
||||||
<div class="richText" id="subSection_description_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_description : ""}</div>
|
<div class="richText" id="subSection_description_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_description : ""}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1499,18 +1512,17 @@ function addQuestionGroup(idObj)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displayMArks = 'false';
|
displayMArks = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var DisplayMark_RawID = "Question_Group_Display_Marks_Id_" + QuestionGroup_ID;
|
var DisplayMark_RawID = "Question_Group_Display_Marks_Id_" + QuestionGroup_ID;
|
||||||
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
||||||
|
|
||||||
if(displayMArks === 'true'){
|
if(displayMArks === 'false'){
|
||||||
|
|
||||||
DisplayMark_ID.checked = true;
|
|
||||||
}else{
|
|
||||||
DisplayMark_ID.checked = false;
|
DisplayMark_ID.checked = false;
|
||||||
|
}else{
|
||||||
|
DisplayMark_ID.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1580,7 +1592,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, 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)
|
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();
|
const ChoiceGroupFixed_UUID = uuidv4();
|
||||||
|
|
||||||
var groupQuestion = "";
|
var groupQuestion = "";
|
||||||
@ -1630,8 +1641,9 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
|||||||
<i class="fas fa-grip-horizontal"></i>
|
<i class="fas fa-grip-horizontal"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="items hideondrag" style="display: none;">
|
<div class="items hideondrag" style="display: none;">
|
||||||
|
<i onclick="ReArrangeQuestions(event)" class="fa fa-chevron-up up-icon"></i>
|
||||||
|
<i onclick="ReArrangeQuestions(event)" class="fa fa-chevron-down down-icon"></i>
|
||||||
<i class="fa fa-trash-o" onclick="removeClonedQroupQuestion(${addChoiceAreaId})" style="font-size:20px;"aria-hidden="true"></i>
|
<i class="fa fa-trash-o" onclick="removeClonedQroupQuestion(${addChoiceAreaId})" style="font-size:20px;"aria-hidden="true"></i>
|
||||||
<i class="fa fa-clone" id="cloneId_${addChoiceAreaId}" onclick="cloneQuestion(event, 2)" style="font-size:20px;" aria-hidden="true"></i>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@ -1703,7 +1715,6 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
|||||||
<math-field id="choiceTextField_math_${addChoiceAreaId}" style="width: 100%;" contenteditable="true">${Choice ? Choice[0].choice_name : ""}</math-field>
|
<math-field id="choiceTextField_math_${addChoiceAreaId}" style="width: 100%;" contenteditable="true">${Choice ? Choice[0].choice_name : ""}</math-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="items2 col-lg-4">
|
<div class="items2 col-lg-4">
|
||||||
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="deleteButton_${addChoiceAreaId}"></i>
|
|
||||||
<input style="width:14px; height:14px" type="checkbox" id="Choicemath_${addChoiceAreaId}"> <span class="math">MATH</span>
|
<input style="width:14px; height:14px" type="checkbox" id="Choicemath_${addChoiceAreaId}"> <span class="math">MATH</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2020,11 +2031,10 @@ $(choiceTextField_previousDiv).hide();
|
|||||||
var DisplayMark_RawID = "Choice_Question_Display_Marks_Id_" + addChoiceAreaId;
|
var DisplayMark_RawID = "Choice_Question_Display_Marks_Id_" + addChoiceAreaId;
|
||||||
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
||||||
|
|
||||||
if(questionDisplayMarks === 'true'){
|
if(questionDisplayMarks === 'false'){
|
||||||
|
|
||||||
DisplayMark_ID.checked = true;
|
|
||||||
}else{
|
|
||||||
DisplayMark_ID.checked = false;
|
DisplayMark_ID.checked = false;
|
||||||
|
}else{
|
||||||
|
DisplayMark_ID.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var multipleAnswer = 'multipleAnswer_'+addChoiceAreaId;
|
var multipleAnswer = 'multipleAnswer_'+addChoiceAreaId;
|
||||||
@ -2082,8 +2092,8 @@ function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionR
|
|||||||
<math-field id="newchoiceTextField_math_`+text_field_created_time+rnd_no+`" style="width: 100%;" contenteditable="true">${choiceName ? choiceName : ""}</math-field>
|
<math-field id="newchoiceTextField_math_`+text_field_created_time+rnd_no+`" style="width: 100%;" contenteditable="true">${choiceName ? choiceName : ""}</math-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="items2 col-lg-4">
|
<div class="items2 col-lg-4">
|
||||||
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="newChoiceDeleteButton_`+text_field_created_time+rnd_no+`"></i>
|
<input style="width:14px; height:14px" type="checkbox" id="choice_math_`+text_field_created_time+rnd_no+`"> <span class="math">MATH</span>
|
||||||
<input style="width:14px; height:14px" type="checkbox" id="choice_math_`+text_field_created_time+rnd_no+`"> <span class="math">MATH</span>
|
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="newChoiceDeleteButton_`+text_field_created_time+rnd_no+`" title="Remove Choice"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
@ -2286,8 +2296,9 @@ textQuestion +=
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="items align-items-center hideondrag" style="display: none;">
|
<div class="items align-items-center hideondrag" style="display: none;">
|
||||||
|
<i onclick="ReArrangeQuestions(event)" id="forword_${addTextQuestionId}" class="fa fa-chevron-up up-icon" ></i>
|
||||||
|
<i onclick="ReArrangeQuestions(event)" id="backword_${addTextQuestionId}" class="fa fa-chevron-down down-icon"></i>
|
||||||
<i class="fa fa-trash-o" onclick="removeClonedTextQuestion(${addTextQuestionId})" style="font-size:20px;"aria-hidden="true"></i>
|
<i class="fa fa-trash-o" onclick="removeClonedTextQuestion(${addTextQuestionId})" style="font-size:20px;"aria-hidden="true"></i>
|
||||||
<i class="fa fa-clone" onclick="cloneQuestion(event, 1)" id="cloneId_${addTextQuestionId}" style="font-size:20px;" aria-hidden="true"></i>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-12 col-md-12 ">
|
<div class="col-lg-12 col-md-12 ">
|
||||||
<input type="hidden" id="Text_Question_UUID_ID_${addTextQuestionId}" value="${QuestionObj.hasOwnProperty('questionUUID') ? QuestionObj.questionUUID : Text_Question_UUID}">
|
<input type="hidden" id="Text_Question_UUID_ID_${addTextQuestionId}" value="${QuestionObj.hasOwnProperty('questionUUID') ? QuestionObj.questionUUID : Text_Question_UUID}">
|
||||||
@ -2506,20 +2517,18 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displayMArks = 'false';
|
displayMArks = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var DisplayMark_RawID = "Text_Question_Display_Marks_Id_" + addTextQuestionId;
|
var DisplayMark_RawID = "Text_Question_Display_Marks_Id_" + addTextQuestionId;
|
||||||
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
var DisplayMark_ID = document.getElementById(DisplayMark_RawID)
|
||||||
|
|
||||||
if(displayMArks === 'true'){
|
if(displayMArks === 'false'){
|
||||||
|
DisplayMark_ID.checked = false;
|
||||||
DisplayMark_ID.checked = true;
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
DisplayMark_ID.checked = false;
|
DisplayMark_ID.checked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2548,6 +2557,92 @@ 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json2nav();
|
||||||
|
clearSidebarWrapper();
|
||||||
|
navpane();
|
||||||
|
}
|
||||||
|
|
||||||
|
//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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json2nav();
|
||||||
|
clearSidebarWrapper();
|
||||||
|
navpane();
|
||||||
|
}
|
||||||
|
|
||||||
//Function for Add Group Question inside the Group QUestion Like Question
|
//Function for Add Group Question inside the Group QUestion Like Question
|
||||||
function MultiLevelQuestionGroup(e)
|
function MultiLevelQuestionGroup(e)
|
||||||
{
|
{
|
||||||
@ -2637,6 +2732,7 @@ function cloneQuestion(e,type)
|
|||||||
// remove the cloned text type questions function
|
// remove the cloned text type questions function
|
||||||
function removeClonedTextQuestion(index)
|
function removeClonedTextQuestion(index)
|
||||||
{
|
{
|
||||||
|
alert('hi text');
|
||||||
var element = document.getElementById('removeAndCloneTextQuestion_'+ index);
|
var element = document.getElementById('removeAndCloneTextQuestion_'+ index);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.remove();
|
element.remove();
|
||||||
@ -2646,6 +2742,8 @@ function removeClonedTextQuestion(index)
|
|||||||
// remove the cloned choice or group type questions function
|
// remove the cloned choice or group type questions function
|
||||||
function removeClonedQroupQuestion(index)
|
function removeClonedQroupQuestion(index)
|
||||||
{
|
{
|
||||||
|
alert('hi choice');
|
||||||
|
|
||||||
var element = document.getElementById('removeAndCloneQroupQuestion_'+ index);
|
var element = document.getElementById('removeAndCloneQroupQuestion_'+ index);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.remove();
|
element.remove();
|
||||||
@ -2686,86 +2784,6 @@ function removeClonedQroupQuestion(index)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// document.addEventListener('mousedown', function (e) {
|
|
||||||
// const dragHandle = e.target.closest('.drag-handle');
|
|
||||||
|
|
||||||
// if (dragHandle) {
|
|
||||||
// // If the click is inside a drag handle, find the corresponding .question
|
|
||||||
// const questionElement = dragHandle.closest('.groupsection');
|
|
||||||
|
|
||||||
// if (questionElement) {
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// document.addEventListener('mousedown', function (e) {
|
|
||||||
// const dragHandle = e.target.closest('.drag-handle');
|
|
||||||
|
|
||||||
// if (dragHandle) {
|
|
||||||
// // If the click is inside a drag handle, find the corresponding .question
|
|
||||||
// const questionElement = dragHandle.closest('.groupsection>.question');
|
|
||||||
|
|
||||||
// if (questionElement) {
|
|
||||||
// console.log(questionElement);
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
// // Event listener for .draggable-group elements
|
|
||||||
// document.addEventListener('mousedown', function (e) {
|
|
||||||
// const dragHandle = e.target.closest('.drag-handle');
|
|
||||||
// if(groupqnornot){
|
|
||||||
// if (dragHandle) {
|
|
||||||
|
|
||||||
// // If the click is inside a drag handle, find the corresponding .draggable-group
|
|
||||||
// const draggableGroup = dragHandle.closest('.draggable-group');
|
|
||||||
// console.log("draggableGroup:",draggableGroup);
|
|
||||||
// if (draggableGroup) {
|
|
||||||
// console.log("draggHandle:",dragHandle);
|
|
||||||
// // Initiate the drag operation for the .draggable-group
|
|
||||||
// draggedItemGroup = draggableGroup;
|
|
||||||
|
|
||||||
// // Add a dragStart event listener to set data
|
|
||||||
// draggedItemGroup.addEventListener('dragstart', function (e) {
|
|
||||||
// e.dataTransfer.setData('text/plain', draggedItemGroup.id);
|
|
||||||
// console.log(draggedItemGroup.id);
|
|
||||||
|
|
||||||
// // // Hide all elements with class "hideondrag" in the group
|
|
||||||
// // const richTextElements = document.querySelectorAll('.hideondrag');
|
|
||||||
// // richTextElements.forEach((element) => {
|
|
||||||
// // element.style.display = 'none';
|
|
||||||
// // });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('dragover', function (e) {
|
document.addEventListener('dragover', function (e) {
|
||||||
// groupqnornot = true;
|
// groupqnornot = true;
|
||||||
// Hide all elements with class "hideondrag" in the question
|
// Hide all elements with class "hideondrag" in the question
|
||||||
@ -2842,6 +2860,9 @@ function removeClonedQroupQuestion(index)
|
|||||||
}
|
}
|
||||||
draggedItemGroup = null;
|
draggedItemGroup = null;
|
||||||
dropTarget = null;
|
dropTarget = null;
|
||||||
|
json2nav();
|
||||||
|
clearSidebarWrapper();
|
||||||
|
navpane();
|
||||||
} else if (draggedItemQuestion && dropTarget) {
|
} else if (draggedItemQuestion && dropTarget) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const rect = dropTarget.getBoundingClientRect();
|
const rect = dropTarget.getBoundingClientRect();
|
||||||
@ -2854,9 +2875,13 @@ function removeClonedQroupQuestion(index)
|
|||||||
}
|
}
|
||||||
draggedItemQuestion = null;
|
draggedItemQuestion = null;
|
||||||
dropTarget = null;
|
dropTarget = null;
|
||||||
|
json2nav();
|
||||||
|
clearSidebarWrapper();
|
||||||
|
navpane();
|
||||||
} else {
|
} else {
|
||||||
console.error('No dragged item or drop target found.');
|
console.error('No dragged item or drop target found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -22,7 +22,7 @@ body {
|
|||||||
|
|
||||||
p {
|
p {
|
||||||
|
|
||||||
font-weight: 500;/* Change this into 400 aadhavan */
|
font-weight: 400;/* Change this into 400 aadhavan */
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-family: 'Rubik', sans-serif;
|
font-family: 'Rubik', sans-serif;
|
||||||
color: #6d6d6d;
|
color: #6d6d6d;
|
||||||
|
|||||||
@ -95,7 +95,10 @@ function generateSingleQuestions(ParentObjects)
|
|||||||
|
|
||||||
var parentMarks = ParentObjects.parentMarks;
|
var parentMarks = ParentObjects.parentMarks;
|
||||||
var parentAttemptAny = ParentObjects.parentAttemptAny;
|
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('parentMarks : ', parentMarks);
|
||||||
// console.log('new_parentAttemptAny : ', parentAttemptAny);
|
// console.log('new_parentAttemptAny : ', parentAttemptAny);
|
||||||
|
|||||||
37
nav_pane.js
37
nav_pane.js
@ -6,7 +6,7 @@ function navpane() {
|
|||||||
let currentlyHighlightedElement = null; // Track the currently highlighted element
|
let currentlyHighlightedElement = null; // Track the currently highlighted element
|
||||||
// console.log('navpane called');
|
// console.log('navpane called');
|
||||||
var jsonData = JSON.parse(localStorage.getItem('JSON_FOR_NAV'));
|
var jsonData = JSON.parse(localStorage.getItem('JSON_FOR_NAV'));
|
||||||
console.log(jsonData);
|
// console.log(jsonData);
|
||||||
// var arr = JSON.parse( localStorage.getItem('memoriesdata') );
|
// var arr = JSON.parse( localStorage.getItem('memoriesdata') );
|
||||||
// var jsonData2 = JSON.parse(jsonData);
|
// var jsonData2 = JSON.parse(jsonData);
|
||||||
// console.log(typeof jsonData);
|
// console.log(typeof jsonData);
|
||||||
@ -38,7 +38,7 @@ function navpane() {
|
|||||||
var splitedSectionId = sectionId.split("_")[3];
|
var splitedSectionId = sectionId.split("_")[3];
|
||||||
var SectionBox_RawID = 'SectionBox_'+splitedSectionId;
|
var SectionBox_RawID = 'SectionBox_'+splitedSectionId;
|
||||||
var SectionBoxID = document.getElementById(SectionBox_RawID)
|
var SectionBoxID = document.getElementById(SectionBox_RawID)
|
||||||
console.log(SectionBoxID);
|
// console.log(SectionBoxID);
|
||||||
|
|
||||||
|
|
||||||
// Check if the section should be initially expanded based on expandedSections
|
// Check if the section should be initially expanded based on expandedSections
|
||||||
@ -142,25 +142,26 @@ function navpane() {
|
|||||||
|
|
||||||
function createTreeNode(nodeData, parentNode) {
|
function createTreeNode(nodeData, parentNode) {
|
||||||
const nodeDiv = document.createElement('div');
|
const nodeDiv = document.createElement('div');
|
||||||
|
nodeDiv.className = "navContain";
|
||||||
|
|
||||||
|
|
||||||
// nodeDiv.id = nodeData.textQuestion_Id || nodeData.choice_question_id;
|
// nodeDiv.id = nodeData.textQuestion_Id || nodeData.choice_question_id;
|
||||||
const nodeDataId = nodeData.question_Id
|
const nodeDataId = nodeData.question_Id
|
||||||
const nodeDataType = nodeData.question_type
|
const nodeDataType = nodeData.question_type
|
||||||
console.log('nodeDataType:',nodeDataType);
|
// console.log('nodeDataType:',nodeDataType);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
parentNode.appendChild(nodeDiv);
|
parentNode.appendChild(nodeDiv);
|
||||||
|
|
||||||
|
|
||||||
|
var bulletPoint = "";
|
||||||
if (nodeData.question) {
|
if (nodeData.question) {
|
||||||
|
|
||||||
var RawID = "";
|
var RawID = "";
|
||||||
if(nodeDataType == 'text')
|
if(nodeDataType == 'text')
|
||||||
{
|
{
|
||||||
const bulletPoint = document.createElement('i');
|
bulletPoint = document.createElement('span');
|
||||||
bulletPoint.className = "fa fa-text-width";
|
bulletPoint.className = "fa fa-text-width";
|
||||||
bulletPoint.style.marginRight = '10px';
|
bulletPoint.style.marginRight = '5px';
|
||||||
bulletPoint.style.fontSize = '17px';
|
bulletPoint.style.fontSize = '15px';
|
||||||
bulletPoint.style.fontWeight = 'bold';
|
bulletPoint.style.fontWeight = 'bold';
|
||||||
bulletPoint.style.color = '#00aaff';
|
bulletPoint.style.color = '#00aaff';
|
||||||
// bulletPoint.textContent = '\u2022';
|
// bulletPoint.textContent = '\u2022';
|
||||||
@ -173,10 +174,10 @@ function navpane() {
|
|||||||
|
|
||||||
}else if(nodeDataType == 'group')
|
}else if(nodeDataType == 'group')
|
||||||
{
|
{
|
||||||
const bulletPoint = document.createElement('i');
|
bulletPoint = document.createElement('span');
|
||||||
bulletPoint.className = "fa fa-check-circle-o";
|
bulletPoint.className = "fa fa-check-circle-o";
|
||||||
bulletPoint.style.marginRight = '10px';
|
bulletPoint.style.marginRight = '5px';
|
||||||
bulletPoint.style.fontSize = '17px';
|
bulletPoint.style.fontSize = '15px';
|
||||||
bulletPoint.style.fontWeight = 'bold';
|
bulletPoint.style.fontWeight = 'bold';
|
||||||
bulletPoint.style.color = '#00aaff';
|
bulletPoint.style.color = '#00aaff';
|
||||||
bulletPoint.setAttribute("title", "MCQ");
|
bulletPoint.setAttribute("title", "MCQ");
|
||||||
@ -189,7 +190,7 @@ function navpane() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var QuestionID = document.getElementById(RawID)
|
var QuestionID = document.getElementById(RawID)
|
||||||
console.log(QuestionID)
|
// console.log(QuestionID)
|
||||||
|
|
||||||
const questionLink = document.createElement('a');
|
const questionLink = document.createElement('a');
|
||||||
questionLink.href = '#' + nodeDataId;
|
questionLink.href = '#' + nodeDataId;
|
||||||
@ -219,6 +220,7 @@ function navpane() {
|
|||||||
questionLink.style.fontWeight = questionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
questionLink.style.fontWeight = questionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
||||||
} else {
|
} else {
|
||||||
questionLink.style.fontWeight = 'bold';
|
questionLink.style.fontWeight = 'bold';
|
||||||
|
QuestionID.style.fontWeight = 'normal';
|
||||||
currentlyHighlightedElement = questionLink;
|
currentlyHighlightedElement = questionLink;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -236,7 +238,7 @@ function navpane() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (nodeData.question.length > 20) {
|
if (nodeData.question.length > 20) {
|
||||||
questionLink.innerHTML = removeParagraphTags(nodeData.question.substring(0, 20) + '.....');
|
questionLink.innerHTML = removeParagraphTags(nodeData.question.substring(0, 20) + '...');
|
||||||
} else {
|
} else {
|
||||||
questionLink.innerHTML = removeParagraphTags(nodeData.question);
|
questionLink.innerHTML = removeParagraphTags(nodeData.question);
|
||||||
}
|
}
|
||||||
@ -248,12 +250,12 @@ function navpane() {
|
|||||||
groupTitleDiv.setAttribute('data-id', groupTitleId);
|
groupTitleDiv.setAttribute('data-id', groupTitleId);
|
||||||
groupTitleDiv.className = 'question-group';
|
groupTitleDiv.className = 'question-group';
|
||||||
|
|
||||||
console.log(groupTitleId);
|
// console.log(groupTitleId);
|
||||||
|
|
||||||
var splitedGroupId = groupTitleId.split("_")[3];
|
var splitedGroupId = groupTitleId.split("_")[3];
|
||||||
var SplitedGroupRawID = 'QuestionGroupButtons_'+splitedGroupId;
|
var SplitedGroupRawID = 'QuestionGroupButtons_'+splitedGroupId;
|
||||||
var GroupBoxID = document.getElementById(SplitedGroupRawID);
|
var GroupBoxID = document.getElementById(SplitedGroupRawID);
|
||||||
console.log(GroupBoxID);
|
// console.log(GroupBoxID);
|
||||||
|
|
||||||
|
|
||||||
// Check if the group should be initially expanded based on expandedSections
|
// Check if the group should be initially expanded based on expandedSections
|
||||||
@ -332,6 +334,7 @@ function navpane() {
|
|||||||
groupQuestionLink.style.fontWeight = groupQuestionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
groupQuestionLink.style.fontWeight = groupQuestionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
||||||
} else {
|
} else {
|
||||||
groupQuestionLink.style.fontWeight = 'bold';
|
groupQuestionLink.style.fontWeight = 'bold';
|
||||||
|
GroupBoxID.style.fontWeight = 'normal';
|
||||||
currentlyHighlightedElement = groupQuestionLink;
|
currentlyHighlightedElement = groupQuestionLink;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
187
savexml.js
187
savexml.js
@ -3,13 +3,40 @@ const cheerio = require('cheerio');
|
|||||||
const Swal = require('sweetalert2')
|
const Swal = require('sweetalert2')
|
||||||
const encode = require('./encode')
|
const encode = require('./encode')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
|
|
||||||
//Get the value from .env
|
//Get the value from .env
|
||||||
const isEncrypted = process.env.ENCRYPTED;
|
const isEncrypted = process.env.ENCRYPTED;
|
||||||
|
|
||||||
|
// start the Autosave filename take the names in xml folder
|
||||||
|
////////
|
||||||
|
function getFilesInFolder(folderName) {
|
||||||
|
const xmlFilePath = path.join(__dirname, folderName);
|
||||||
|
try {
|
||||||
|
const fileNames = fs.readdirSync(xmlFilePath);
|
||||||
|
const xmlFiles = fileNames.filter((file) => file.endsWith('.xml'));
|
||||||
|
return xmlFiles;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error reading folder:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//XmlPath get from .env
|
||||||
|
const xmlPath_ = process.env.XML_FILE_PATH;
|
||||||
|
const folderName = `/${xmlPath_}`;
|
||||||
|
const filePaths = [];
|
||||||
|
const files = getFilesInFolder(folderName);
|
||||||
|
files.forEach((file) => {
|
||||||
|
const filePath = file;
|
||||||
|
filePaths.push(filePath);
|
||||||
|
});
|
||||||
|
////////
|
||||||
|
//end the autosave
|
||||||
|
|
||||||
function saveXmlToFile(xmlData, filePath,reorder=false) {
|
function saveXmlToFile(xmlData, filePath,reorder=false) {
|
||||||
console.log(filePath);
|
console.log(filePath);
|
||||||
|
// console.log(filePath);
|
||||||
// Check if the file path is provided
|
// Check if the file path is provided
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
console.error('File path is required.');
|
console.error('File path is required.');
|
||||||
@ -31,82 +58,116 @@ function saveXmlToFile(xmlData, filePath,reorder=false) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
if(reorder){
|
if(reorder){
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}else{
|
}else{
|
||||||
window.location.href = 'dashboard.html';
|
window.location.href = 'dashboard.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function savexml(UserFilename,reorder=false) {
|
function savexml(UserFilename,reorder=false) {
|
||||||
|
console.log("reorder",reorder);
|
||||||
// Get the XML string from localStorage
|
// Get the XML string from localStorage
|
||||||
var xmlString = localStorage.getItem("xml");
|
var xmlString = localStorage.getItem("xml");
|
||||||
|
//check Encrypted or not
|
||||||
//check Encrypted or not
|
var enc = "";
|
||||||
var enc = "";
|
if (isEncrypted === 'YES') {
|
||||||
if (isEncrypted === 'YES') {
|
// Encrypt
|
||||||
// Encrypt
|
enc = encode(xmlString);
|
||||||
enc = encode(xmlString);
|
} else {
|
||||||
}else{
|
enc = xmlString;
|
||||||
enc = xmlString;
|
|
||||||
}
|
|
||||||
|
|
||||||
//XmlPath get from .env
|
|
||||||
const xmlPathenv=process.env.XML_FILE_PATH;
|
|
||||||
const xmlPath = path.join(__dirname, xmlPathenv)
|
|
||||||
// Get the json string from localStorage for set fileName
|
|
||||||
var jsonData = localStorage.getItem("json");
|
|
||||||
|
|
||||||
// Create a filename using on the subtitle
|
|
||||||
var xmlfilename = `${UserFilename}.xml`;
|
|
||||||
// var jsonfilename = `${UserFilename}.json`;
|
|
||||||
|
|
||||||
// file path where you want to save the XML file
|
|
||||||
// const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
|
||||||
|
|
||||||
const xmlfilePath = `${xmlPath}` + xmlfilename;
|
|
||||||
// const jsonfilePath = process.cwd() + '/xml/' + jsonfilename;
|
|
||||||
|
|
||||||
if(reorder){
|
|
||||||
saveXmlToFile(enc, xmlfilePath,reorder=true);
|
|
||||||
}else{
|
|
||||||
// Call the function to save the XML file
|
|
||||||
saveXmlToFile(enc, xmlfilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//XmlPath get from .env
|
||||||
function promptBox(){
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
|
const xmlPath = path.join(__dirname, xmlPathenv)
|
||||||
|
// Get the json string from localStorage for set fileName
|
||||||
var jsonData = localStorage.getItem("json");
|
var jsonData = localStorage.getItem("json");
|
||||||
var jsonString = JSON.parse(jsonData);
|
|
||||||
var getTitle = jsonString.question_paper_title;
|
// Create a filename using on the subtitle
|
||||||
var RawFileName = removeHtmlTags(getTitle);
|
var xmlfilename = `${UserFilename}.xml`;
|
||||||
// console.log(RawFileName)
|
// var jsonfilename = `${UserFilename}.json`;
|
||||||
|
|
||||||
|
// file path where you want to save the XML file
|
||||||
|
// const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
||||||
|
|
||||||
|
const xmlfilePath = `${xmlPath}` + xmlfilename;
|
||||||
|
// const jsonfilePath = process.cwd() + '/xml/' + jsonfilename;
|
||||||
|
|
||||||
|
if(reorder){
|
||||||
|
saveXmlToFile(enc, xmlfilePath,reorder=true);
|
||||||
|
}else{
|
||||||
|
// Call the function to save the XML file
|
||||||
|
saveXmlToFile(enc, xmlfilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function promptBox() {
|
||||||
|
|
||||||
|
var jsonData = localStorage.getItem("json");
|
||||||
|
var jsonString = JSON.parse(jsonData);
|
||||||
|
var getTitle = jsonString.question_paper_title;
|
||||||
|
var RawFileNam = removeHtmlTags(getTitle);
|
||||||
|
var RawFileName;
|
||||||
|
|
||||||
|
if (RawFileNam === "" || RawFileNam === null) {
|
||||||
|
const currentDate = new Date();
|
||||||
|
const year = currentDate.getFullYear();
|
||||||
|
const month = String(currentDate.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(currentDate.getDate()).padStart(2, '0');
|
||||||
|
let hours = currentDate.getHours();
|
||||||
|
let ampm = 'AM';
|
||||||
|
|
||||||
|
if (hours > 12) {
|
||||||
|
hours -= 12;
|
||||||
|
ampm = 'PM';
|
||||||
|
}
|
||||||
|
|
||||||
|
hours = String(hours).padStart(2, '0');
|
||||||
|
const minutes = String(currentDate.getMinutes()).padStart(2, '0');
|
||||||
|
|
||||||
|
// Create a formatted date-time string
|
||||||
|
const formattedDateTime = `${year}${month}${day}(${hours};${minutes}${ampm})`;
|
||||||
|
RawFileName = "untitled" +formattedDateTime;
|
||||||
|
} else {
|
||||||
|
RawFileName = RawFileNam
|
||||||
|
}
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Enter Filename',
|
title: 'Enter Filename',
|
||||||
input: 'text',
|
input: 'text',
|
||||||
inputValue: RawFileName,
|
inputValue: RawFileName,
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
|
showDenyButton: false,
|
||||||
|
denyButtonText: 'Overwrite',
|
||||||
confirmButtonText: 'Submit',
|
confirmButtonText: 'Submit',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
inputValidator: (value) => {
|
inputValidator: (value) => {
|
||||||
|
// console.log(value);
|
||||||
|
const entervalue =value+'.xml'
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return 'You need to enter Filename!'
|
return 'You need to enter Filename!'
|
||||||
}
|
}
|
||||||
|
else if (value){
|
||||||
|
|
||||||
|
const fileexist =fileexists(entervalue);
|
||||||
|
if(fileexist){
|
||||||
|
Swal.update({ showDenyButton: true });
|
||||||
|
return 'This file Name already exists'
|
||||||
|
}else {
|
||||||
|
Swal.update({ showDenyButton: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
|
// console.log(result);
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
const inputValue = result.value
|
const inputValue = result.value
|
||||||
savexml(inputValue)
|
savexml(inputValue)
|
||||||
|
}else if(result.isDenied){
|
||||||
|
savexml(RawFileName)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -122,5 +183,15 @@ function removeHtmlTags(inputString) {
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check filename is already exists or not
|
||||||
|
function fileexists(enteredfilename) {
|
||||||
|
var nextFilename
|
||||||
|
for (const files of filePaths) {
|
||||||
|
nextFilename = files;
|
||||||
|
if (nextFilename === enteredfilename) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3557,10 +3557,19 @@ input:disabled {
|
|||||||
|
|
||||||
.math{
|
.math{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.mathQuestions{
|
.mathQuestions{
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
float: right;
|
float: right;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.navContain{
|
||||||
|
display: flex; /* Use a flex container to control spacing */
|
||||||
|
align-items: center; /* Vertically center the items */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,8 +54,9 @@ function getQuestionsNodes(questionNode,type)
|
|||||||
{
|
{
|
||||||
var tempChoiceobj = {};
|
var tempChoiceobj = {};
|
||||||
tempChoiceobj['id'] = choiceList[k].childNodes[0].firstChild.nodeValue;
|
tempChoiceobj['id'] = choiceList[k].childNodes[0].firstChild.nodeValue;
|
||||||
tempChoiceobj['choice_name'] = (choiceList[k].childNodes[1].firstChild !== null ? choiceList[k].childNodes[1].firstChild.nodeValue : "");
|
tempChoiceobj['no'] = (choiceList[k].childNodes[1].firstChild !== null ? choiceList[k].childNodes[1].firstChild.nodeValue : "");
|
||||||
tempChoiceobj['choice_description'] = (choiceList[k].childNodes[2].firstChild !== null ? choiceList[k].childNodes[2].firstChild.nodeValue : "");
|
tempChoiceobj['choice_name'] = (choiceList[k].childNodes[2].firstChild !== null ? choiceList[k].childNodes[2].firstChild.nodeValue : "");
|
||||||
|
tempChoiceobj['is_math_enabled'] = (choiceList[k].childNodes[3].firstChild !== null ? choiceList[k].childNodes[3].firstChild.nodeValue : "");
|
||||||
// console.log(tempChoiceobj);
|
// console.log(tempChoiceobj);
|
||||||
questionObj['answers'].push(tempChoiceobj);
|
questionObj['answers'].push(tempChoiceobj);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user