I'm sure I'm just screwing up my code somehow (still a bit of a noobie) but I'm trying to create a random number (which is working fine) then use the variable from that random number to send 1 of every 3 users to a post-course survey (which isn't working fine at all).
Is there a way to do this, and if so, what am I doing wrong?
Here's the code (this is inside of an adobe Captivate course so I'm making use of the API interface library as well, but that part is also working fine).
Currently this string of code sends the user to the listed link every time instead of depending on the variable.
var jsRandomNumber = 0
function getRandomInt(min, max) {
var jsRandomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
alert(jsRandomNumber);
window.cpAPIInterface.setVariableValue('randomnumber', jsRandomNumber);
}
getRandomInt (1, 3)
function randomQuizGenerator() {
if (var jsRandomNumber = 1) {
window.open("http://www.w3schools.com");
window.cpAPIInterface.next();
} else {
window.cpAPIInterface.next();
}
}
randomQuizGenerator()