Forum Discussion
lock course for 3 days after failing second attempt
Hello everyone,
I need some javascript help. I am creating a quiz that can be taken 3 times. If you fail it the first time you get a second attempt right away. If you fail the quiz a second time you need to wait three days before you can complete it. I'm having issues getting the correct javascript to calculate the three days. Every time I open the course it takes the current date as the second attempt date and keeps moving out the date for the third attempt. I can't seem to lock the second attempt date using javascript.
I have the trigger on the retry button set to hide if CurrentTranslatedDate date is less than the attemptDate3 and normal if the CurrentTranslatedDate is greater than or equal to the attemptdate3.
I am attaching the file to see if anyone can help me out. I am very new to javascript. Or is there an easier way to have the course wait 3 days? In the code, I have the time frame set for 1 day so I can test faster.
Thank you for your assistance
Eric