Creating one time password (OTP) and view on SL3 Nov 23, 2019 By irven Lim Hi there, I have went online to download the following code for creating OTP function generateOTP() { var digits = '0123456789abcdefghijklmnopqrstuvwxyz'; var otpLength = 6; var otp = ''; for(let i=1; i<=otpLength; i++) { var index = Math.floor(Math.random()*(digits.length)); otp = otp + digits[index]; } return otp; I'm not very good at javascripts….I want to view the OTP on the slide with %NewOTP%...but I can't seem to be able to. Below is what I added var player = GetPlayer(); var NewOTP = player.GetVar("otp');
irven Lim Author over 4 years ago11/23/19 at 8:52 am (UTC) Mathew, I have tried your code, still can't get it on the slide. I attached my slide here. OTP.story
irven Lim Author over 4 years ago11/24/19 at 5:58 am (UTC) Hi Matthew, It's WORK!!!!….Tks. now I need to learn about array...tks.
2 Replies
Mathew,
I have tried your code, still can't get it on the slide. I attached my slide here.
Hi Matthew,
It's WORK!!!!….Tks.
now I need to learn about array...tks.
This discussion is closed. You can start a new discussion or contact Articulate Support.