SOLVE EDIT SAVE : RV
This commit is contained in:
parent
12519706fd
commit
3dc2980133
67
addform.html
67
addform.html
@ -602,8 +602,7 @@
|
||||
<!-- The popup container -->
|
||||
<div class="popup " id="popup">
|
||||
<ul id="output" class="">
|
||||
<div style="margin-bottom: 9px;">Reorder sections</div>
|
||||
|
||||
Reorder sections
|
||||
</ul>
|
||||
<div class="popup-save form-button">
|
||||
<button onclick="saveFile(flag=1)" id="closePopupButton">Save</button>
|
||||
@ -2079,42 +2078,10 @@ markCalculation();
|
||||
}
|
||||
|
||||
//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(choiceObj)
|
||||
function addNewChoice(NewaddChoiceAreaId = false , choiceName = false, questionRandomNo = false, choiceID = false, choice_mathEnabled= false)
|
||||
// function addNewChoice(choiceObj)
|
||||
{
|
||||
//set the default value to false
|
||||
var choiceName = false;
|
||||
var choiceID = false;
|
||||
var choice_mathEnabled = false;
|
||||
var editChoiceAreaId = false;
|
||||
var addChoiceAreaId = false;
|
||||
|
||||
|
||||
//set values from obj param if exists
|
||||
if(choiceObj.hasOwnProperty('addChoiceAreaId')) {
|
||||
|
||||
addChoiceAreaId = choiceObj.addChoiceAreaId;
|
||||
|
||||
}else if (choiceObj.hasOwnProperty('editChoiceAreaId')){
|
||||
|
||||
editChoiceAreaId = choiceObj.editChoiceAreaId;
|
||||
|
||||
}else if (choiceObj.hasOwnProperty('choiceName')){
|
||||
|
||||
choiceName = choiceObj.choiceName;
|
||||
|
||||
}else if (choiceObj.hasOwnProperty('choiceID')){
|
||||
|
||||
choiceID = choiceObj.choiceID;
|
||||
|
||||
}else if (choiceObj.hasOwnProperty('choice_mathEnabled')){
|
||||
|
||||
choice_mathEnabled = choiceObj.choice_mathEnabled;
|
||||
|
||||
}
|
||||
//end of set values from obj param if exists
|
||||
|
||||
|
||||
|
||||
addChoice = "";
|
||||
|
||||
const Choice_Group_Dynamic_UUID = uuidv4();
|
||||
@ -2137,15 +2104,16 @@ function addNewChoice(choiceObj)
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
if(editChoiceAreaId !== false)
|
||||
{
|
||||
var addChoiceAreaId2 = document.getElementById(editChoiceAreaId);
|
||||
addChoiceAreaId2.insertAdjacentHTML('beforeend', addChoice);
|
||||
}
|
||||
else if(addChoiceAreaId !== false)
|
||||
{
|
||||
addChoiceAreaId.insertAdjacentHTML('beforeend', addChoice);
|
||||
}
|
||||
if(questionRandomNo)
|
||||
{
|
||||
var addChoiceAreaId = 'addChoiceArea_'+questionRandomNo;
|
||||
var addChoiceAreaId2 = document.getElementById(addChoiceAreaId);
|
||||
addChoiceAreaId2.insertAdjacentHTML('beforeend', addChoice);
|
||||
}
|
||||
else if(NewaddChoiceAreaId)
|
||||
{
|
||||
NewaddChoiceAreaId.insertAdjacentHTML('beforeend', addChoice);
|
||||
}
|
||||
|
||||
|
||||
var newChoiceCommentButtonId = document.getElementById('newChoiceCommentButton_'+text_field_created_time+rnd_no);
|
||||
@ -2735,12 +2703,7 @@ function ConstructAddNewChoiceID(e){
|
||||
var addChoiceAreaTime = addChoiceArea.split("_")[1];
|
||||
var addChoiceAreaId = 'addChoiceArea_'+addChoiceAreaTime;
|
||||
var addChoiceAreaId2 = document.getElementById(addChoiceAreaId);
|
||||
|
||||
var addChoiceAreaIdObject = {
|
||||
'addChoiceAreaId' : addChoiceAreaId2
|
||||
}
|
||||
|
||||
addNewChoice(addChoiceAreaIdObject)
|
||||
addNewChoice(addChoiceAreaId2)
|
||||
|
||||
}
|
||||
|
||||
|
||||
14
json2html.js
14
json2html.js
@ -134,18 +134,8 @@ function QuestionsForEach(Question, questionAreaId, questionRandomNo){
|
||||
var choiceName = choicenames.choice_name;
|
||||
var choiceID = choicenames.id;
|
||||
var choice_mathEnabled = choicenames.is_math_enabled;
|
||||
|
||||
var editChoiceAreaId = 'addChoiceArea_'+questionRandomNo;
|
||||
|
||||
var choiceObj = {
|
||||
'choiceName' : choiceName,
|
||||
'choiceID' : choiceID,
|
||||
'choice_mathEnabled' : choice_mathEnabled,
|
||||
'editChoiceAreaId' : editChoiceAreaId,
|
||||
}
|
||||
|
||||
addNewChoice(choiceObj);
|
||||
// addNewChoice(false , choiceName, questionRandomNo, choiceID, choice_mathEnabled);
|
||||
|
||||
addNewChoice(false , choiceName, questionRandomNo, choiceID, choice_mathEnabled);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user