CONFLICT-SV
This commit is contained in:
commit
3895631fa1
91
addform.html
91
addform.html
@ -605,7 +605,7 @@
|
|||||||
<div style="margin-bottom: 9px;">Reorder sections</div>
|
<div style="margin-bottom: 9px;">Reorder sections</div>
|
||||||
<ul id="output" class="">
|
<ul id="output" class="">
|
||||||
<!-- <div style="margin-bottom: 9px;">Reorder sections</div> -->
|
<!-- <div style="margin-bottom: 9px;">Reorder sections</div> -->
|
||||||
|
Reorder sections
|
||||||
</ul>
|
</ul>
|
||||||
<div class="popup-save form-button">
|
<div class="popup-save form-button">
|
||||||
<button class="closePopupButton">Close</button>
|
<button class="closePopupButton">Close</button>
|
||||||
@ -1619,7 +1619,14 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
|||||||
const text_field_created_time = Date.now();// random number for dynamic ID - using current date time
|
const text_field_created_time = Date.now();// random number for dynamic ID - using current date time
|
||||||
localStorage.setItem('questionsId', text_field_created_time);
|
localStorage.setItem('questionsId', text_field_created_time);
|
||||||
|
|
||||||
var addChoiceAreaId = "";
|
//set Default value
|
||||||
|
var addChoiceAreaId = false;
|
||||||
|
var marks = ""
|
||||||
|
var UUID = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(questionRandomNo)
|
if(questionRandomNo)
|
||||||
{
|
{
|
||||||
addChoiceAreaId = questionRandomNo;
|
addChoiceAreaId = questionRandomNo;
|
||||||
@ -1629,7 +1636,6 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
|||||||
|
|
||||||
localStorage.setItem('ChoiceId', addChoiceAreaId);
|
localStorage.setItem('ChoiceId', addChoiceAreaId);
|
||||||
|
|
||||||
var marks = ""
|
|
||||||
if(questionMarks)
|
if(questionMarks)
|
||||||
{
|
{
|
||||||
marks = questionMarks;
|
marks = questionMarks;
|
||||||
@ -1639,7 +1645,6 @@ function groupQuestion(question_id = false, section_id = false , group_question_
|
|||||||
marks = "";
|
marks = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
var UUID = "";
|
|
||||||
if(questionUUID)
|
if(questionUUID)
|
||||||
{
|
{
|
||||||
UUID = questionUUID;
|
UUID = questionUUID;
|
||||||
@ -2096,10 +2101,12 @@ markCalculation();
|
|||||||
|
|
||||||
//Function for Create a New Choice Field in a Choice Question
|
//Function for Create a New Choice Field in a Choice Question
|
||||||
function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionRandomNo = false, choiceID = false, choice_mathEnabled= false)
|
function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionRandomNo = false, choiceID = false, choice_mathEnabled= false)
|
||||||
|
// function addNewChoice(choiceObj)
|
||||||
{
|
{
|
||||||
const Choice_Group_Dynamic_UUID = uuidv4();
|
|
||||||
|
|
||||||
addChoice = "";
|
addChoice = "";
|
||||||
|
|
||||||
|
const Choice_Group_Dynamic_UUID = uuidv4();
|
||||||
const text_field_created_time = Date.now();
|
const text_field_created_time = Date.now();
|
||||||
var rnd_no = Math.random();
|
var rnd_no = Math.random();
|
||||||
|
|
||||||
@ -2119,16 +2126,16 @@ function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionR
|
|||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
|
|
||||||
if(questionRandomNo)
|
if(questionRandomNo)
|
||||||
{
|
{
|
||||||
var addChoiceAreaId = 'addChoiceArea_'+questionRandomNo;
|
var addChoiceAreaId = 'addChoiceArea_'+questionRandomNo;
|
||||||
var addChoiceAreaId2 = document.getElementById(addChoiceAreaId);
|
var addChoiceAreaId2 = document.getElementById(addChoiceAreaId);
|
||||||
addChoiceAreaId2.insertAdjacentHTML('beforeend', addChoice);
|
addChoiceAreaId2.insertAdjacentHTML('beforeend', addChoice);
|
||||||
}
|
}
|
||||||
else if(NewaddChoiceAreaId)
|
else if(NewaddChoiceAreaId)
|
||||||
{
|
{
|
||||||
NewaddChoiceAreaId.insertAdjacentHTML('beforeend', addChoice);
|
NewaddChoiceAreaId.insertAdjacentHTML('beforeend', addChoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var newChoiceCommentButtonId = document.getElementById('newChoiceCommentButton_'+text_field_created_time+rnd_no);
|
var newChoiceCommentButtonId = document.getElementById('newChoiceCommentButton_'+text_field_created_time+rnd_no);
|
||||||
@ -2146,8 +2153,6 @@ $(newChoiceDeleteButtonId).on('click', function() {
|
|||||||
$(newChoiceCommentFieldDeleteId).remove();
|
$(newChoiceCommentFieldDeleteId).remove();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var newChoiceTextField = document.getElementById('newChoiceTextField_'+text_field_created_time+rnd_no);
|
var newChoiceTextField = document.getElementById('newChoiceTextField_'+text_field_created_time+rnd_no);
|
||||||
var quill = new Quill(newChoiceTextField, {
|
var quill = new Quill(newChoiceTextField, {
|
||||||
theme: 'snow',
|
theme: 'snow',
|
||||||
@ -2227,15 +2232,6 @@ $(newChoiceDeleteButtonId).on('click', function() {
|
|||||||
$(newchoiceTextField_math_Id).hide();
|
$(newchoiceTextField_math_Id).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
json2nav();
|
json2nav();
|
||||||
clearSidebarWrapper();
|
clearSidebarWrapper();
|
||||||
navpane();
|
navpane();
|
||||||
@ -2277,6 +2273,12 @@ textQuestion +=
|
|||||||
<i class="fas fa-grip-horizontal"></i>
|
<i class="fas fa-grip-horizontal"></i>
|
||||||
</div>
|
</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>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row" style="text-align:right; width: 100%" id="overallAddButtons_${addTextQuestionId}" >
|
<div class="row" style="text-align:right; width: 100%" id="overallAddButtons_${addTextQuestionId}" >
|
||||||
<div class="col-lg-10 col-md-12">
|
<div class="col-lg-10 col-md-12">
|
||||||
<div class=" button-group align-items-center">
|
<div class=" button-group align-items-center">
|
||||||
@ -2315,12 +2317,6 @@ textQuestion +=
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-12 col-md-12 ">
|
<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}">
|
<input type="hidden" id="Text_Question_UUID_ID_${addTextQuestionId}" value="${QuestionObj.hasOwnProperty('questionUUID') ? QuestionObj.questionUUID : Text_Question_UUID}">
|
||||||
<div class="form_box">
|
<div class="form_box">
|
||||||
@ -2582,35 +2578,35 @@ var inputElement = document.getElementById(Textid);
|
|||||||
function ReArrangeQuestions(e){
|
function ReArrangeQuestions(e){
|
||||||
|
|
||||||
var currentID= e.target.parentElement.parentElement.parentElement.id;
|
var currentID= e.target.parentElement.parentElement.parentElement.id;
|
||||||
console.log(currentID)
|
// console.log(currentID)
|
||||||
var currentItemID = document.getElementById(currentID);
|
var currentItemID = document.getElementById(currentID);
|
||||||
console.log('currentItemID');
|
// console.log('currentItemID');
|
||||||
console.log(currentItemID);
|
// console.log(currentItemID);
|
||||||
|
|
||||||
if (e.target.classList.contains('up-icon')) {
|
if (e.target.classList.contains('up-icon')) {
|
||||||
|
|
||||||
console.log('FORWORD');
|
// console.log('FORWORD');
|
||||||
const question_ListItem = e.target.parentElement.parentElement;
|
const question_ListItem = e.target.parentElement.parentElement;
|
||||||
console.log('question_ListItem');
|
// console.log('question_ListItem');
|
||||||
console.log(question_ListItem);
|
// console.log(question_ListItem);
|
||||||
|
|
||||||
const question_PrevItem = question_ListItem.previousElementSibling;
|
const question_PrevItem = question_ListItem.previousElementSibling;
|
||||||
console.log('question_PrevItem');
|
// console.log('question_PrevItem');
|
||||||
console.log(question_PrevItem );
|
// console.log(question_PrevItem );
|
||||||
|
|
||||||
if (question_PrevItem !== null) {
|
if (question_PrevItem !== null) {
|
||||||
currentItemID.insertBefore(question_ListItem, question_PrevItem);
|
currentItemID.insertBefore(question_ListItem, question_PrevItem);
|
||||||
}
|
}
|
||||||
} else if (e.target.classList.contains('down-icon')) {
|
} else if (e.target.classList.contains('down-icon')) {
|
||||||
|
|
||||||
console.log('BACKWORD');
|
// console.log('BACKWORD');
|
||||||
const question_ListItem = e.target.parentElement.parentElement;
|
const question_ListItem = e.target.parentElement.parentElement;
|
||||||
console.log('question_ListItem');
|
// console.log('question_ListItem');
|
||||||
console.log(question_ListItem);
|
// console.log(question_ListItem);
|
||||||
|
|
||||||
const question_nextItem = question_ListItem.nextElementSibling;
|
const question_nextItem = question_ListItem.nextElementSibling;
|
||||||
console.log('question_nextItem');
|
// console.log('question_nextItem');
|
||||||
console.log(question_nextItem );
|
// console.log(question_nextItem );
|
||||||
|
|
||||||
if (question_nextItem) {
|
if (question_nextItem) {
|
||||||
currentItemID.insertBefore(question_nextItem, question_ListItem);
|
currentItemID.insertBefore(question_nextItem, question_ListItem);
|
||||||
@ -2753,7 +2749,6 @@ function cloneQuestion(e,type)
|
|||||||
// remove the cloned text type questions function
|
// remove the cloned text type questions function
|
||||||
function removeClonedTextQuestion(index)
|
function removeClonedTextQuestion(index)
|
||||||
{
|
{
|
||||||
alert('hi text');
|
|
||||||
var element = document.getElementById('removeAndCloneTextQuestion_'+ index);
|
var element = document.getElementById('removeAndCloneTextQuestion_'+ index);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.remove();
|
element.remove();
|
||||||
@ -2763,8 +2758,6 @@ function removeClonedTextQuestion(index)
|
|||||||
// remove the cloned choice or group type questions function
|
// remove the cloned choice or group type questions function
|
||||||
function removeClonedQroupQuestion(index)
|
function removeClonedQroupQuestion(index)
|
||||||
{
|
{
|
||||||
alert('hi choice');
|
|
||||||
|
|
||||||
var element = document.getElementById('removeAndCloneQroupQuestion_'+ index);
|
var element = document.getElementById('removeAndCloneQroupQuestion_'+ index);
|
||||||
if (element) {
|
if (element) {
|
||||||
element.remove();
|
element.remove();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user