user
@yaraswidan
I have to refresh the Leaderboard so it is updated
I enter my name and after I finish the quiz the leaderboard appears but not updated with my name and score and when refresh it is updated is there any way that the leaderboard is updated automatically without having to refresh
reply
Reply
user
@support
If you display the web object after the javascript that updates the leaderboard completes, then you should see the updated data. For example, if you run the JS trigger on slide 1, and then display the web object with the leaderboard on slide 2, by the time you get to slide 2, the data should already be updated.

On the other hand, if you display the leaderboard on slide 1 and then run the trigger after, you load the leaderboard before you update the data, so of course you will see the old data.

If you do need to update the data and display the leaderboard on the same slide, consider placing the web object on a separate layer. And after you update the data, hide and then show the layer again. In most browsers, that would reload the web object.

Of course, feel free to respond if more assistance is needed. Thank you!
reply
Reply
user
@yaraswidan
Thanks for your reply, I run the JS in a different slide first then show the web object in the next layer and it is not updated that's why i am checking if i'm missing something, can you think of any other reason why this is happening?
reply
Reply
user
@support
No worries. If possible, could you post a link to your .story file (just these two slides with the leaderboard, you can delete the rest)? We'll check the file and see what's happening there.
reply
Reply
user
@yaraswidan
I have Created 2 questions as example
[LINK]
Please Find the .stroy file above
appreciate your support
reply
Reply
user
@support
Thank you for sharing. Note that Storyline does not wait for the JS code to complete executing before proceeding to the next trigger. It just starts the code and proceeds right away to the next trigger. There are two options to consider:

1. Just move that trigger to somewhere earlier - for example, when the slide just starts. This way there will be more time for the code to complete before the web object is shown.

2. Note step #5 in the "How to Use..." instructions: "If you need to track from within the learning course whether the new row has been saved, create a variable stencilrendered and set its value to 0. After the record is saved, the value will increase by 1."
So if you keep the JS trigger on the button click on the layer, instead of jumping right away to the next slide, you can show some kind of "Submitting..." popup and have a trigger to jump to the next slide when the variable stencilrendered changes.
reply
Reply