NAVPANECHANGE PREVIEWATTEMPT_MARK : AADHAVAN

This commit is contained in:
aadhavan 2023-11-13 18:10:15 +05:30
parent e665e388b7
commit 0d655d7898
7 changed files with 127 additions and 115 deletions

View File

@ -85,8 +85,20 @@ function QuestionPaperPreview(jsonData){
const sectionTitle = section.section_title;
const modifiedSectionTitle = sectionTitle.replaceAll('<p>', '<p id="sectionTitle">');//add the id for Section Title
var sectionAttempt = `<p id="sectionAttempt">Attempt Any : ${section.section_attempt_any}</p>`;
var sectionMark = `<p id="sectionMark">Marks: ${section.section_marks}</p>`;
// console.log(section.section_attempt_any);
if (section.section_attempt_any) {
var sectionAttempt = `<p id="sectionAttempt">Attempt Any : ${section.section_attempt_any}</p>`;
} else {
var sectionAttempt = `<p id="sectionAttempt"> </p>`;
}
if (section.section_marks == 0 || section.section_marks == '') {
var sectionMark = `<p id="sectionMark"> </p>`;
} else {
var sectionMark = `<p id="sectionMark">Marks: ${section.section_marks}</p>`;
}
const sectionDescriptio = section.section_description;
const sectionDescription = sectionDescriptio.replaceAll('<p>', '<p class="section-Description">');
// const questions = section.questions;
@ -133,8 +145,19 @@ function QuestionPaperPreview(jsonData){
if (question.group_title) {
const questionGroupSetP = `${question.group_title}`;
const questionGroupmodify =questionGroupSetP.replaceAll('<p>', `<p id="question-Group-Id" style="padding-left:${description_align}px">`)
var questionGroupAttempt = `<p id="group_attempt_any" class="GroupAttempAny">Attempt Any : ${question.group_attempt_any} </p>`
var questionGroupMark = `<p id="group_marks">Marks : ${question.group_marks} </p>`
if (question.group_attempt_any) {
var questionGroupAttempt = `<p id="group_attempt_any" class="GroupAttempAny">Attempt Any : ${question.group_attempt_any} </p>`
}else{
var questionGroupAttempt = `<p id="group_attempt_any" class="GroupAttempAny"> </p>`
}
if (question.group_marks === 0 || question.group_marks === '') {
var questionGroupMark = `<p id="group_marks"> </p>`
}else{
var questionGroupMark = `<p id="group_marks">Marks : ${question.group_marks} </p>`
}
const questionGroupDescriptio = question.group_description;
const questionGroupDescription = questionGroupDescriptio.replaceAll('<p>', '<p class="question-Group-Description">')
@ -160,7 +183,13 @@ function QuestionPaperPreview(jsonData){
const questionDescriptio = question.question_description;
const questionDescription = questionDescriptio.replaceAll('<p>', '<p class="question-Description">')
const mathstatus = question.is_math_enabled;
var questionMark = `<p id="question-mark">Marks :${question.marks}</p>`;
if (question.marks == 0 || question.marks == '') {
var questionMark = `<p id="question-mark"> </p>`;
} else {
var questionMark = `<p id="question-mark">Marks :${question.marks}</p>`;
}
// console.log(questionMark);
const multipleAnswer =question.question_sub_type;
if (question.marks == '') {

View File

@ -191,7 +191,7 @@
.text-qus-align p{ margin:0; }
.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 p{ margin:0; }
.text-option-align p{ margin:0; text-wrap: balance;}
/* #sectionTitle {border-top: 2px solid gray
; width:99%;} */
/* #sectionTitle:first-of-type {border:none;} */
@ -456,7 +456,7 @@ $(document).ready(function() {
setTimeout(() => {
var parentDiv = $('.text-qus-align');
var firstParagraph = parentDiv.find('.question_Text:first-child');
console.log(parentDiv);
// console.log(parentDiv);
// Remove the style attribute from the first <p> tag
if (firstParagraph.length > 0) {

View File

@ -2,6 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Project-B</title>
@ -45,10 +46,18 @@
<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="C:\Users\aadha\projectb\node_modules\quill-image-resize\image-resize.min.js"></script>
<script src="assets/js/quill.js"></script>
<script src="assets/css/quill.snow.css"></script>
<script src="./node_modules/quill-image-resize-module/image-resize.min.js"></script>
<script src="./node_modules/quill-resize-module/dist/resize.js"></script>
<link rel="stylesheet" href="./node_modules/quill-resize-module/dist/resize.css">
<style>
@ -61,7 +70,9 @@
/* transform-origin: top left; */
/* } */
.ql-align.ql-picker.ql-icon-picker{
margin-top: -10px;
}
#editPreview{
color: #7018d4;
@ -261,6 +272,20 @@
width: 285px;
height: -webkit-fill-available;
}
#questionPaper strong em{
font-weight: 100;
font-style: normal;
}
#questionPaper u{
text-decoration: none;
}
#questionPaper s{
text-decoration: none;
}
#questionPaper strong{
font-weight: 100;
}
#page-content-wrapper {
min-width: 100%;
}
@ -826,7 +851,6 @@ $(document).ready(function() {
// console.log(isEncrypted);
$('.ql-toolbar').hide(); // Hide the Quill Text Editor if PAge load
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
@ -860,7 +884,7 @@ document.addEventListener('DOMContentLoaded', function () {
// Add a click event listener to the button
scrollToTopBtn.addEventListener('click', keepCursorAtPosition);
scrollToTopBtn2.addEventListener('click', keepCursorAtPosition);
// scrollToTopBtn2.addEventListener('click', keepCursorAtPosition);
});
@ -991,8 +1015,8 @@ function saveFile(flag=0) {
const { v4: uuidv4 } = require('uuid');
const Quill = require('quill');
const ImageResize = require('quill-image-resize')
const ImageResize =require('quill-image-resize-module');
Quill.register('modules/imageResize', ImageResize);
const Question_Paper_UUID = uuidv4();
@ -1018,95 +1042,45 @@ var quill = new Quill('#Question_title', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
}
}
});
var quill = new Quill('#Question_description', {
theme: 'snow',
modules: {
toolbar: toolbarOptions,
toolbar:{
container:toolbarOptions,
clipboard: {
matchVisual: true,
},
ImageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
},
}
});
// var quill = new Quill('', {
// theme: 'snow',
// modules: {
// imageResize: {
// displaySize: true
// }
// }
// });
var quill = new Quill('#ql-editor',{
theme:'snow',
module:{
ImageResize:{
displaySize:true,
modules: [ 'Resize', 'DisplaySize', 'Toolbar' ]
}
}
})
// function imageHandler() {
// var range = this.quill.getSelection();
// var quill = new Quill('#editor-container', {
// theme: 'snow',
// modules: {
// toolbar: {
// container: [['image']],
// handlers: {
// image: imageHandler
// }
// }
// },
// });
// var value = prompt('hello');
// console.log(value);
// this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER);
// }
function imageHandler() {
var range = this.quill.getSelection();
var value = prompt('What is the image URL');
this.quill.insertEmbed(range.index, 'image', value, Quill.sources.USER);
}
// const ImageResize = require('quill-image-resize');
// console.log(ImageResize);
// Quill.register('modules/imageResize', ImageResize);
// const quill = new Quill('#editor', {
// modules: {
// toolbar: [
// // Your toolbar options here
// ],
// imageResize: {
// modules: ['Resize', 'DisplaySize', 'Toolbar'],
// handleStyles: {
// backgroundColor: 'black',
// border: 'none',
// color: 'white',
// cursor: 'pointer',
// },
// handleResize: function (image, callback) {
// // Callback function to handle image resizing
// callback(originalWidth, originalHeight, width, height);
// },
// }
// },
// theme: 'snow'
// });
// var quill = new Quill('#editor', {
// theme: 'snow',
// modules: {
// toolbar: toolbarOptions,
// clipboard: true,
// imageResize: {
// displaySize: true, // Show the resize handles and display image size
// handleStyles: {
// backgroundColor: 'black',
// border: 'none',
// color: 'white'
// },
// modules: ['Resize', 'DisplaySize', 'Toolbar']
// }
// }
// });
var Question_title_Div = $("#Question_title");
var Question_title_previousDiv = Question_title_Div.prev();
@ -1424,10 +1398,12 @@ 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: toolbarOptions
toolbar: toolbarOptions,
},
});
@ -3719,7 +3695,7 @@ setInterval(clearClipboardAttributes, 2000);
}
setInterval(removeQlBlank,2000)
</script>
<!--
<script>
quill.on('editor-change', function(eventName, ...args) {
if (eventName === 'text-change' && args[1].ops) {
@ -3732,7 +3708,7 @@ setInterval(clearClipboardAttributes, 2000);
});
}
});
</script>
</script> -->
<!-- <script>

View File

@ -121,6 +121,11 @@ function navpane() {
}
// s {
// text-decoration: none !important;
// color: inherit;
// cursor: auto;
// }
var sectionLink = document.createElement('a');
sectionLink.href = '#' + section.section_id;
@ -130,7 +135,8 @@ function navpane() {
sectionLink.style.display ='-webkit-inline-box';
sectionLink.style.maxWidth = '190px';
sectionLink.style.fontWeight = '100';
// Attach the scroll function to the hyperlinks
// Attach the scroll function to the hyperlinks
sectionLink.addEventListener('click', function(e) {
e.preventDefault(); // Prevent the default behavior of the link
const targetId = this.getAttribute('href').substring(1); // Get the target element's ID
@ -139,11 +145,7 @@ function navpane() {
sectionLink.style.color = '#000000';
// sectionLink.style.fontSize = '12px'
// sectionDiv.style.fontWeight = 'normal';
sectionDiv.style.textDecoration = 'none';
sectionLink.style.fontWeight = '100';
sectionLink.style.fontStyle = 'none';
//click event listener to toggle highlighting and boldness if click the Section
// sectionLink.addEventListener('click', function () {
// if (currentlyHighlightedElement !== null && currentlyHighlightedElement !== sectionLink) {
@ -163,17 +165,13 @@ function navpane() {
currentlyHighlightedElement.style.fontWeight = '100';
}
// questionLink.style.fontWeight = '500';
// sectionDiv.style.fontWeight = '500';
sectionDiv.style.backgroundColor ='#fcdddd';
sectionDiv.style.border = '5px solid #fcdddd';
// sectionDiv.style.borderRadius = '5px';
sectionDiv.style.color ='black';
sectionDiv.style.marginLeft ='-67px';
sectionDiv.style.paddingLeft='67px';
sectionDiv.style.marginRight= '-75px'
sectionLink.style.fontWeight = '100';
currentlyHighlightedElement = sectionLink;
currentlyHighlightedElement = sectionLink;
});
@ -183,15 +181,9 @@ function navpane() {
}
sectionDiv.style.backgroundColor='white'
sectionDiv.style.border='white'
// sectionDiv.style.fontWeight = 'normal';
sectionDiv.style.textDecoration = 'none';
sectionLink.style.fontWeight = '100';
console.log();
// sectionLink.style.fontWeight = sectionLink.style.fontWeight === '500' ? 'normal' : '500';
});
// SectionBoxID.addEventListener('click', function() {
// if (currentlyHighlightedElement !== null && currentlyHighlightedElement !== sectionLink) {
@ -211,7 +203,6 @@ function navpane() {
currentlyHighlightedElement.style.fontWeight = '100';
}
// sectionDiv.style.fontWeight = '500';
sectionDiv.style.backgroundColor ='#fcdddd';
sectionDiv.style.border = '5px solid #fcdddd';
sectionDiv.style.borderRadius = '5px';
@ -220,7 +211,7 @@ function navpane() {
sectionDiv.style.paddingLeft='67px';
sectionDiv.style.marginRight= '-75px'
sectionLink.style.fontWeight = '100';
// sectionLink.style.fontWeight = 'bold';
currentlyHighlightedElement = sectionLink;
});
@ -230,10 +221,7 @@ function navpane() {
}
sectionDiv.style.backgroundColor='white'
sectionDiv.style.border='white'
// sectionDiv.style.fontWeight = 'normal'
sectionLink.style.fontWeight = '100';
// sectionLink.style.fontWeight = sectionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
sectionLink.style.fontWeight = '100';
});

9
package-lock.json generated
View File

@ -29,6 +29,7 @@
"quill": "^1.3.7",
"quill-image-resize": "^3.0.9",
"quill-image-resize-module": "^3.0.0",
"quill-resize-module": "^1.2.4",
"sweetalert2": "^11.6.13",
"tinymce": "^6.7.0",
"tippy.js": "^6.3.7",
@ -3180,6 +3181,14 @@
"raw-loader": "^0.5.1"
}
},
"node_modules/quill-resize-module": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/quill-resize-module/-/quill-resize-module-1.2.4.tgz",
"integrity": "sha512-toBGslzfzxXlokN7d7naL6iq2Da5mDS4zzvyES2YpqwBqO/yrxHR1rylz0D1zLHAZcF+aeDWBNwktrYQMN5vGw==",
"dependencies": {
"extend": "^3.0.2"
}
},
"node_modules/raw-loader": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz",

View File

@ -36,6 +36,7 @@
"quill": "^1.3.7",
"quill-image-resize": "^3.0.9",
"quill-image-resize-module": "^3.0.0",
"quill-resize-module": "^1.2.4",
"sweetalert2": "^11.6.13",
"tinymce": "^6.7.0",
"tippy.js": "^6.3.7",

View File

@ -3751,4 +3751,13 @@ width:85px;
}
::-webkit-scrollbar-track {
background-color: #f5f5f5;
}
}
/* #questionPaper {
font-size:small;
text-decoration: none;
font-weight: 100;
font-style: normal !important;
} */