Issues using JavaScript to send Quiz Results to PHP script Dec 07, 2023 By Simon Petersen Hi all, So I'm at a point, where I really cannot find the solution. I have a JavaScript trigger, which should send the scorepoints to my MySQL database: The PHP script send.php is capturing the userId and quizId correctly, but score output is null. When I use static values, it works completely fine: I think I can narrow down the issue with the score variable. I have checked and double checked the variable is correct: So is it this part that is incorrect, or is there something else I'm missing here?
Steve Gannon 5 months ago12/07/23 at 12:52 pm (UTC) You won't be able to pull an internal Storyline variable into JavaScript. Instead, create a custom variable and assign it the value of Quiz1.ScorePoints using a trigger. Then use JavaScript to get the custom variable. Should work.
Simon Petersen Author Steve Gannon 5 months ago12/07/23 at 2:10 pm (UTC) Thanks Steve, that worked like a charm. Thank you so much. For reference:
2 Replies
You won't be able to pull an internal Storyline variable into JavaScript. Instead, create a custom variable and assign it the value of Quiz1.ScorePoints using a trigger. Then use JavaScript to get the custom variable. Should work.
Thanks Steve, that worked like a charm. Thank you so much.
For reference: