Relock Slides after wrong answer

Jun 11, 2024

Hi,

I use restricted navigation on my slides. At the end of each scene there is a question and when the wrong answer is given it sends you back to the first slide of the scene. Thing is after that point navigation is not restricted because user already completed slides once. Is it possible lock navigation again and treat slides as not viewed? 

2 Replies
Nedim Ramic

You can try this JavaScript code, as demonstrated in the attached video. Assuming the slide title name is "Question 1", the title name can be anything you like but needs to be reflected in the code. I've run the code when the timeline starts on this slide just for testing purposes. Further adjustments can be made depending on the specific scenario.

const q1 = document.querySelector('[data-slide-title="Question 1"]');
if ( q1 ) { 
    q1.classList.remove('cs-viewed');
    q1.setAttribute('disabled', 'true');
    q1.style.setProperty('pointer-events', 'none', 'important');
}