Forum Discussion

YasinDamga's avatar
YasinDamga
Community Member
4 months ago

Relock Slides after wrong answer

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? 

  • Storyline doesn't have a way to relock navigation (though there's probably a way to do it with JavaScript).

    To force users to retake a scene, you could create a custom slide menu that can be locked and unlocked using variables and conditional triggers. Or just don't show a slide menu at all. 

  • Nedim's avatar
    Nedim
    Community Member

    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');
    }