removeing unnecessary comment
This commit is contained in:
@@ -732,12 +732,10 @@ async function nextQuestion(goBack, goBackFromResponse, fromDependedOn) {
|
|||||||
$("#page5 .container .row .createdByDiv").append(`
|
$("#page5 .container .row .createdByDiv").append(`
|
||||||
Created By ${tempName}
|
Created By ${tempName}
|
||||||
`);
|
`);
|
||||||
} //displaying user name on top ends here
|
}
|
||||||
|
|
||||||
// first getting the first quiz
|
|
||||||
totalQuizQuestions = allItems[currentQuizIndex].questions;
|
totalQuizQuestions = allItems[currentQuizIndex].questions;
|
||||||
|
|
||||||
// checking if there is any resp onse in question or answer
|
|
||||||
if (currentQuestionCounter != 0) {
|
if (currentQuestionCounter != 0) {
|
||||||
apiQues = totalQuizQuestions.find((ques) => ques.id == lastShowedQuestionId);
|
apiQues = totalQuizQuestions.find((ques) => ques.id == lastShowedQuestionId);
|
||||||
let lastAnswerObject = dataToReturn.find(function (ansObj) {
|
let lastAnswerObject = dataToReturn.find(function (ansObj) {
|
||||||
@@ -748,39 +746,8 @@ async function nextQuestion(goBack, goBackFromResponse, fromDependedOn) {
|
|||||||
var fullAnswerObject = apiQues.answers.find(function (cAns) {
|
var fullAnswerObject = apiQues.answers.find(function (cAns) {
|
||||||
return cAns.answer == lastAnswerObject.answer;
|
return cAns.answer == lastAnswerObject.answer;
|
||||||
});
|
});
|
||||||
// quesResponse = apiQues.response;
|
|
||||||
|
|
||||||
//when there is response with the question
|
|
||||||
if (apiQues.id == 14) {
|
if (apiQues.id == 14) {
|
||||||
//save progress if there is answer
|
|
||||||
if (lastAnswerObject.answer) {
|
|
||||||
//ajax save contact
|
|
||||||
// const email = lastAnswerObject.answer;
|
|
||||||
// let fullName = localStorage.getItem("name");
|
|
||||||
// let firstName, lastName;
|
|
||||||
// if (fullName && fullName !== "You") firstName = fullName.split(" ")[0];
|
|
||||||
// if (fullName && fullName !== "You" && fullName.split(" ").length > 1) lastName = fullName.split(" ")[fullName.split(" ").length - 1];
|
|
||||||
// try {
|
|
||||||
// const newProfile = await fetch(url_preset + "/klaviyo/identity", {
|
|
||||||
// method: "POST",
|
|
||||||
// headers: {
|
|
||||||
// "content-type": "application/json",
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({ email, firstName, lastName }),
|
|
||||||
// }).then((res) => res.json());
|
|
||||||
// const addedToList = await fetch(url_preset + "/klaviyo/list", {
|
|
||||||
// method: "POST",
|
|
||||||
// headers: {
|
|
||||||
// "content-type": "application/json",
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify({ email }),
|
|
||||||
// }).then((res) => res.json());
|
|
||||||
// console.log(newProfile);
|
|
||||||
// console.log(addedToList);
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error(error);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (apiQues.id == 20 && apiQues.type == 7) {
|
if (apiQues.id == 20 && apiQues.type == 7) {
|
||||||
if (Array.isArray(lastAnswerObject.answer)) {
|
if (Array.isArray(lastAnswerObject.answer)) {
|
||||||
@@ -809,9 +776,6 @@ async function nextQuestion(goBack, goBackFromResponse, fromDependedOn) {
|
|||||||
$("#page4 .customImgRow .imgRowInner p").append(`${responseHeader}`);
|
$("#page4 .customImgRow .imgRowInner p").append(`${responseHeader}`);
|
||||||
responseOnGoing = true;
|
responseOnGoing = true;
|
||||||
hasNoResponse = false;
|
hasNoResponse = false;
|
||||||
// closeResponseTimeout = setTimeout(async () => {
|
|
||||||
// closeResponse();
|
|
||||||
// }, closeResponseTimeoutCounter);
|
|
||||||
}
|
}
|
||||||
} else if (apiQues.answers && apiQues.answers[0].responseBody) {
|
} else if (apiQues.answers && apiQues.answers[0].responseBody) {
|
||||||
$("#page3").css("display", "none");
|
$("#page3").css("display", "none");
|
||||||
@@ -1001,7 +965,6 @@ async function askQuestion(totalQuizQuestions, counter, fromBack) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// displaying note if it exists
|
// displaying note if it exists
|
||||||
|
|
||||||
if (note) {
|
if (note) {
|
||||||
$("#noteRow").css("display", "flex");
|
$("#noteRow").css("display", "flex");
|
||||||
$("#noteRow .noteDesc p").html(note);
|
$("#noteRow .noteDesc p").html(note);
|
||||||
|
|||||||
Reference in New Issue
Block a user