PREVIEWALGIN QUILLTABLE CODEMERGE : AADHAVAN

This commit is contained in:
aadhavan 2023-11-30 12:18:11 +05:30
commit 3b9f4ccc7f
12 changed files with 638 additions and 589 deletions

View File

@ -3,6 +3,7 @@ function QuestionPaperPreview(jsonData){
// The provided JSON data
// console.log(jsonData)
// start Remove <p> tag
var jsonDat = jsonData;
// Remove <p> tags only with <br> tags
@ -305,10 +306,25 @@ function QuestionPaperPreview(jsonData){
const formattedQuestionPaper = convertJSONToQuestionPaper(jsonData, 0, 1, 1);
const questionPaperElement = document.getElementById("questionPaper");
questionPaperElement.innerHTML = formattedQuestionPaper; // Use innerHTML here
$("#overlay").hide();
}
function removeHtmlTags(inputString) {
const cheerio = require('cheerio');

View File

@ -121,7 +121,7 @@ tr{
text-wrap: wrap;
/* display: inline-flex; */
/* flex-direction: column; */
text-decoration: underline;
/* text-decoration: underline; */
/* justify-content: flex-start; */
position: relative;
top: -27px;
@ -346,10 +346,16 @@ color: #1d3557 !important;
<!-- loder -->
<div class="loader-wrapper">
<!-- <div class="loader-wrapper">
<div class="loader"></div>
<div class="loder-section left-section"></div>
<div class="loder-section right-section"></div>
</div> -->
<div id="overlay">
<div class="cv-spinner">
<span class="spinner"></span>
</div>
</div>
@ -434,8 +440,10 @@ color: #1d3557 !important;
<script>
var fs = require('fs');
var path =require('path');
$("#overlay").show();
const fs = require('fs');
const path =require('path');
// require('dotenv').config();
//get value from .env

View File

@ -46,32 +46,12 @@
<script defer src="./node_modules/mathlive/dist/mathlive.min.js"></script>
<!-- modernizr js -->
<script src="assets/js/vendor/modernizr-3.5.0.min.js"></script>
<script src="assets/js/quill.js"></script>
<!-- <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> -->
<link rel="stylesheet" href="https://unpkg.com/cropperjs/dist/cropper.min.css">
<!-- <script src="//cdn.quilljs.com/1.2.2/quill.min.js"></script> -->
<!-- <script src="./node_modules/quill/dist/quill.min.js"> </script> -->
<!-- <link href="//cdn.quilljs.com/1.2.2/quill.snow.css" rel="stylesheet"> -->
<!-- <script src="//cdn.quilljs.com/1.3.6/quill.min.js"></script> -->
<!-- <link href="//cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet"> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/4.3.1/fabric.min.js"></script>
<script src="QuestionPaperPreview.js"></script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<!-- <script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script src="./customTable.js"></script>
<!-- Order matters: Popper.js, Bootstrap JS -->
<script src="https://unpkg.com/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> -->
<script id="MathJax-script" async src="./node_modules/mathjax/es5/tex-mml-chtml.js"></script>
<style>
/* [data-value="remove-table"] {
@ -140,7 +120,7 @@
right: 20px;
font-size: 20px;
cursor: pointer;
z-index: 3; /* Ensure the button appears above the sidebar */
z-index: 0; /* Ensure the button appears above the sidebar */
}
.content {
@ -492,16 +472,16 @@
.work-area1{
background-color: transparent;
position: absolute;
top:-8px;
left:-18px;
top:13px;
left:295px;
border-width:0;
transform:rotate(58deg);
transition: box-shadow 0.3s, background-color 0.3s;
/* transform:rotate(58deg);
transition: box-shadow 0.3s, background-color 0.3s; */
color: #bf303b;
}
.work-area1::before{
content: '\2BC7';
content: '\2715';
font-size: 24px;
}
.work-area::before{
@ -509,7 +489,7 @@
}
.menu-symbol {
position:absolute;
right:0;
right:20px;
background-color: transparent;
margin-top: 14px;
border-radius: 20%;
@ -723,6 +703,7 @@ h1.title{
max-height: calc(100% - 60px);
overflow-y: auto;
margin-bottom: 10px;
height:100%;
}
#messageForm {
@ -807,19 +788,26 @@ h1.title{
/* margin-right: 15px; */
width: 85px;
}
</style>
</style>
<script>
</script>
</head>
<body>
<!-- loder -->
<div class="loader-wrapper">
<!-- <div class="loader-wrapper" id="loaderWrapper">
<div class="loader"></div>
<div class="loder-section left-section"></div>
<div class="loder-section right-section"></div>
</div>
</div> -->
<div id="overlay">
<div class="cv-spinner">
<span class="spinner"></span>
</div>
</div>
<!-- main-header -->
<div class="main-header">
@ -862,16 +850,7 @@ h1.title{
var quill = new Quill('#workarea', {
theme: 'snow',
modules: {
toolbar: {
container: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize: {
displaySize: true,
modules: ['Resize', 'DisplaySize', 'Toolbar']
}
},
toolbar: toolbarOptions,
}
});
@ -887,10 +866,10 @@ h1.title{
document.getElementById('sidebarToggle2').addEventListener('click', function () {
var sidebar = document.getElementById('rightSidebar');
document.body.classList.toggle('sidebar-open');
if (sidebar.style.width === '250px') {
if (sidebar.style.width === '350px') {
sidebar.style.width = '0';
} else {
sidebar.style.width = '250px';
sidebar.style.width = '350px';
}
});
@ -898,10 +877,10 @@ h1.title{
document.getElementById('sidebarToggle3').addEventListener('click', function () {
var sidebar = document.getElementById('rightSidebar');
document.body.classList.toggle('sidebar-open');
if (sidebar.style.width === '250px') {
if (sidebar.style.width === '350px') {
sidebar.style.width = '0';
} else {
sidebar.style.width = '250px';
sidebar.style.width = '350px';
}
});
@ -920,6 +899,8 @@ h1.title{
var mathCheckbox = document.getElementById('Choicemath_messageInput');
var mathField = document.getElementById('workarea_math');
var richText = document.getElementById('workarea');
var quillrichText = document.getElementById('messageInput_rtc');
// Ensure MathQuill field is initially hidden
$(mathField).hide();
// $(richText1).show();
@ -927,11 +908,13 @@ h1.title{
if (mathCheckbox.checked) {
$(mathField).show();
$(richText).hide();
rtc_hide_and_show(chatRtc);
$('#messageInput_rtc').hide();
} else {
$(mathField).hide();
$(mathField).css('margin-bottom', '0');
$(richText).show();
rtc_hide_and_show(chatRtc);
$('#messageInput_rtc').hide();
}
});
@ -954,12 +937,12 @@ h1.title{
async function sendMessage(quill) {
var workarea = document.getElementById('workarea');
var workarea = document.getElementById('workarea').querySelector('.ql-editor').innerHTML;
var mathField = document.getElementById('workarea_math');
var messagesContainer = document.getElementById('messages');
console.log("workarea",workarea);
console.log("mathField",mathField);
console.log("messagesContainer",messagesContainer);
// console.log("workarea",workarea);
// console.log("mathField",mathField);
// console.log("messagesContainer",messagesContainer);
var content = '';
@ -971,14 +954,21 @@ h1.title{
content = await convertToLatex(mathFieldContent);
} else {
content = quill.root.innerHTML.trim();
content = document.getElementById('workarea').querySelector('.ql-editor').innerHTML;
}
// Log the content to the console
console.log("Message Content: ", content);
// console.log("Message Content: ", content);
if (content !== '') {
var messagesContainer = document.getElementById('messages');
// console.log(messagesContainer)
// var messageElement = document.createElement('div');
// messageElement.className = 'message';
messagesContainer.innerHTML += content;
@ -989,6 +979,9 @@ h1.title{
if ($('#Choicemath_messageInput').prop('checked')) {
// Clear the math field content
var mathJaxContainer = document.getElementById('workarea_math');
// console.log(mathJaxContainer.value)
mathJaxContainer.value = "";
// mathField.latex('');
} else {
quill.setText('');
@ -1006,12 +999,12 @@ h1.title{
return new Promise(async(resolve, reject) => {
if (!/<p>|<\/p>/i.test(text)) {
console.log('text:' , text)
// console.log('text:' , text)
if (mathStatusBoolean) {
console.log('text1:' , text)
// console.log('text1:' , text)
// Use MathJax to convert the text to LaTeX
const cov = await MathJax.tex2chtml(text).outerHTML;
console.log('cov:' , cov);
// console.log('cov:' , cov);
resolve(cov);
//return cov;
} else {
@ -1020,8 +1013,10 @@ h1.title{
//return text;
}
} else {
// console.log("pq")
const cov = await MathJax.tex2chtml(text).outerHTML;
console.log('cov:' , cov)
// console.log('cov:' , cov)
resolve(cov);
//return cov;
}
@ -1029,32 +1024,33 @@ h1.title{
});
}
</script>
<div class="sidebar" id="rightSidebar">
<div class="chat-box">
<button class="work-area1" id="sidebarToggle3"></button>
<h2>Work Area</h2>
<h2 style="font-weight: 600;">Work Area</h2>
<div id="messages" class="chat-history" ></div>
<form id="messageForm" action="#" method="post" onsubmit="sendMessage(); return false;">
<fieldset>
<!-- The contentEditable div for Quill -->
<div class="row">
<div class="col-12">
<div class="richText worksection" id="workarea" contentEditable="true" placeholder="Type your message and press Enter..."></div>
<div class="richText worksection" id="workarea" contentEditable="true" placeholder="Type your message and press Enter..." style="position: relative; top: 4px;"></div>
</div>
<div class="col-12">
<div>
<math-field id="workarea_math" style="width: 100%; " contenteditable="true"></math-field>
</div>
</div>
<div class="col-6 items2" style="display: flex; align-items: center;">
<div class="col-6 items2" style="display: flex; align-items: center; position: relative; right: 40px;">
<input style="width:14px; height:14px; margin-right: 5px;" type="checkbox" id="Choicemath_messageInput"/>
<span class="math">Math</span>
<span class="math2">Math</span>
</div>
<div class="col-6" style="display: flex; align-items: center;">
<button id="sendMessageButton" class="sendMessageButton" type="button">Send</button>
<div class="col-6" style="display: flex; align-items: center; position: relative; top: 10px;" >
<button onclick="clearMessage()" id="clearMessageButton" class="sendMessageButton" type="button" style="position: relative; right: 5px;">Clear</button>
<button id="sendMessageButton" class="sendMessageButton" type="button">Add</button>
</div>
</div>
</fieldset>
@ -1267,12 +1263,42 @@ h1.title{
<!-- Main.js its used to trigger auto save when system online -->
<script src="main.js"></script>
<script src="checkParent.js"></script>
<script>
$("#overlay").show();
$('#workarea_math').click(function(){
console.log('called');
$('#workarea_math').css('margin-bottom', '190px');
localStorage.setItem('workAreaMath', true);
});
const { v4: uuidv4 } = require('uuid');
const Quill = require('quill');
const ImageResize = require('quill-image-resize').default;
var ids = document.getElementById('workarea_math')
console.log(ids)
function clearMessage() {
var val = document.getElementById('messages') ;
if(val !== null){
val.innerHTML = '';
}
var mathJaxContainer = document.getElementById('workarea_math');
var quillContainer = document.getElementById('workarea');
var quillInstance = new Quill('#workarea');
quillInstance.setText('');
// console.log(mathJaxContainer);
// console.log(quillContainer);
mathJaxContainer.value = "";
};
localStorage.setItem('scrollPosition', window.scrollY);
@ -1335,6 +1361,8 @@ $(document).ready(function() {
if(FileName == "" || FileName == null ) {
var random_no = Date.now();
addSection(false, false, random_no, false, false, false, false, 1); //Call the Default section on the QUestion paper
$("#overlay").hide();
}else {
loadXML(FileName); //send filename to read xml files to using this function
@ -1343,16 +1371,42 @@ $(document).ready(function() {
})
// $(document).on("click", function (event) {
$(document).on("click", function (event) {
var questionPaperDiv = $(".QuestionPaperClass");
var rightSidebar = $('.sidebar');
var qlToolbar = $('.ql-toolbar');
// Check if the click is outside the QuestionPaperClass and its descendants
if (!questionPaperDiv.is(event.target) && questionPaperDiv.find(event.target).length === 0) {
// $('#workarea_math').css('margin-bottom', '0px');
// Check if the click is within the rightSidebar or its descendants
if (!rightSidebar.is(event.target) && rightSidebar.find(event.target).length === 0) {
qlToolbar.hide();
}
}
});
// var questionPaperDiv = $(".QuestionPaperClass");
// if (!questionPaperDiv.is(event.target) && questionPaperDiv.has(event.target).length === 0) {
// $('.ql-toolbar').hide();
// }
$(document).on("click", function (event) {
// });
console.log(event.target.id);
console.log(event.target.id == 'workarea_math' ? 'true' : 'false');
if(event.target.id !== 'workarea_math')
{
var element = $('.ML__virtual-keyboard-toggle');
console.log(element);
var value = localStorage.getItem('workAreaMath');
console.log('valeu : ', value);
console.log('type : ',typeof value);
if(value === 'true'){
$('#workarea_math').css('margin-bottom', '0px');
localStorage.removeItem('workAreaMath');
}
}
// localStorage.removeItem('workAreaMath');
});
document.addEventListener('DOMContentLoaded', function () {
const scrollToTopBtn = document.getElementById('SaveButton');
@ -1478,6 +1532,7 @@ function loadXML(xmlFileName) {
});
}
setTimeout(function() {
fs.readFile(`${xmlPath}${xmlFileName}`, 'utf8', (error, data) => {
if (error) {
console.error('Error reading file:', error);
@ -1490,17 +1545,17 @@ function loadXML(xmlFileName) {
decodeData = data;
}
// console.log('jsonDecodeData : ', jsonDecodeData);
console.log('jsonDecodeData : ', jsonDecodeData);
resolve(decodeData);
xml2json(decodeData);
}
});
}, 1000);
//XML File Read Function
}
// Function for Save the XML File
@ -1558,6 +1613,8 @@ const table = require('quill1-table');
Quill.register('modules/table', table);
const tab = require('quill-table');
Quill.register('modules/imageResize', ImageResize);
const Question_Paper_UUID = uuidv4();
var QuestionPaper_UUID = document.getElementById('QuestionPaper_UUID_ID')
QuestionPaper_UUID.value = Question_Paper_UUID;
@ -1639,9 +1696,8 @@ var quill = new Quill('#Question_title', {
handlers: {
table: function () {
// this.quill.getModule('table').insert();
const rows = 7;
const columns = 7;
this.quill.getModule('table').insert({ rows, columns });
this.quill.getModule('table').insert();
},
},
},
@ -1679,29 +1735,28 @@ var quill = new Quill('#Question_title', {
var quill = new Quill('#QuestionsGroupIdset ', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ],
}
}
}
});
var canvas = new fabric.Canvas('canvas');
var quill = new Quill('#Question_description', {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -1715,44 +1770,25 @@ var quill = new Quill('#Question_description', {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions
});
var quill = new Quill('#workarea', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ],
}
}
});
// var quill = new Quill('#workarea', {
// theme: 'snow',
// modules: {
// toolbar:{
// container:toolbarOptions,
// clipboard: {
// matchVisual: true,
// },
// ImageResize:{
// displaySize:true,
// modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
// }
// },
// }
// });
var quill = new Quill('#ql-editor',{
theme:'snow',
module:{
ImageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
})
// function imageHandler() {
// var range = this.quill.getSelection();
// var value = prompt('hello');
// console.log(value);
// this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER);
// }
var Question_title_Div = $("#Question_title");
@ -1766,9 +1802,7 @@ rtc_hide_and_show(setitem);
});
var Question_description_Div = $("#Question_description");
console.log("Question_description_Div",Question_description_Div);
var Question_description_previousDiv = Question_description_Div.prev();
console.log("Question_description_previousDiv",Question_description_previousDiv);
Question_description_previousDiv.attr("id", "Question_description_rtc");
var questionDescriptionRtc = 'Question_description_rtc';
$('#Question_description').focus(function() {
@ -1785,22 +1819,22 @@ rtc_hide_and_show(questionDescriptionRtc);
// rtc_hide_and_show(chatRtc);
// });
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 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';
// var labelElement = document.createElement('label');
// labelElement.htmlFor = 'myCheckbox';
// labelElement.textContent = 'Math';
// console.log(parentElement);
parentElement.appendChild(checkboxElement);
parentElement.appendChild(labelElement);
// // console.log(parentElement);
// parentElement.appendChild(checkboxElement);
// parentElement.appendChild(labelElement);
@ -2081,16 +2115,14 @@ inputFields.forEach(inputField => {
});
var sectionText = (random_no == false) ? 'section_title_text_' + text_field_created_time : 'section_title_text_' + random_no;
// console.log(sectionText);
var quill = new Quill('#'+sectionText, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -2104,20 +2136,17 @@ inputFields.forEach(inputField => {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions
},
});
var sectionDescription = (random_no == false) ? 'section_description_text_' + text_field_created_time : 'section_description_text_' + random_no;
var quill = new Quill('#'+sectionDescription, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -2131,7 +2160,6 @@ inputFields.forEach(inputField => {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions
},
});
var section_title_Div = (random_no == false) ? 'section_title_text_' + text_field_created_time : 'section_title_text_' + random_no;
@ -2299,13 +2327,13 @@ function addQuestionGroup(idObj)
<div class=" button-group align-items-center">
<div class="addButton QGButtons" style="display: none;" id="AddButton_${QuestionGroup_ID}">
<div class="col-md-2">
<div class="addButtonIcons"><img title="QuestionGroup" src="assets/images/text.svg" alt="" onclick="addNewGroupQuestions(event, 1)" id="textButtonSectionQroupside_${QuestionGroup_ID}" title="Question Group Text Question"></div>
<div class="addButtonIcons"><img title="Text Question" src="assets/images/text.svg" alt="" onclick="addNewGroupQuestions(event, 1)" id="textButtonSectionQroupside_${QuestionGroup_ID}" title="Text Question"></div>
</div>
<div class="col-md-2">
<div class="addButtonIcons"><img title="QuestionGroup" src="assets/images/choice.svg" alt="" onclick="addNewGroupQuestions(event, 2)" id="choiseButtonSectionQroupside_${QuestionGroup_ID}" title="Question Group Choice Question"></div>
<div class="addButtonIcons"><img title="Choice Question" src="assets/images/choice.svg" alt="" onclick="addNewGroupQuestions(event, 2)" id="choiseButtonSectionQroupside_${QuestionGroup_ID}" title="Choice Question"></div>
</div>
<div class="col-md-2">
<div class="addButtonIcons"><img title="QuestionGroup" src="assets/images/Group.svg" alt="" onclick="MultiLevelQuestionGroup(event)" id="QuestionGroupButtonside_${QuestionGroup_ID}" title="Question Group on Question Group"></div>
<div class="addButtonIcons"><img title="Question Group" src="assets/images/Group.svg" alt="" onclick="MultiLevelQuestionGroup(event)" id="QuestionGroupButtonside_${QuestionGroup_ID}" title="Question Group"></div>
</div>
</div>
</div>
@ -2426,12 +2454,11 @@ function addQuestionGroup(idObj)
var quill = new Quill('#'+subSectionText, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -2445,19 +2472,17 @@ function addQuestionGroup(idObj)
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions
},
});
var subSectionDescription = 'subSection_description_text_' + QuestionGroup_ID;
var quill = new Quill('#'+subSectionDescription, {
theme: 'snow', // Choose a theme (snow, bubble, etc.)
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -2471,7 +2496,6 @@ function addQuestionGroup(idObj)
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions
},
});
@ -2487,6 +2511,8 @@ function addQuestionGroup(idObj)
});
var sub_section_description_Div = 'subSection_description_text_' + QuestionGroup_ID;
var NewRTEId2 = 'subsection_description_rtc_' + QuestionGroup_ID;
var sub_section_description_previousDiv = $('#'+sub_section_description_Div).prev();
@ -2636,11 +2662,13 @@ scrollToElementWithoutLink(targetId);
//Function for Create a New Choice Question in the Section and Question Group
// 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,questionId,CorrectAnswer)
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,questionId, CorrectAnswer)
{
// console.log(CorrectAnswer);
const ChoiceGroupFixed_UUID = uuidv4();
console.log('CorrectAnswer', CorrectAnswer);
const ChoiceGroupFixed_UUIDforMultiornot = uuidv4();
// inputAreaCheck(Choice)
@ -3047,12 +3075,11 @@ var typetwoQuestionName = 'textQuestionName_' + addChoiceAreaId;
var quill = new Quill('#'+typetwoQuestionName, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3065,19 +3092,18 @@ var quill = new Quill('#'+typetwoQuestionName, {
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions },
keyboard: keyboardOptions
});
var typetwoQuestionSubtitle = 'textQuestionSubtitle_' + addChoiceAreaId;
var quill = new Quill('#'+typetwoQuestionSubtitle, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3090,22 +3116,18 @@ var quill = new Quill('#'+typetwoQuestionSubtitle, {
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions // imageResize:{
// displaySize:true
// }
},
keyboard: keyboardOptions
});
var choiceTextField = 'choiceTextField_' + addChoiceAreaId;
var quill = new Quill('#'+choiceTextField, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3118,7 +3140,7 @@ var quill = new Quill('#'+choiceTextField, {
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions },
keyboard: keyboardOptions,
placeholder: 'Enter Choice',
});
@ -3352,12 +3374,11 @@ $(newChoiceDeleteButtonId).on('click', function() {
var quill = new Quill(newChoiceTextField, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3370,7 +3391,7 @@ $(newChoiceDeleteButtonId).on('click', function() {
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions },
keyboard: keyboardOptions,
placeholder: 'Enter Choice',
});
@ -3755,12 +3776,11 @@ else
var quill = new Quill('#'+typeOneQuestionName, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3773,7 +3793,7 @@ else
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions },
keyboard: keyboardOptions
});
@ -3781,12 +3801,11 @@ else
var quill = new Quill('#'+typeOneQuestionSubtitle, {
theme: 'snow',
modules: {
toolbar:{
container:toolbarOptions,
toolbar: toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
imageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
},
@ -3799,7 +3818,7 @@ else
table: {
cellSelectionOnClick: true // true: cell selection on click, false: cell selection with CTRL key
},
keyboard: keyboardOptions },
keyboard: keyboardOptions
});
@ -4037,6 +4056,7 @@ function check_Empty_Question()
// console.log(Id);
// console.log(document.getElementById(Id));
var idclass= document.getElementById(Id).className;
console.log(idclass)
if ( idclass === 'QuestionTextIdSet' || idclass === 'QuestionsGroupIdset' || idclass === 'QuestionChoiceId' ) {
attrId = document.getElementById(Id).innerHTML
}else if(idclass === 'multipleAnswerorNot'){
@ -4066,11 +4086,13 @@ function check_Empty_Question()
}
function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) {
console.log('IdToRemove : ', IdToRemove);
// console.log('IdToRemove : ', IdToRemove);
var attrId;
var title_id = localStorage.getItem('JSON_FOR_EMPTY_QUESTION');
var attrId= '';
array_of_Id=[];
if (DeleteElement != 1) {
@ -4270,6 +4292,7 @@ function scrollToElementWithoutLink(elementId) {
confirmButtonText: 'OK'
});
}
element.focus()
}
}
@ -4957,6 +4980,20 @@ function findInputByValue(value) {
for (let i = 0; i < inputs.length; i++) {
if (inputs[i].value === choiceId[0]) {
inputs[i].checked = true;
// function findInputByValue(value) {
// console.log('test', value);
// value.forEach(function (param,index) {
// // console.log('correctanswer 2', param);
// // var choiceId = param.correct_answer;
// const inputs = document.getElementsByTagName('input');
// // console.log(inputs);
// for (let i = 0; i < inputs.length; i++) {
// // console.log(choiceId);
// if (inputs[i].value === param) {
// // return inputs[i];
// inputs[i].checked= true
}
}
});

View File

@ -68,7 +68,10 @@ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
/* Modal Content */
.modal-content {
background-color: #fefefe;
margin: auto;
margin: auto;.loaded .loader {
top: -100%;
opacity: 0;
}
padding: 20px;
border: 1px solid #888;
width: 80%;
@ -204,10 +207,16 @@ margin-left: -16px;
<!-- loder -->
<div class="loader-wrapper">
<!-- <div class="loader-wrapper">
<div class="loader"></div>
<div class="loder-section left-section"></div>
<div class="loder-section right-section"></div>
</div> -->
<div id="overlay">
<div class="cv-spinner">
<span class="spinner"></span>
</div>
</div>
@ -266,7 +275,8 @@ margin-left: -16px;
</div>
<!-- jquery js -->
<script src="./node_modules/jquery/dist/jquery.min.js" onload="window.$ = window.jQuery = module.exports;"></script>
<script src="assets/js/vendor/jquery-3.2.1.min.js" onload="window.$ = window.jQuery = module.exports;"></script>
<!-- <script src="./node_modules/jquery/dist/jquery.min.js" onload="window.$ = window.jQuery = module.exports;"></script> -->
<!-- bootstrap js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- carousel js -->
@ -288,7 +298,7 @@ margin-left: -16px;
<!-- venobox min js -->
<script src="venobox/venobox.min.js"></script>
<!-- isotope js -->
<script src="assets/js/isotope.pkgd.min.js"></script>
<!-- <script src="assets/js/isotope.pkgd.min.js"></script> -->
<!-- jquery nivo slider pack js -->
<script src="assets/js/jquery.nivo.slider.pack.js"></script>
<!-- jquery meanmenu js -->
@ -452,6 +462,7 @@ function downloadFile(filename) {
console.log(xmlPath);
const xmlFilePath = `${xmlPath}${filename}`;
console.log(xmlFilePath)
const xmlFileNameParts = filename.split('.xml');
const xmlBaseName = xmlFileNameParts[0];
@ -501,22 +512,33 @@ if(fileList !== false)
console.log('isEncrypted NOT');
//Download XML FIle
console.log(xmlFilePath);
fs.writeFile(filePathToSave, xmlFilePath, 'utf-8', (err) => {
// //Download XML FIle
// console.log(xmlFilePath);
// fs.writeFile(filePathToSave, xmlFilePath, 'utf-8', (err) => {
var errorMessage = "";
if (err) {
// console.log(err.code);
if(err.code == 'EACCES'){
// var errorMessage = "";
// if (err) {
// // console.log(err.code);
// if(err.code == 'EACCES'){
// Download XML File
try {
const content = fs.readFileSync(xmlFilePath, 'utf-8');
console.log('xml', content);
fs.writeFileSync(filePathToSave, content, 'utf-8');
Swal.fire({
title: "File Downloaded",
icon: "success"
});
} catch (err) {
let errorMessage = "";
if (err.code === 'EACCES') {
errorMessage = `Permission Denied.<br> Path: ${filePathToSave}`;
}
else if(err.code == 'ENOENT'){
} else if (err.code === 'ENOENT') {
errorMessage = `No Such File Directory. <br> Path: ${filePathToSave}`;
}
else{
} else {
errorMessage = `Unknown Error. <br> Path: ${filePathToSave}`;
}
@ -525,35 +547,26 @@ if(fileList !== false)
html: errorMessage,
icon: "error"
});
} else {
}
// Download JSON File
if (fileList !== false) {
try {
const content = fs.readFileSync(jsonFilePath, 'utf-8');
console.log('json', content);
fs.writeFileSync(jsonFilePathToSave, content, 'utf-8');
Swal.fire({
title: "File Downloaded",
icon: "success"
});
}
});
//Download JSON FIle
if(fileList !== false)
{
fs.writeFile(jsonFilePathToSave, jsonFilePath, 'utf-8', (err) => {
var errorMessage = "";
if (err) {
console.log(err.code);
if(err.code == 'EACCES'){
} catch (err) {
let errorMessage = "";
if (err.code === 'EACCES') {
errorMessage = `Permission Denied.<br> Path: ${jsonFilePathToSave}`;
console.log(errorMessage);
}
else if(err.code == 'ENOENT'){
} else if (err.code === 'ENOENT') {
errorMessage = `No Such File Directory. <br> Path: ${jsonFilePathToSave}`;
console.log(errorMessage);
}
else{
} else {
errorMessage = `Unknown Error. <br> Path: ${jsonFilePathToSave}`;
console.log(errorMessage);
}
Swal.fire({
@ -561,16 +574,10 @@ if(fileList !== false)
html: errorMessage,
icon: "error"
});
} else {
Swal.fire({
title: "File Downloaded",
icon: "success"
});
}
});
}
}
}
@ -597,6 +604,30 @@ function findFile(filePath) {
}
}
function copyFile(sourceFilePath, destinationFilePath) {
// Resolve absolute paths
const sourcePath = path.resolve(sourceFilePath);
const destinationPath = path.resolve(destinationFilePath);
// Read the content of the source file
fs.readFile(sourcePath, 'utf8', (err, data) => {
if (err) {
console.error(`Error reading file: ${err.message}`);
return;
}
// Write the content to the destination file
fs.writeFile(destinationPath, data, 'utf8', (err) => {
if (err) {
console.error(`Error writing file: ${err.message}`);
return;
}
console.log(`File copied from ${sourcePath} to ${destinationPath}`);
});
});
}
</script>

View File

@ -306,6 +306,6 @@ function html2json() {
// console.log((formData));
// console.log(JSON.stringify(formData, null, 1));
localStorage.setItem("json", JSON.stringify((formData)));
// console.log(JSON.stringify(formData));
console.log(JSON.stringify(formData));
// console.log(OBJtoXML(({'question_paper' : formData})));
}

View File

@ -2,6 +2,7 @@
const fs = require('fs');
const xml2js = require('xml2js');
$("#overlay").show();
document.addEventListener('DOMContentLoaded', async () => {
@ -104,10 +105,11 @@ async function loadMultipleXMLs() {
// Call the function to load and display XML files
loadMultipleXMLs();
$("#overlay").hide();
});

View File

@ -89,6 +89,7 @@ function jsonToHtml(jsonData) {
localStorage.removeItem('scroll');
localStorage.removeItem('EditNavExpend');
localStorage.removeItem('json_Decode_Data_For_Mcq_Crt_Ans');
$("#overlay").hide();
}
@ -113,7 +114,8 @@ function QuestionsForEach(Question, questionAreaId, questionRandomNo,index){
var questionUUID = Question.attributes.Id;
var questionDisplayMarks = Question.display_marks;
var Choice = Question.answers;
var CorrectAnswer =Question.correct_answer;
var CorrectAnswer = Question.correct_answer;
var QuestionObj = {
@ -141,10 +143,7 @@ function QuestionsForEach(Question, questionAreaId, questionRandomNo,index){
}
else if (questionType == 'group')
{
// console.log(Question);
console.log(CorrectAnswer);
groupQuestion(false, false, false, questionTitle, questionDescription, questionType, questionSubType, mathEnabled, Choice, questionAreaId, questionRandomNo, questionMarks, questionUUID, questionDisplayMarks,questionId,CorrectAnswer[0]);
// groupQuestion(QuestionObj);
Choice = Choice.slice(1);
Choice.forEach(function(choicenames, indexs) {
var choiceName = choicenames.choice_name;
@ -159,6 +158,8 @@ function QuestionsForEach(Question, questionAreaId, questionRandomNo,index){
}
// $("#overlay").hide();
}
@ -176,3 +177,4 @@ function generateGroupQuestion(Question, questionAreaId, questionRandomNo)
QuestionsForEach(GroupQuestions, questionGroupAreaId, QuestionGroupRandomNo , index);
});
}

View File

@ -1,144 +1,7 @@
function json2xml() {
// console.clear();
var obj = localStorage.getItem("json");
// console.log(obj);
// var obj = `{
// "question_paper_title": "<p><br></p>",
// "question_paper_description": "<p><br></p>",
// "max_marks": "",
// "course_ID": "",
// "course_Code": "",
// "subject_ID": "",
// "subject_Code": "",
// "paper_No": "",
// "subject_Name": "",
// "sub_Paper_Prefix": "",
// "question_Paper_uuid": "f676ad21-b0d2-4a80-8c77-6cd2b35f1b34",
// "sections": [
// {
// "section_title": "<p>0</p>",
// "section_description": "<p><br></p>",
// "section_marks": "0",
// "section_uuid": "7c62e594-3b93-444f-9fa6-a05f87869db6",
// "section_display_marks": true,
// "section_attempt_any": "",
// "questions": [
// {
// "question": "<p>1</p>",
// "question_description": "<p><br></p>",
// "question_type": "group",
// "question_sub_type": false,
// "is_math_enabled": false,
// "display_marks": true,
// "marks": "",
// "choice_question_uuid": "40f37294-e7cb-4f19-9166-72f7a04f6391",
// "answers": [
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "387d9b85-4702-4e77-a8c3-29d713b7689e",
// "no": "a"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "1a6be686-9e7c-4b07-bf15-b9e07a01fd62",
// "no": "b"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "0640c05b-522e-422c-8050-0d5982aa3c74",
// "no": "c"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "e59f90b0-79d5-413e-85a4-ee3c181230d8",
// "no": "d"
// }
// ],
// "correct_answer": ["1a6be686-9e7c-4b07-bf15-b9e07a01fd62"]
// },
// {
// "question": "<p>2</p>",
// "question_description": "<p><br></p>",
// "question_type": "group",
// "question_sub_type": false,
// "is_math_enabled": false,
// "display_marks": true,
// "marks": "",
// "choice_question_uuid": "7a1c83e7-e9ae-4424-9336-6135eaa6b833",
// "answers": [
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "0cbb8330-8ce9-4d69-b547-68cee529a636",
// "no": "a"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "25dc4fdc-7bcf-4bea-aaa5-dc42a22c08b5",
// "no": "b"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "5b0da327-076f-488c-a46e-0b8251c83283",
// "no": "c"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "d3934305-d6fd-4601-8b1b-08067f47a8dd",
// "no": "d"
// }
// ],
// "correct_answer": ["d3934305-d6fd-4601-8b1b-08067f47a8dd"]
// },
// {
// "question": "<p>3</p>",
// "question_description": "<p><br></p>",
// "question_type": "group",
// "question_sub_type": false,
// "is_math_enabled": false,
// "display_marks": true,
// "marks": "",
// "choice_question_uuid": "6f929b53-9ebc-40fb-800e-46c42b75f2d9",
// "answers": [
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "f839312c-8de5-4cd5-8d6c-3ffd3b9efea6",
// "no": "a"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "905db769-82b2-4240-af06-fe0b15ee1f73",
// "no": "b"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "6a16126f-8100-49f8-ae33-71d4848030cf",
// "no": "c"
// },
// {
// "choice_name": "<p><br></p>",
// "is_math_enabled": false,
// "choice_uuid": "143f648a-d52c-42ff-9428-1c080326e1c8",
// "no": "d"
// }
// ],
// "correct_answer": ["143f648a-d52c-42ff-9428-1c080326e1c8", "6a16126f-8100-49f8-ae33-71d4848030cf"]
// }
// ]
// }
// ]
// }
// `
// console.log(obj);
// console.log('***********************************************************');

View File

@ -20,14 +20,48 @@ function navpane() {
function removeParagraphTags(html) {
// return html.replace(/<p>/g, '').replace(/<\/p>/g, '');
// var html = html.replaceAll(/<p>|<\/p>|<strong>|<\/strong>|<em>|<\/em>|<s>|<\/s>|<u>|<\/u>|<br>|style/g, '');
var html = html.replace(/<[^>]*>/g, '');
// console.log(html);
var html = html.replace(/<[^>]*>/g, '');
// if (html.length >= 30) {
// html=html.slice(0, 25) + '...';
// }
return html
}
//function for remove <img> tag
function removeTagsAndTruncate(html, maxLength) {
const doc = new DOMParser().parseFromString(html, 'text/html');
// Remove <p> tags
const paragraphs = doc.getElementsByTagName('p');
for (let i = paragraphs.length - 1; i >= 0; i--) {
const paragraph = paragraphs[i];
paragraph.parentNode.replaceChild(document.createTextNode(paragraph.textContent), paragraph);
}
// Remove <img> tags
const images = doc.getElementsByTagName('img');
for (let i = images.length - 1; i >= 0; i--) {
const image = images[i];
image.parentNode.removeChild(image);
}
// Get the text content
const textContent = doc.body.textContent;
// Truncate the content
var truncatedContent = "";
if(textContent.length > 20)
{
truncatedContent = textContent.substring(0, maxLength) + '...';
}
else{
truncatedContent = textContent;
}
return truncatedContent;
}
function createTreeWithHeading(data, container) {
@ -447,13 +481,23 @@ function navpane() {
nodeDiv.style.paddingLeft='0px';
currentlyHighlightedElement =null
});
if (nodeData.question.length > 20) {
// questionLink.innerHTML = removeParagraphTags(nodeData.question.substring(0, 20) + '...');
questionLink.innerHTML = removeParagraphTags(nodeData.question);
} else {
questionLink.innerHTML = removeParagraphTags(nodeData.question);
}
// if (nodeData.question.length > 20) {
// // questionLink.innerHTML = removeParagraphTags(nodeData.question.substring(0, 20) + '...');
// questionLink.innerHTML = removeParagraphTags(nodeData.question);
// } else {
// questionLink.innerHTML = removeParagraphTags(nodeData.question);
// }
questionLink.innerHTML = removeTagsAndTruncate(nodeData.question, 20);
// console.log('questionLink : ', questionLink)
nodeDiv.appendChild(questionLink);
} else if (nodeData.group_title) {

135
package-lock.json generated
View File

@ -74,9 +74,9 @@
}
},
"node_modules/@electron/asar": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.7.tgz",
"integrity": "sha512-8FaSCAIiZGYFWyjeevPQt+0e9xCK9YmJ2Rjg5SXgdsXon6cRnU0Yxnbe6CvJbQn26baifur2Y2G5EBayRIsjyg==",
"version": "3.2.8",
"resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.8.tgz",
"integrity": "sha512-cmskk5M06ewHMZAplSiF4AlME3IrnnZhKnWbtwKVLRkdJkKyUVjMLhDIiPIx/+6zQWVlKX/LtmK9xDme7540Sg==",
"dev": true,
"dependencies": {
"commander": "^5.0.0",
@ -152,9 +152,9 @@
}
},
"node_modules/@electron/notarize/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -208,18 +208,18 @@
}
},
"node_modules/@electron/osx-sign/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/@electron/universal": {
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.4.2.tgz",
"integrity": "sha512-ymGwXYBUGFS1DuTqYJwZ0p1gIlELKOf21zPJefij/amzV66vTXRNJ2mAtW0uRsaHfV+pzYTJVrt5oco44DFOMg==",
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.5.1.tgz",
"integrity": "sha512-kbgXxyEauPJiQQUNG2VgUeyfQNFk6hBF11ISN2PNI6agUgPl55pv4eQmaqHzTAzchBvqZ2tQuRVaPStGf0mxGw==",
"dev": true,
"dependencies": {
"@electron/asar": "^3.2.1",
@ -262,9 +262,9 @@
}
},
"node_modules/@electron/universal/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -351,9 +351,9 @@
}
},
"node_modules/@types/http-cache-semantics": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz",
"integrity": "sha512-V46MYLFp08Wf2mmaBhvgjStM3tPa+2GAdy/iqoX+noX1//zje2x4XmrIU0cAwyClATsTmahbtoQ2EwP7I5WSiA=="
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz",
"integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA=="
},
"node_modules/@types/keyv": {
"version": "3.1.4",
@ -365,27 +365,27 @@
}
},
"node_modules/@types/node": {
"version": "18.18.7",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.7.tgz",
"integrity": "sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==",
"version": "18.18.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.13.tgz",
"integrity": "sha512-vXYZGRrSCreZmq1rEjMRLXJhiy8MrIeVasx+PCVlP414N7CJLHnMf+juVvjdprHyH+XRy3zKZLHeNueOpJCn0g==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/@types/responselike": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.2.tgz",
"integrity": "sha512-/4YQT5Kp6HxUDb4yhRkm0bJ7TbjvTddqX7PZ5hz6qV3pxSo72f/6YPRo+Mu2DU307tm9IioO69l7uAwn5XNcFA==",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz",
"integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/yauzl": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.2.tgz",
"integrity": "sha512-Km7XAtUIduROw7QPgvcft0lIupeG8a8rdKL8RiSyKvlE7dYY31fEn41HVuQsRFDuROA8tA4K2UVL+WdfFmErBA==",
"version": "2.10.3",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz",
"integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==",
"dev": true,
"optional": true,
"dependencies": {
@ -662,9 +662,9 @@
"optional": true
},
"node_modules/bootstrap-icons": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.1.tgz",
"integrity": "sha512-F0DDp7nKUX+x/QtpfRZ+XHFya60ng9nfdpdS59vDDfs4Uhuxp7zym/QavMsu/xx51txkoM9eVmpE7D08N35blw==",
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.11.2.tgz",
"integrity": "sha512-TgdiPv+IM9tgDb+dsxrnGIyocsk85d2M7T0qIgkvPedZeoZfyeG/j+yiAE4uHCEayKef2RP05ahQ0/e9Sv75Wg==",
"funding": [
{
"type": "github",
@ -1084,16 +1084,19 @@
}
},
"node_modules/deep-equal": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz",
"integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz",
"integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==",
"dependencies": {
"is-arguments": "^1.0.4",
"is-date-object": "^1.0.1",
"is-regex": "^1.0.4",
"object-is": "^1.0.1",
"is-arguments": "^1.1.1",
"is-date-object": "^1.0.5",
"is-regex": "^1.1.4",
"object-is": "^1.1.5",
"object-keys": "^1.1.1",
"regexp.prototype.flags": "^1.2.0"
"regexp.prototype.flags": "^1.5.1"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@ -1230,6 +1233,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz",
"integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==",
"deprecated": "Use your platform's native DOMException instead",
"dependencies": {
"webidl-conversions": "^7.0.0"
},
@ -1285,9 +1289,9 @@
}
},
"node_modules/electron": {
"version": "26.4.2",
"resolved": "https://registry.npmjs.org/electron/-/electron-26.4.2.tgz",
"integrity": "sha512-BOfQUOIvsq5NnssWOMqcZnA5M0ull620wvQoJq3WhXN1wJAsWu+cdjHvREyxnHbArPkV+F+x3YAi5Dt+UKoqhw==",
"version": "26.6.1",
"resolved": "https://registry.npmjs.org/electron/-/electron-26.6.1.tgz",
"integrity": "sha512-4Vz9u0Jt/khPa/en2l8Jv6SWEfsK/ieWYtchl5j0clbNSjdeTucnEFOhz9B9WwsAmfQjxBnpuMZpmdBuyxq+wg==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
@ -1422,9 +1426,9 @@
}
},
"node_modules/electron-packager/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -1499,9 +1503,9 @@
}
},
"node_modules/electron-wix-msi/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -1814,9 +1818,9 @@
}
},
"node_modules/flora-colossus/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -1941,9 +1945,9 @@
}
},
"node_modules/galactus/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
@ -2552,9 +2556,9 @@
}
},
"node_modules/is-online/node_modules/http2-wrapper": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz",
"integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz",
"integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==",
"dependencies": {
"quick-lru": "^5.1.1",
"resolve-alpn": "^1.2.0"
@ -2968,6 +2972,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
"integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
"deprecated": "Use your platform's native DOMException instead",
"dependencies": {
"webidl-conversions": "^4.0.2"
}
@ -3633,9 +3638,9 @@
}
},
"node_modules/public-ip/node_modules/http2-wrapper": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.0.tgz",
"integrity": "sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-2.2.1.tgz",
"integrity": "sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==",
"dependencies": {
"quick-lru": "^5.1.1",
"resolve-alpn": "^1.2.0"
@ -3710,9 +3715,9 @@
}
},
"node_modules/punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"engines": {
"node": ">=6"
}
@ -4404,9 +4409,9 @@
}
},
"node_modules/sweetalert2": {
"version": "11.7.32",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.7.32.tgz",
"integrity": "sha512-44tNNe2oLe7T94mT6dus4hc9G7qg6jZU/K5qZzpNS6e5HGPrSF6Kie6oZ7B5puIJydB34V2h/8f5EhIFivYo4A==",
"version": "11.10.1",
"resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.10.1.tgz",
"integrity": "sha512-qu145oBuFfjYr5yZW9OSdG6YmRxDf8CnkgT/sXMfrXGe+asFy2imC2vlaLQ/L/naZ/JZna1MPAY56G4qYM0VUQ==",
"funding": {
"type": "individual",
"url": "https://github.com/sponsors/limonte"

View File

@ -3046,7 +3046,7 @@ a.main_sticky {
/*Loader*/
.loader-wrapper {
/* .loader-wrapper {
position: fixed;
top: 0;
bottom: 0;
@ -3056,8 +3056,8 @@ a.main_sticky {
height: 100%;
transition: 0.8s 1s ease;
z-index: 666;
}
.loader {
} */
/* .loader {
position: relative;
display: block;
z-index: 201;
@ -3104,10 +3104,10 @@ a.main_sticky {
-moz-animation: spin 2.5s linear infinite;
-o-animation: spin 2.5s linear infinite;
animation: spin 2.5s linear infinite;
}
} */
/* Here comes the Magic */
@-webkit-keyframes spin {
/* @-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
@ -3150,38 +3150,36 @@ a.main_sticky {
-o-transform: rotate(360deg);
transform: rotate(360deg);
}
}
} */
.loader-wrapper .loder-section {
/* .loader-wrapper .loder-section {
position: fixed;
top: 0;
width: 55%;
height: 100%;
background: #111;
z-index: 2;
}
.loader-wrapper .loder-section.left-section {
} */
/* .loader-wrapper .loder-section.left-section {
left: 0;
transition: 1s 1.5s ease;
}
.loader-wrapper .loder-section.right-section {
transition: 15s 2s ease;
}
.loader-wrapper .loder-section.right-section {
right: 0;
transition: 1s 1.5s ease;
}
transition: 15s 2s ease;
}
/* When page loaded */
.loaded .loder-section {
When page loaded
.loaded .loader-wrapper {
display: none;
transition: 1s 1.5s ease;
}
.loaded .loader-wrapper {
display: none;
transition: 1s 1.5s ease;
}
.loaded .loader {
transition: 10s 1.5s ease;
} */
/* .loaded .loader {
top: -100%;
opacity: 0;
}
} */
/* New Add CSS Class */
@ -3588,6 +3586,15 @@ margin-top: 5px;
font-weight: 500;
font-size: 14px;
}
.math2{
font-weight: 500;
font-size: 14px;
color: #061738;
position: relative;
right: 40px;
}
.mathQuestions{
font-weight: 500;
float: right;
@ -3760,6 +3767,7 @@ width:85px;
/* #questionPaper {
font-size:small;
text-decoration: none;
@ -3772,3 +3780,36 @@ font-weight: 500;
font-size: 14px;
}
#overlay{
position: fixed;
top: 0;
z-index: 100;
width: 100%;
height:100%;
display: none;
background: rgba(0,0,0,0.8);
}
.cv-spinner {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.spinner {
width: 120px;
height: 120px;
border: 16px #ddd solid;
border-top: 16px #2e93e6 solid;
border-radius: 50%;
animation: sp-anime 0.8s infinite linear;
}
@keyframes sp-anime {
100% {
transform: rotate(360deg);
}
}
.is-hide{
display:none;
}

View File

@ -67,7 +67,7 @@ function getQuestionsNodes(questionNode,type)
questionObj['answers'].push(tempChoiceobj);
}
}
if(jsonDecodeData !== null)
if(jsonDecodeData !== 'null' && jsonDecodeData !== null)
{
var jsonParsedData = JSON.parse(jsonDecodeData);