`;
// function to create inner content for modal level two
let modalTwoInnerContent = (className, title, promoCopy) => (`
${title}
${promoCopy}
Start now
`);
//function to generate radio buttons
function generateRadioButtons(options, groupName) {
// Helper function to generate a single radio item
const createRadioItem = (option, index) => {
const id = `${groupName}-option-${index + 1}`; // Unique ID for each option
return `
`;
};
// Generate all radio items
const radioItems = options.map((option, index) => createRadioItem(option, index)).join("");
// Wrap the radio items in the section structure
return `
${radioItems}
`;
}
// function to create inner content for modal level two
let modalThreeInnerContent = (className, questionOne, questionTwo) => (`
`);
// function to create markup for modals on level two and three
let quizModalfn = (className, quizName, image, modalInnerHtml, modalClassNameOne, modalClassNametwo) => (`
${quizCrossButton}
${quizCrossButton}
${modalInnerHtml}
`);
// markup for quiz modal level one
let quizModalLV1 = `
${quizCrossButton}
Take our simple quizzes and win instant rewards today!
Take part in our simple quizzes and win instant rewards today!
${QuizCards}
`;
// function to create the initial modal markup
let modalMarkup = () => (`
${quizModalLV1}
`);
/* ---- DOM Manipulation ---- */
// current url path
const currentPath = window.location.pathname;
// Dom manipulation for quiz variation
if (variationPages.includes(currentPath)) {
// preload images
preloadImages(imageUrls);
// insert quiz icon
if (document.querySelector('.quiz-icon-container')) return;
document.querySelector('main.container .cmp-container > .aem-Grid').insertAdjacentHTML('beforeend', quizIconHtml);
let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static';
gaEventTrigger('impression', eventLabel);
// insert modal markup
document.querySelectorAll('main.container .cmp-container > .aem-Grid')[0].insertAdjacentHTML('beforeend', modalMarkup())
// click handler function for variation pages
function clickHandler(event) {
const { target } = event;
//console.log('target: ', target);
// Utility: Toggle modal visibility
const toggleModal = (selector, addClass, removeClass) => {
const modal = document.querySelector(selector);
if (modal) {
if (addClass !== null) modal.classList.add(addClass);
if (removeClass !== null) modal.classList.remove(removeClass);
}
};
// Utility: Map class names to modal numbers
const getModalNum = () => {
if (target.closest('.healthy-heart-quiz-one')) return 0;
if (target.closest('.healthy-heart-quiz-two')) return 1;
if (target.closest('.word-search-edition-three')) return 2;
return null; // Default if no match found
};
// Utility: Clear form errors
const clearFormErrors = () => {
document.querySelector('.form-section .error-copy')?.remove();
document.querySelector('.form-section.form-error')?.classList.remove('form-error');
};
// Handle: Quiz icon click (open modal)
if (target.closest('.quiz-icon-container .quiz-icon')) {
toggleModal('.quiz-modal-container', 'modal--visible', 'modal--hidden');
// click on quiz icon
let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static';
let eventJourneyCTA = 'vworq-hh-win prizes-static';
gaEventTrigger('click', eventLabel, eventJourneyCTA);
}
// Handle: Quiz cross icon click (cross icon)
if (target.closest('.quiz-icon-container .cross-icon')) {
document.querySelector('.quiz-icon-container').classList.add('hide-quiz-icon');
// hide quiz icon
let eventLabel = '[vwo_ce_rtg] rewards quiz - healthy heart - win prizes - static';
gaEventTrigger('close', eventLabel);
return;
}
// Handle: Close modal
if (
target.closest('.modal-cross-button .cross-icon') ||
target.classList.contains('modal--visible')
) {
// step 1 modal - close
if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) {
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - static`;
gaEventTrigger('close', eventLabel);
}
// step 2 modal - close
if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) {
let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - static`;
gaEventTrigger('close', eventLabel);
}
// step 3 - close
if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) {
let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - static`;
gaEventTrigger('close', eventLabel);
}
toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible');
document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove());
toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one
return;
}
// Handle: Click on modal cards
if (target.closest('.quiz-modal-one .quiz-card')) {
const modalNum = getModalNum();
if (modalNum !== null) {
const { quizName, quizNumber, className, image, promoCopy, details } = collections[modalNum];
const modalTwoInnerHtml = modalTwoInnerContent(className, quizName, promoCopy, details);
const modalTwoMarkup = quizModalfn(className, quizName, image, modalTwoInnerHtml, 'quiz-modal-two', 'quiz-level-two');
document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalTwoMarkup);
toggleModal('.quiz-modal.quiz-modal-one', 'hide-modal', null);
// step 1 - popup card click
let quizTitle = quizNumber.toLowerCase();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - ${quizTitle} - static`;
let eventJourneyCTA = `vworq-hh-1-${quizTitle}-static`;
gaEventTrigger('click', eventLabel, eventJourneyCTA);
}
return;
}
// Handle: Click on quiz start button in modal two
if (target.closest('.quiz-modal.quiz-modal-two .quiz-button')) {
const questionModalNum = getModalNum();
if (questionModalNum !== null) {
const { quizName, quizNumber, className, image, questionOne, questionTwo } = collections[questionModalNum];
const modalThreeInnerHtml = modalThreeInnerContent(className, questionOne, questionTwo);
const modalThreeMarkup = quizModalfn(className, quizName, image, modalThreeInnerHtml, 'quiz-modal-three', 'quiz-level-three');
document.querySelector('.quiz-modal.quiz-modal-one').insertAdjacentHTML('afterend', modalThreeMarkup);
toggleModal('.quiz-modal.quiz-modal-two', 'hide-modal', null);
// step 2 - start now CTA click
let quizTitle = quizNumber.toLowerCase();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizTitle} - static`;
let eventJourneyCTA = `vworq-hh-2-${quizTitle}-static`;
gaEventTrigger('click', eventLabel, eventJourneyCTA);
}
return;
}
// Handle: Click on quiz button in modal three (final action)
if (target.closest('.quiz-modal.quiz-modal-three .quiz-button')) {
const questionModalNum = getModalNum();
if (questionModalNum !== null) {
const { url, quizNumber } = collections[questionModalNum];
// Validate input and process quiz data
validationAndProcessQuizData(url, quizNumber);
}
return;
}
// Handle: Input focus (clear errors)
if (target.closest('input#form-quiestion-one') || target.closest('input#form-quiestion-two')) {
clearFormErrors();
return;
}
}
// Attach click handler to the document
document.body.addEventListener('click', clickHandler);
function touchStartEventHandler(event) {
const { target } = event;
//console.log('target touch: ', target);
// Utility: Toggle modal visibility
const toggleModal = (selector, addClass, removeClass) => {
const modal = document.querySelector(selector);
if (modal) {
modal.classList.add(addClass);
modal.classList.remove(removeClass);
}
};
// Handle: Close modal
if (
target.closest('.modal-cross-button .cross-icon') ||
target.classList.contains('modal--visible')
) {
// step 1 - close
if (target.closest('.quiz-modal-content.quiz-level-one .modal-cross-button .cross-icon')) {
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 1 - select quiz - static`;
gaEventTrigger('close', eventLabel);
}
// step 2 - close
if (target.closest('.quiz-modal-content.quiz-level-two .modal-cross-button .cross-icon')) {
let quizName = document.querySelector('.quiz-modal.quiz-modal-two')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 2 - start now - ${quizName} - static`;
gaEventTrigger('close', eventLabel);
}
// step 3 - close
if (target.closest('.quiz-modal-content.quiz-level-three .modal-cross-button .cross-icon')) {
let quizName = document.querySelector('.quiz-modal.quiz-modal-three')?.getAttribute('quiz-name').split('-')[1].toLowerCase().trim();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - static`;
gaEventTrigger('close', eventLabel);
}
toggleModal('.quiz-modal-container', 'modal--hidden', 'modal--visible');
document.querySelectorAll('.quiz-modal.quiz-modal-three, .quiz-modal.quiz-modal-two').forEach(modal => modal.remove());
toggleModal('.quiz-modal.quiz-modal-one', null, 'hide-modal'); // Unhide modal one
return;
}
}
if (isTouchDevice()) {
document.body.addEventListener('touchstart', touchStartEventHandler)
}
}
// Dom manipulation to populate the quiz modal
if (quizPages.includes(currentPath)) {
// Retrieve and parse quiz data from sessionStorage
const quizData = sessionStorage.getItem('quizData');
if (quizData) {
try {
const [url, answerOne, answerTwo] = JSON.parse(quizData);
const currentUrl = window.location.href;
// Check if the current URL matches the stored URL
if (currentUrl.includes(url)) {
document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerOne}"]`)[0].click();
document.querySelectorAll(`.cmp-form .leo-radio__input input[value="${answerTwo}"]`)[0].click();
}
} catch (error) {
//console.error('Failed to parse quiz data from sessionStorage:', error);
}
}
}
},
};
// Return if the test ran already!
if (document.querySelector(`.${test.id}`)) return;
// Polling conditions
if (document.querySelector('main.container .cmp-container > .aem-Grid')) {
try {
// Activate test
setTimeout(function () { test.init() }, 1000)
// Success log
console.log('Vertis Digital: EXP-10: V: 1:05');
} catch (error) {
// Error log
console.log(`Initialization Error:`, error);
}
} else {
Date.now() < timeInFuture
? setTimeout(loadVariation.bind({}, timeInFuture), 25)
: console.log("loadVariation timed out!");
}
})(Date.now() + 60000);
// End variation JS
return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, R_722219_1027_1_2_0:{ fn:function(){return (function(x) { try{
var el,ctx=vwo_$(x);
/*vwo_debug log("Revert","addElement","body"); vwo_debug*/(el=vwo_$('[vwo-element-id="1739333374770"]')).remove();
var ctx=vwo_$(x),el;
/*vwo_debug log("Revert","content",""); vwo_debug*/;
el=vwo_$('[vwo-element-id="1739333374834"]');
el.revertContentOp().remove();
return vwo_$('head')[0] && vwo_$('head')[0].lastChild; } catch(e) {} })("HEAD")}}, C_722219_1027_1_3_0:{ fn:function(){return (function(x) { try{
var _vwo_sel = vwo_$("");
!vwo_$("head").find("#1739333374787").length && vwo_$('head').append(_vwo_sel);
// Start variation JS
void (function loadVariation(timeInFuture) {
// Main Test object
const test = {
// Some test specific global letiables
id: "EXP-10-V2",
// Test init
init: function () {
// Add a test specific classname to the body element
document.body.classList.add(test.id);
// Below function calls order is important
test.mainJS();
},
// Main JS
mainJS: function () {
/* ---- LOGO ---- */
const crossIcon = `
`;
const newCrossIcon = `
`;
/* ---- DATA ---- */
// quiz data
const collections = [
{
quizName: "Healthy heart, Happy life - Quiz 1",
quizNumber: "quiz 1",
className: "healthy-heart-quiz-one",
image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg",
coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg",
url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html",
header: "Healthy heart, Happy life - Quiz 1",
quizDate: "Jan 06, 2025",
promoCopy: "Answer 3 simple questions and win an exclusive prize from Eu Yan Sang worth $15!",
questionOne: [
"1. One should see a ____________ if he/she is experiencing chest pain and shortness of breath as it could be a possible sign of heart disease and heart failure.",
["Cardiologist", "Dentist", "Gastroenterologist"]
],
questionTwo: [
"2. These chronic conditions – diabetes, high blood pressure, and high ___________ (also known as the “Three Highs”), are usually asymptomatic and may be unnoticed. It has been observed that patients are also developing these conditions at an increasingly earlier age.",
["Blood count", "Cholesterol", "Fever"]
]
},
{
quizName: "Healthy heart, Happy life - Quiz 2",
quizNumber: "quiz 2",
className: "healthy-heart-quiz-two",
image: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg",
coverImage: "https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg",
url: "https://www.greateasternlife.com/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html",
header: "Healthy heart, Happy life - Quiz 2",
quizDate: "Jan 20, 2025",
promoCopy: "Answer 3 simple questions and win an exclusive prize from Fitness First worth $60!",
questionOne: [
"1. Even though pineapple tarts are everywhere for the festive season, I should limit my intake to ____ pieces because it is equivalent to 7 teaspoons of sugar, which is within our recommended daily intake of 10 teaspoons.",
["2", "4", "6"]
],
questionTwo: [
"2. Nian gao, nian gao, in the box… which is the most calorie-loaded of them all?",
["Steamed", "Fried"]
]
},
];
// quiz icon links
const animatedIcon = "https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/7a172faba185610e9d0a41c2db03373b_quizicon01.gif";
// quiz image links
const imageUrls = [
"https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/2ec24e2a92a520a5701a7de9c9df9671_quizicon01hover.gif",
"https://useruploads.visualwebsiteoptimizer.com/useruploads/722219/images/7a172faba185610e9d0a41c2db03373b_quizicon01.gif",
"https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-1.jpg",
"https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2.jpg",
"https://www.greateasternlife.com/content/dam/corp-site/great-eastern/sg/gels-dme-rewards/health-programme/heart-health/gels-dme-rewards-heart-health-quiz-2-thumbnail.jpg"
];
// array of quiz pages
const quizPages = [
'/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/heart-health-and-you-quiz-1.html',
'/sg/en/personal-insurance/lifepedia/healthy-heart-happy-life/huat-the-heart-wants-quiz-2.html',
];
// array of pages to show quiz logo
const variationPages = [
'/sg/en/personal-insurance/lifepedia.html',
'/sg/en/personal-insurance/lifepedia/medical-coverage.html',
'/sg/en/personal-insurance/lifepedia/life-protection.html',
'/sg/en/personal-insurance/lifepedia/lifestyle-protection.html',
'/sg/en/personal-insurance/lifepedia/savings-and-investment.html',
'/sg/en/personal-insurance/lifepedia/retirement-income.html',
'/sg/en/personal-insurance/lifepedia/career.html',
'/sg/en/personal-insurance/rewards-and-promotions.html'
];
/* ---- Utility Functions ---- */
// // image preload function
function preloadImages(imageUrls) {
imageUrls.forEach(url => {
const img = new Image();
img.src = url;
});
}
// function to validate and process quiz data
function validationAndProcessQuizData(quizUrl, quizNumber) {
// Cache form elements
const formSection = document.querySelector('.form-section');
const questionOneInput = document.querySelectorAll('.form-group-one .radio-item input:checked')[0];
const questionTwoInput = document.querySelectorAll('.form-group-two .radio-item input:checked')[0];
// Validation: Check if questions are answered
const isEmpty = !(questionOneInput?.value) || !(questionTwoInput?.value.trim());
const existingError = formSection.querySelector('.error-copy');
const errorHtml = `
Please complete the questions.
`
if (isEmpty) {
// Add error message if it doesn't exist
if (!existingError) {
formSection.insertAdjacentHTML('beforeend', errorHtml);
formSection.classList.add('form-error');
return; // Exit the function
}
return;
}
// Remove error if validation passes
if (existingError) {
existingError.remove();
}
formSection.classList.remove('form-error');
// Prepare quiz data
const quizData = [
quizUrl.trim(),
questionOneInput.value.trim(),
questionTwoInput.value.trim(),
];
// Store the data in session storage
sessionStorage.setItem('quizData', JSON.stringify(quizData));
// step 3 - continue CTA click
let quizName = quizNumber.toLowerCase();
let eventLabel = `[vwo_ce_rtg] rewards quiz - healthy heart - step 3 - continue - ${quizName} - animated`;
let eventJourneyCTA = `vworq-hh-3-${quizName}-animated`;
gaEventTrigger('click', eventLabel, eventJourneyCTA);
// Redirect to the quiz URL
window.location.href = quizUrl;
}
// function to trigger GA events
function gaEventTrigger(eventAction, eventLabel, eventJourneyCTA = '') {
dataLayer.push({
event: "vwoEvent",
eventDetails: {
category: "[vwo] sticky icon",
action: eventAction,
label: eventLabel
},
contentSubcategory: "healthy heart quiz",
...(eventJourneyCTA ? { journeyCta: eventJourneyCTA } : {})
});
};
// fuction to detect touch device
const isTouchDevice = () => {
return (
'ontouchstart' in window || // Check for touch events
navigator.maxTouchPoints > 0 || // Check for touch points
navigator.msMaxTouchPoints > 0 // Microsoft-specific touch points
);
};
/* ---- HTML Templates Markup and Functions ---- */
// create Quiz cards markup
const createQuizCard = (className, coverImage, header, quizDate) => {
return (`
`;
// function to create inner content for modal level two
let modalTwoInnerContent = (className, title, promoCopy) => (`
${title}
${promoCopy}
Start now
`);
//function to generate radio buttons
function generateRadioButtons(options, groupName) {
// Helper function to generate a single radio item
const createRadioItem = (option, index) => {
const id = `${groupName}-option-${index + 1}`; // Unique ID for each option
return `
`;
};
// Generate all radio items
const radioItems = options.map((option, index) => createRadioItem(option, index)).join("");
// Wrap the radio items in the section structure
return `
${radioItems}
`;
}
// function to create inner content for modal level two
let modalThreeInnerContent = (className, questionOne, questionTwo) => (`
`);
// function to create markup for modals on level two and three
let quizModalfn = (className, quizName, image, modalInnerHtml, modalClassNameOne, modalClassNametwo) => (`
${quizCrossButton}
${quizCrossButton}
${modalInnerHtml}
`);
// markup for quiz modal level one
let quizModalLV1 = `
${quizCrossButton}
Take our simple quizzes and win instant rewards today!
Take part in our simple quizzes and win instant rewards today!
${QuizCards}
`;
// function to create the initial modal markup
let modalMarkup = () => (`
Assigning a policy to a new owner, also called an absolute assignment, is a transfer of ownership from the existing policyholder (assignor) to another person or company/institution (assignee).
The assignee becomes the new policyholder and assumes full legal rights over the policy. All proceeds, including surrender, maturity and claims will be payable to the assignee.
A policy can be assigned if both assignor and assignee are of sound mind, not bankrupt or under duress, and if the policy is:
Not using CPF/SRS funds for premium payments
Not effected under trust
Not used to be exempted from CPF Board's Home Protection Scheme (HPS)
Allowed to be assigned under the plan
Additionally, the assignor must be at least 18 years old. For policies issued on or after 1 March 2009, the assignee must be at least 18 years old. For policies issued before 1 March 2009, the assignee must be at least 21 years old.
How to assign a policy to a new owner
Both the assignor and assignee must come to our Customer Service Centre at the following address with their NRICs:
1 Pickering Street
Great Eastern Centre #01-01
Singapore 048659
If the assignment is made between spouses, parent and child, or siblings, and relationship can be established by producing a marriage or birth certificate, they need not be present at our Customer Service Centre. You can call our Customer Service Officers at 1800 248 2888 for assistance in making the assignment.
Questions and Answers
No. Once a policy is absolutely assigned, the policy ownership will belong to the assignee. However, the policy ownership can be transferred back to you provided the assignee agrees to it. A new assignment will need to be done.
You can still assign the policy if the nomination made is a revocable nomination. The revocable nomination will be automatically revoked once the policy is assigned. If the policy has a trust nomination, the trust nomination will have to be revoked before you make an assignment.