-
-
-
+
+
-
+
-
+
-
-
-
+
+
Questionnaire Details
-
@@ -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 @@
});
-
-
+
-
+
+
-
+
+
+
@@ -593,6 +629,12 @@
@@ -560,7 +595,7 @@
+
-
+
@@ -575,6 +610,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 +=
`
-
- © 2023 Project-B. All rights reserved.
-
-
-
`;
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)
-
-
- Section:${i}
-
-
-
-
-
-
-
-
-
-
+
-
+
+
-
-
-
+
+Section ${i}
+ +
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
+
-
+
+
+
+ ${title ? title : ''}
+
+
-
+
+
+ ${description ? description : ''}
+
-
-
- ${title ? title : ''}
-
+ Display Marks
+
+
-
-
+
-
-
-
- ${title ? description : ''}
-
- Display Marks
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
-
-
+
-
@@ -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 +=
- `
+
+
+
+ Question Group
+ +
-
-
-
+
${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}
