Skip to content

Instantly share code, notes, and snippets.

@EDDYMENS
Created December 20, 2021 12:21
Show Gist options
  • Select an option

  • Save EDDYMENS/c3712a124a13afb8adf6fa998c3475fc to your computer and use it in GitHub Desktop.

Select an option

Save EDDYMENS/c3712a124a13afb8adf6fa998c3475fc to your computer and use it in GitHub Desktop.
<script>
var questions = {
"#index": {
question: "Which service do you use?",
options: [
{
description: "a) Service Only",
action: "#feedback-type"
},
{
description: "b) Service Delivery and Goods",
action: "#extended"
},
{
description: "c) Product and services",
action: "#feedback-type"
},
{
description: "d) Products Only",
action: "#standalone"
}
]
},
'#feedback-type': {
question: "Which customer feedback do you want to collect?",
options: [
{
description: "a) Star rating + written feedback",
action: "#standard"
},
{
description: "b) Star rating + written feedback + added criteria of services",
action: "#extended"
}
]
},
"#standard": {
question: "",
options: [
{
description: "You need the Standard questionnaire. Click to read about it",
action: "https://developers.etrusted.com"
}
]
},
"#extended": {
question: "",
options: [
{
description: "You need the Extended questionnaire. Click to read about it",
action: "https://help.etrusted.com/hc/en-gb/articles/360025749732-What-do-the-optimised-questionnaire-templates-offer-"
}
]
},
"#standalone": {
question: "",
options: [
{
description: "You need the standalone questionnaire. Click to read about it",
action: "https://developers.etrusted.com/questionnaire-api/questionnaire-api.html"
}
]
},
};
const iframe=document.getElementById("questionnaire");iframe.addEventListener('load',function(){var i=iframe.contentWindow;i.postMessage(JSON.stringify(questions),'*')})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment