CODE MERGE : RV
This commit is contained in:
parent
287c859eaa
commit
a88dff4d4b
@ -75,6 +75,9 @@ function CheakQnType(question, questionIndex, depth,nested) {
|
|||||||
let count =0
|
let count =0
|
||||||
var count1 =0
|
var count1 =0
|
||||||
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,6 +86,7 @@ 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>`;
|
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>`;
|
||||||
@ -90,6 +94,8 @@ function processQuestion(question, questionIndex, depth,nested) {
|
|||||||
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 (question.question_type === "group") {
|
if (question.question_type === "group") {
|
||||||
@ -183,6 +189,7 @@ 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
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -316,6 +316,9 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log()
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -144,8 +144,8 @@ function promptBox() {
|
|||||||
return 'You need to enter Filename!'
|
return 'You need to enter Filename!'
|
||||||
}
|
}
|
||||||
else if (value){
|
else if (value){
|
||||||
const fileexists =fileexists(entervalue);
|
const fileexist = fileexists(entervalue);
|
||||||
if(fileexists){
|
if(fileexist){
|
||||||
Swal.update({ showDenyButton: true });
|
Swal.update({ showDenyButton: true });
|
||||||
return 'This file Name already exists'
|
return 'This file Name already exists'
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user