CHOICEANSWERCHECK ALIGNMENTINTRTE : AADHAVAN

This commit is contained in:
aadhavan 2023-12-01 13:04:34 +05:30
parent 87a9e1eb42
commit 8792c8653c
5 changed files with 94 additions and 30 deletions

View File

@ -164,6 +164,8 @@ function QuestionPaperPreview(jsonData){
GroupQuestionTilteAlign =40 GroupQuestionTilteAlign =40
}else if(question_id_length == 6) { }else if(question_id_length == 6) {
GroupQuestionTilteAlign =54 GroupQuestionTilteAlign =54
}else if(question_id_length == 2){
GroupQuestionTilteAlign =23
} }

View File

@ -44,12 +44,29 @@
<!-- <link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,600' rel='stylesheet' type='text/css'> --> <!-- <link href='https://fonts.googleapis.com/css?family=Titillium+Web:400,600' rel='stylesheet' type='text/css'> -->
<link rel="stylesheet" href="./node_modules/bootstrap-icons/font/bootstrap-icons.css"> <link rel="stylesheet" href="./node_modules/bootstrap-icons/font/bootstrap-icons.css">
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css"> --> <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css"> -->
<link rel="stylesheet" href="./node_modules/quill/dist/quill.snow.css" type="text/css" media="all" />
<style> <style>
.ql-align-justify{
}
.ql-align-right{
inline-size: 700px;
text-wrap: wrap;
/* margin-top: -27px !important; */
text-align: right;
}
.ql-align-center {
inline-size: 700px;
text-wrap: wrap;
/* margin-top: -27px !important; */
text-align: center;
}
table { table {
border-collapse: collapse; /* Set to 'collapse' for adjacent cell borders to collapse into one */ border-collapse: collapse; /* Set to 'collapse' for adjacent cell borders to collapse into one */
text-indent: 0; /* Reset text indentation */ text-indent: 0; /* Reset text indentation */
@ -518,14 +535,40 @@ setTimeout(() => {
<script> <script>
function thisclassnameWhenPaste() { function thisclassnameWhenPaste() {
var elements = document.querySelectorAll('.ql-align-justify'); var a =document.querySelectorAll('.text-qus-align');
//add the question_text class name for Justify Algin in question
a.forEach(function (aa) {
var elements = aa.querySelectorAll('.ql-align-justify');
elements.forEach(function(element) { elements.forEach(function(element) {
element.classList.add('question_Text'); element.classList.add('question_Text');
element.classList.remove('ql-align-justify') // element.classList.remove('ql-align-justify')
}); });
})
a.forEach(function (aa) {
var elements = aa.querySelectorAll('.ql-align-right');
elements.forEach(function(element) {
element.classList.add('question_Text');
// element.classList.remove('ql-align-justify')
});
})
a.forEach(function (aa) {
var elements = aa.querySelectorAll('.ql-align-center');
elements.forEach(function(element) {
element.classList.add('question_Text');
// element.classList.remove('ql-align-justify')
});
})
} }
setInterval(thisclassnameWhenPaste, 1000); setInterval(thisclassnameWhenPaste, 1000);

View File

@ -54,12 +54,26 @@
<script id="MathJax-script" async src="./node_modules/mathjax/es5/tex-mml-chtml.js"></script> <script id="MathJax-script" async src="./node_modules/mathjax/es5/tex-mml-chtml.js"></script>
<style> <style>
/* Start custom css for table icon options in RTE editor */
.ql-picker.ql-table:nth-of-type(1) .ql-picker-options {
width: 310px !important;
}
/* End custom css for table icon options in RTE editor */
/* start custom css for Alignment icon options in RTE editor */
.ql-icon-picker .ql-picker-item{
width: 24px !important;
}
/* End custom css for Alignment icon options in RTE editor */
/* [data-value="remove-table"] { /* [data-value="remove-table"] {
border: 1px solid black !important; border: 1px solid black !important;
} */ } */
.ql-picker-options{ /* .ql-picker-options{
width: 310px !important; width: 310px !important;
} } */
.ql-picker-item{ .ql-picker-item{
width: 95px !important; width: 95px !important;
} }
@ -4131,7 +4145,7 @@ function check_Empty_Question()
} }
function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) { function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) {
// console.log('IdToRemove : ', IdToRemove); console.log('IdToRemove : ', IdToRemove);
@ -4143,7 +4157,7 @@ function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) {
if (DeleteElement != 1) { if (DeleteElement != 1) {
var a = IdToRemove; var a = IdToRemove;
var newVariableWithoutNumbers = a.replace(/\d/g, ''); // This removes all digits var newVariableWithoutNumbers = a.replace(/\d/g, ''); // This removes all digits
} }
@ -4165,7 +4179,7 @@ function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) {
const input_text_value = document.getElementById(IdToRemove); const input_text_value = document.getElementById(IdToRemove);
if (newVariableWithoutNumbers == 'removeAndCloneQroupQuestion_') { if (newVariableWithoutNumbers == 'removeAndCloneQroupQuestion_') {
attrId= ''; attrId= 'choice';
} else { } else {
attrId = input_text_value.querySelector('.ql-editor')?.innerHTML; attrId = input_text_value.querySelector('.ql-editor')?.innerHTML;
} }
@ -4184,20 +4198,24 @@ function check_Remove_Empty_Question(IdToRemove , DeleteElement=0) {
} }
if (Id === IdToRemove && DeleteElement ==0) { if (Id === IdToRemove && DeleteElement ==0) {
console.log("Id == Idremove"); //console.log("Id == Idremove");
if (attrId !== '<p><br></p>' && attrId !== "") { if (attrId !== '<p><br></p>' && attrId !== "") {
parsedArray.splice(i, 1); parsedArray.splice(i, 1);
i--; i--;
} }
}else if (DeleteElement) { }else if (DeleteElement) {
console.log("section"); //console.log("section");
console.log(parsedArray); // console.log(parsedArray);
parsedArray.splice(i, 1); parsedArray.splice(i, 1);
console.log(parsedArray); //console.log(parsedArray);
i--; i--;
}else{ }else if(Id === IdToRemove){
console.log("last part"); parsedArray.splice(i, 1);
i--;
}
else{
// console.log("last part");
var newArray = parsedArray.push(IdToRemove); var newArray = parsedArray.push(IdToRemove);
const newArrayString = JSON.stringify(newArray); const newArrayString = JSON.stringify(newArray);
// console.log(newArrayString); // console.log(newArrayString);
@ -5077,6 +5095,10 @@ function findInputByValue(value) {
} }
removeDuplicates(); removeDuplicates();
} }
setInterval(removeDuplicatesparams_in_localstorage,2000) setInterval(removeDuplicatesparams_in_localstorage,2000)
</script> </script>
@ -5140,15 +5162,12 @@ function findInputByValue(value) {
setInterval(addTitleforTable,2000) setInterval(addTitleforTable,2000)
</script> </script>
<!-- <script>
function name(params) { <script>
var elements= document.querySelectorAll('.multipleAnswerorNot')
elements.forEach(function (element) {
console.log(element.checked);
}) </script>
}
setInterval(name,5000)
</script> -->
</body> </body>
</html> </html>

View File

@ -303,7 +303,7 @@ function html2json() {
}); });
// console.log((formData)); console.log((formData));
// console.log(JSON.stringify(formData, null, 1)); // console.log(JSON.stringify(formData, null, 1));
localStorage.setItem("json", JSON.stringify((formData))); localStorage.setItem("json", JSON.stringify((formData)));
console.log(JSON.stringify(formData)); console.log(JSON.stringify(formData));

View File

@ -2,7 +2,7 @@ function json2xml() {
// console.clear(); // console.clear();
var obj = localStorage.getItem("json"); var obj = localStorage.getItem("json");
// console.log(obj); console.log(obj);
// console.log('***********************************************************'); // console.log('***********************************************************');
function createXMLDocument(namespace = null) { function createXMLDocument(namespace = null) {
@ -122,7 +122,7 @@ function json2xml() {
// 'No': singleQuestion['group_title'], // 'No': singleQuestion['group_title'],
// 'Order': 0 // 'Order': 0
// }); // });
var groupQuestionId = createElementWithText(doc, element, 'Text', singleQuestion['group_id']); var groupQuestionId = createElementWithText(doc, element, 'Text', singleQuestion['question_id']);
var groupQuestionTitle = createElementWithText(doc, element, 'Text', singleQuestion['group_title']); var groupQuestionTitle = createElementWithText(doc, element, 'Text', singleQuestion['group_title']);
var groupQuestionDesc = createElementWithText(doc, element, 'Subtext', singleQuestion['group_description']); var groupQuestionDesc = createElementWithText(doc, element, 'Subtext', singleQuestion['group_description']);
var groupQuestionMarks = createElementWithText(doc, element, 'Marks', singleQuestion['group_marks']); var groupQuestionMarks = createElementWithText(doc, element, 'Marks', singleQuestion['group_marks']);