Hello,
I am not the most familiar person with coding, and I am having a hard time with the following code
new ViddlerEmbed.ManifestBuilder(playerOptions, function(manifest) { var formsTrack = {
name: 'Forms Track',
id: 'forms-track',
type: 'sub-track',
mediaElements: [{
type: 'simple_data_capture_overlay',
duration: 5000,
timelineStart: 36*1000, //This variable is in milliseconds
resourceData: {
//The formName will show up again in the form and schema below
formName: 'question1',
skippable : false,
successMessaging: function(data) {
if(data.question1 == "Bottomplate to base")
{
var body = "Keep up the good work!";
var header = "That is correct!"
buttonText = "Continue";
}
else
{
var body = "That answer is incorrect.";
var header = "Sorry!";
buttonText = "Try again!";
}
return {
header: header,
body: body,
}
},
form: [
{
key: 'question1',
type: 'radios'
},
{
"type": "submit",
"title": "Submit"
}
],
schema: {
question1: {
title: "Which is not one of the three transition areas with air leaks?",
type: "string",
required: true,
enum: [
"Sill to Rim",
"Rim to Subfloor",
"Subfloor to bottom plate",
"Bottomplate to base"
]
}
}
}
When playing a video, the end user will get a pop question with multiple choice. If they get the wrong answer, I would like the player to go back 10, 20 seconds (whatever I set it to). I have including the following code at the end of page as well:
player.manager.events.on('simpleDataCapture:submit', function(result) {
if(result.values.question1 != 'Bottomplate to base');
{
setTimeout(function(){
$('.success-dismiss').click(function() {
player.go();
});
}, 100);
}
if(result.values.question2 != 'To allow any water out');
{
setTimeout(function(){
$('.success-dismiss').click(function() {
player.manager.play(2000);
});
}, 100);
}
There are three (3) questions on the video that will pop up. I can get the video to continue if the correct answer is picked, but I can’t get the player to go back if the incorrect answer is picked. Any help of what I am missing/doing wrong will be greatly appreciated.
Miguel