Merge branch 'dev' of bitbucket.org:venbainformationtechnology/projectb into dev
This commit is contained in:
commit
e32ea3e7d0
110
addform.html
110
addform.html
@ -419,7 +419,6 @@
|
||||
<div class="row section QuestionPaperClass" id="QuestionPaper">
|
||||
|
||||
<!-- QuestionPapper Title Start-->
|
||||
|
||||
<div class="question-papper-title element" style="border-top: solid; margin-bottom: 15px;">
|
||||
<input type="hidden" id="QuestionPaper_UUID_ID">
|
||||
<div class="col-lg-12 col-md-12">
|
||||
@ -834,6 +833,7 @@ navpane();
|
||||
html2json();
|
||||
|
||||
|
||||
// function for ONMOUSE HOVER to SHOW the side ADD BUTTONS
|
||||
function showButtons(container) {
|
||||
const buttons = container.querySelector('.buttons');
|
||||
const onhover = container.querySelector('.onhover');
|
||||
@ -845,6 +845,7 @@ function showButtons(container) {
|
||||
|
||||
}
|
||||
|
||||
// function for ONMOUSE HOVER to HIDE the side ADD BUTTONS
|
||||
function hideButtons(container) {
|
||||
const buttons = container.querySelector('.buttons');
|
||||
const onhover = container.querySelector('.onhover');
|
||||
@ -1214,11 +1215,14 @@ function addQuestionGroup(idObj)
|
||||
<input type="hidden" id="Question_Group_UUID_ID_${QuestionGroup_ID}" value="${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.attributes.Id : QuestionGroup_UUID}">
|
||||
<div class="groupsection" draggable='true' id="group_question_${QuestionGroup_ID}">
|
||||
<div class="sectionTitle" id="group_question_title_${QuestionGroup_ID}">
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
|
||||
<div onmouseover="showButtons(this)" id="QuestionGroupButtons_${QuestionGroup_ID}" class="row question element" style="border-top: 10px solid #a658f3; border-radius:10px; margin-top:5px;">
|
||||
|
||||
<div class="items align-items-center">
|
||||
<span onclick="ReArrangeQuestionsGroup(event)" id="forword_${QuestionGroup_ID}" class="fa fa-chevron-up up-icon"></span>
|
||||
<span onclick="ReArrangeQuestionsGroup(event)" id="backword_${QuestionGroup_ID}" class="fa fa-chevron-down down-icon"></span>
|
||||
</div>
|
||||
|
||||
<div class="row" style="text-align:right; width: 100%">
|
||||
<div class="col-lg-10 col-md-12">
|
||||
<div class=" button-group align-items-center">
|
||||
@ -1236,20 +1240,19 @@ function addQuestionGroup(idObj)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="dragHandle" class="drag-handle">
|
||||
<i class="fas fa-grip-horizontal"></i>
|
||||
</div>
|
||||
<div class="col-lg-12 col-md-12">
|
||||
<div class="form_box">
|
||||
<label>Quesions Group:</label>
|
||||
<label>Questions Group:</label>
|
||||
<div class="richText" id="subSection_title_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_title : ""}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12 hideondrag">
|
||||
<div class="form_box">
|
||||
<label>Quesions Group Description:</label>
|
||||
<label>Questions Group Description:</label>
|
||||
<div class="richText" id="subSection_description_text_${QuestionGroup_ID}" contenteditable="true" style=" border: 2px solid #EEECFE; margin-top: 4px;">${idObj.hasOwnProperty('question_group_obj') ? idObj.question_group_obj.group_description : ""}</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1476,7 +1479,6 @@ const value = localStorage.getItem('JSON_FOR_NAV')
|
||||
// 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)
|
||||
{
|
||||
|
||||
const ChoiceGroupFixed_UUID = uuidv4();
|
||||
|
||||
var groupQuestion = "";
|
||||
@ -1526,8 +1528,9 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
||||
<i class="fas fa-grip-horizontal"></i>
|
||||
</div>
|
||||
<div class="items hideondrag" style="display: none;">
|
||||
<i onclick="ReArrangeQuestions(event)" class="fa fa-chevron-up up-icon"></i>
|
||||
<i onclick="ReArrangeQuestions(event)" class="fa fa-chevron-down down-icon"></i>
|
||||
<i class="fa fa-trash-o" onclick="removeClonedQroupQuestion(${addChoiceAreaId})" style="font-size:20px;"aria-hidden="true"></i>
|
||||
<i class="fa fa-clone" id="cloneId_${addChoiceAreaId}" onclick="cloneQuestion(event, 2)" style="font-size:20px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1599,7 +1602,6 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
||||
<math-field id="choiceTextField_math_${addChoiceAreaId}" style="width: 100%;" contenteditable="true">${Choice ? Choice[0].choice_name : ""}</math-field>
|
||||
</div>
|
||||
<div class="items2 col-lg-4">
|
||||
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="deleteButton_${addChoiceAreaId}"></i>
|
||||
<input style="width:14px; height:14px" type="checkbox" id="Choicemath_${addChoiceAreaId}"> <span class="math">MATH</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -1978,8 +1980,8 @@ function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionR
|
||||
<math-field id="newchoiceTextField_math_`+text_field_created_time+rnd_no+`" style="width: 100%;" contenteditable="true">${choiceName ? choiceName : ""}</math-field>
|
||||
</div>
|
||||
<div class="items2 col-lg-4">
|
||||
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="newChoiceDeleteButton_`+text_field_created_time+rnd_no+`"></i>
|
||||
<input style="width:14px; height:14px" type="checkbox" id="choice_math_`+text_field_created_time+rnd_no+`"> <span class="math">MATH</span>
|
||||
<input style="width:14px; height:14px" type="checkbox" id="choice_math_`+text_field_created_time+rnd_no+`"> <span class="math">MATH</span>
|
||||
<i class="fa fa-trash-o" style="font-size:20px;" aria-hidden="true" id="newChoiceDeleteButton_`+text_field_created_time+rnd_no+`" title="Remove Choice"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>`
|
||||
@ -2182,8 +2184,9 @@ textQuestion +=
|
||||
</div>
|
||||
|
||||
<div class="items align-items-center hideondrag" style="display: none;">
|
||||
<i onclick="ReArrangeQuestions(event)" id="forword_${addTextQuestionId}" class="fa fa-chevron-up up-icon" ></i>
|
||||
<i onclick="ReArrangeQuestions(event)" id="backword_${addTextQuestionId}" class="fa fa-chevron-down down-icon"></i>
|
||||
<i class="fa fa-trash-o" onclick="removeClonedTextQuestion(${addTextQuestionId})" style="font-size:20px;"aria-hidden="true"></i>
|
||||
<i class="fa fa-clone" onclick="cloneQuestion(event, 1)" id="cloneId_${addTextQuestionId}" style="font-size:20px;" aria-hidden="true"></i>
|
||||
</div>
|
||||
<div class="col-lg-12 col-md-12 ">
|
||||
<input type="hidden" id="Text_Question_UUID_ID_${addTextQuestionId}" value="${QuestionObj.hasOwnProperty('questionUUID') ? QuestionObj.questionUUID : Text_Question_UUID}">
|
||||
@ -2444,6 +2447,86 @@ var inputElement = document.getElementById(Textid);
|
||||
}
|
||||
|
||||
|
||||
//function for Questions REORDER in the SECTION Level
|
||||
function ReArrangeQuestions(e){
|
||||
|
||||
var currentID= e.target.parentElement.parentElement.parentElement.id;
|
||||
console.log(currentID)
|
||||
var currentItemID = document.getElementById(currentID);
|
||||
console.log('currentItemID');
|
||||
console.log(currentItemID);
|
||||
|
||||
if (e.target.classList.contains('up-icon')) {
|
||||
|
||||
console.log('FORWORD');
|
||||
const question_ListItem = e.target.parentElement.parentElement;
|
||||
console.log('question_ListItem');
|
||||
console.log(question_ListItem);
|
||||
|
||||
const question_PrevItem = question_ListItem.previousElementSibling;
|
||||
console.log('question_PrevItem');
|
||||
console.log(question_PrevItem );
|
||||
|
||||
if (question_PrevItem !== null) {
|
||||
currentItemID.insertBefore(question_ListItem, question_PrevItem);
|
||||
}
|
||||
} else if (e.target.classList.contains('down-icon')) {
|
||||
|
||||
console.log('BACKWORD');
|
||||
const question_ListItem = e.target.parentElement.parentElement;
|
||||
console.log('question_ListItem');
|
||||
console.log(question_ListItem);
|
||||
|
||||
const question_nextItem = question_ListItem.nextElementSibling;
|
||||
console.log('question_nextItem');
|
||||
console.log(question_nextItem );
|
||||
|
||||
if (question_nextItem) {
|
||||
currentItemID.insertBefore(question_nextItem, question_ListItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//function for REORDER the Question Group in the SECTION Level
|
||||
function ReArrangeQuestionsGroup(e){
|
||||
|
||||
var currentID= e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.id;
|
||||
console.log(currentID)
|
||||
var currentItemID = document.getElementById(currentID);
|
||||
console.log('currentItemID');
|
||||
console.log(currentItemID);
|
||||
|
||||
if (e.target.classList.contains('up-icon')) {
|
||||
|
||||
console.log('FORWORD');
|
||||
const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
|
||||
console.log('question_ListItem');
|
||||
console.log(question_ListItem);
|
||||
|
||||
const question_PrevItem = question_ListItem.previousElementSibling;
|
||||
console.log('question_PrevItem');
|
||||
console.log(question_PrevItem );
|
||||
|
||||
if (question_PrevItem !== null) {
|
||||
currentItemID.insertBefore(question_ListItem, question_PrevItem);
|
||||
}
|
||||
} else if (e.target.classList.contains('down-icon')) {
|
||||
|
||||
console.log('BACKWORD');
|
||||
const question_ListItem = e.target.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
|
||||
console.log('question_ListItem');
|
||||
console.log(question_ListItem);
|
||||
|
||||
const question_nextItem = question_ListItem.nextElementSibling;
|
||||
console.log('question_nextItem');
|
||||
console.log(question_nextItem );
|
||||
|
||||
if (question_nextItem) {
|
||||
currentItemID.insertBefore(question_nextItem, question_ListItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Function for Add Group Question inside the Group QUestion Like Question
|
||||
function MultiLevelQuestionGroup(e)
|
||||
{
|
||||
@ -2533,6 +2616,7 @@ function cloneQuestion(e,type)
|
||||
// remove the cloned text type questions function
|
||||
function removeClonedTextQuestion(index)
|
||||
{
|
||||
alert('hi text');
|
||||
var element = document.getElementById('removeAndCloneTextQuestion_'+ index);
|
||||
if (element) {
|
||||
element.remove();
|
||||
@ -2542,6 +2626,8 @@ function removeClonedTextQuestion(index)
|
||||
// remove the cloned choice or group type questions function
|
||||
function removeClonedQroupQuestion(index)
|
||||
{
|
||||
alert('hi choice');
|
||||
|
||||
var element = document.getElementById('removeAndCloneQroupQuestion_'+ index);
|
||||
if (element) {
|
||||
element.remove();
|
||||
|
||||
@ -95,7 +95,10 @@ function generateSingleQuestions(ParentObjects)
|
||||
|
||||
var parentMarks = ParentObjects.parentMarks;
|
||||
var parentAttemptAny = ParentObjects.parentAttemptAny;
|
||||
var MarkDivideValue = parentMarks / parentAttemptAny;
|
||||
var DivideValue = parentMarks / parentAttemptAny;
|
||||
const twoDigitsAfterDecimal = DivideValue.toFixed(2);
|
||||
var MarkDivideValue = parseFloat(twoDigitsAfterDecimal);
|
||||
// console.log(MarkDivideValue)
|
||||
|
||||
// console.log('parentMarks : ', parentMarks);
|
||||
// console.log('new_parentAttemptAny : ', parentAttemptAny);
|
||||
|
||||
14
nav_pane.js
14
nav_pane.js
@ -6,7 +6,7 @@ function navpane() {
|
||||
let currentlyHighlightedElement = null; // Track the currently highlighted element
|
||||
// console.log('navpane called');
|
||||
var jsonData = JSON.parse(localStorage.getItem('JSON_FOR_NAV'));
|
||||
console.log(jsonData);
|
||||
// console.log(jsonData);
|
||||
// var arr = JSON.parse( localStorage.getItem('memoriesdata') );
|
||||
// var jsonData2 = JSON.parse(jsonData);
|
||||
// console.log(typeof jsonData);
|
||||
@ -38,7 +38,7 @@ function navpane() {
|
||||
var splitedSectionId = sectionId.split("_")[3];
|
||||
var SectionBox_RawID = 'SectionBox_'+splitedSectionId;
|
||||
var SectionBoxID = document.getElementById(SectionBox_RawID)
|
||||
console.log(SectionBoxID);
|
||||
// console.log(SectionBoxID);
|
||||
|
||||
|
||||
// Check if the section should be initially expanded based on expandedSections
|
||||
@ -146,7 +146,7 @@ function navpane() {
|
||||
// nodeDiv.id = nodeData.textQuestion_Id || nodeData.choice_question_id;
|
||||
const nodeDataId = nodeData.question_Id
|
||||
const nodeDataType = nodeData.question_type
|
||||
console.log('nodeDataType:',nodeDataType);
|
||||
// console.log('nodeDataType:',nodeDataType);
|
||||
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ function navpane() {
|
||||
}
|
||||
|
||||
var QuestionID = document.getElementById(RawID)
|
||||
console.log(QuestionID)
|
||||
// console.log(QuestionID)
|
||||
|
||||
const questionLink = document.createElement('a');
|
||||
questionLink.href = '#' + nodeDataId;
|
||||
@ -219,6 +219,7 @@ function navpane() {
|
||||
questionLink.style.fontWeight = questionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
||||
} else {
|
||||
questionLink.style.fontWeight = 'bold';
|
||||
QuestionID.style.fontWeight = 'normal';
|
||||
currentlyHighlightedElement = questionLink;
|
||||
}
|
||||
});
|
||||
@ -248,12 +249,12 @@ function navpane() {
|
||||
groupTitleDiv.setAttribute('data-id', groupTitleId);
|
||||
groupTitleDiv.className = 'question-group';
|
||||
|
||||
console.log(groupTitleId);
|
||||
// console.log(groupTitleId);
|
||||
|
||||
var splitedGroupId = groupTitleId.split("_")[3];
|
||||
var SplitedGroupRawID = 'QuestionGroupButtons_'+splitedGroupId;
|
||||
var GroupBoxID = document.getElementById(SplitedGroupRawID);
|
||||
console.log(GroupBoxID);
|
||||
// console.log(GroupBoxID);
|
||||
|
||||
|
||||
// Check if the group should be initially expanded based on expandedSections
|
||||
@ -332,6 +333,7 @@ function navpane() {
|
||||
groupQuestionLink.style.fontWeight = groupQuestionLink.style.fontWeight === 'bold' ? 'normal' : 'bold';
|
||||
} else {
|
||||
groupQuestionLink.style.fontWeight = 'bold';
|
||||
GroupBoxID.style.fontWeight = 'normal';
|
||||
currentlyHighlightedElement = groupQuestionLink;
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user