Rise 360: Beyond Blocks

How to Build a Locked Accordion in Rise 360 That Requires Learners to View All Content

Learn how to build a locked accordion in Rise 360 that tracks which sections learners have viewed and requires completion before they can proceed. This step-by-step tutorial includes full JavaScript code, progress tracking, visual indicators, and works with Storyline and standalone websites too.

By Nathan Stoker · Published Jul 19, 2026 · Updated Sep 30, 2026 · 12 min read

How to Build a Locked Accordion in Rise 360 That Requires Learners to View All Content

Ever had learners speed-click through your Rise 360 course without actually reading anything? You're not alone. One of the most common challenges in e-learning development is ensuring learners engage with all required content before moving forward. A locked accordion interaction solves this problem elegantly by tracking which sections learners have opened and only allowing progression after they've viewed everything.

In this tutorial, you'll learn how to create a locked accordion in Rise 360 that tracks learner progress, displays visual completion indicators, and communicates with the LMS when the interaction is complete. Best of all, this same code works as a web object in Articulate Storyline or as a standalone component on any website.

What You'll Build

This locked accordion interaction includes several features that go beyond what Rise 360 offers natively. You'll create an accordion with visual checkmarks that appear when learners open each section. A progress bar shows real-time completion status. Most importantly, the interaction locks navigation until all sections are viewed, then sends a completion signal to Rise 360.

The interaction uses Bootstrap 5 for responsive accordion functionality and vanilla JavaScript for the tracking logic. No external libraries beyond Bootstrap are required, making this lightweight and easy to maintain.

Understanding the Core HTML Structure

Before diving into the JavaScript, let's examine how the accordion is structured. Each accordion item contains a button, a visited indicator span, and a collapsible content area. The data-section attribute on both the button and collapse element is crucial—it's how the JavaScript identifies which section the learner has opened.

<!-- Single Accordion Item Structure -->
<div class="accordion-item">
  <h2 class="accordion-header" id="heading1">
    <button class="accordion-button" 
            type="button" 
            data-bs-toggle="collapse" 
            data-bs-target="#collapse1"
            aria-expanded="true"
            aria-controls="collapse1"
            data-section="1">
      Introduction to the Topic
    </button>
    <span class="visited-indicator unvisited" aria-hidden="true">✓</span>
  </h2>
  <div id="collapse1" 
       class="accordion-collapse collapse show" 
       data-bs-parent="#lockedAccordion"
       data-section="1">
    <div class="accordion-body">
      Your content goes here.
    </div>
  </div>
</div>

The visited-indicator span starts with the unvisited class, displaying as an empty circle. When the learner opens that section, JavaScript swaps this to the visited class, revealing a green checkmark. This provides immediate visual feedback that the section has been completed.

Setting Up the Progress Tracking with JavaScript

The JavaScript uses a Set to track visited sections because Sets automatically handle duplicates. If a learner opens the same section multiple times, it only counts once. This prevents accidental over-counting and keeps the progress accurate.

// Configuration - change this to match your accordion item count
const TOTAL_SECTIONS = 10;

// Track unique visited sections
const visitedSections = new Set();

// Prevent multiple completion messages
let completionSent = false;

The completionSent flag ensures the completion message only fires once. Without this safeguard, rapidly opening the final section could potentially trigger multiple postMessage calls to Rise 360, which might cause unexpected behavior.

Creating the Progress Update Function

The updateProgress function calculates completion percentage and updates both the visual progress bar and the text display. It also checks whether all sections have been visited and triggers the completion handler if so.

function updateProgress() {
  const visitedCount = visitedSections.size;
  const percentage = (visitedCount / TOTAL_SECTIONS) * 100;

  // Update progress bar width
  progressBar.style.width = percentage + '%';

  // Update ARIA attributes for screen readers
  progressBar.parentElement.setAttribute('aria-valuenow', percentage);

  // Update text display
  progressText.textContent = visitedCount + ' of ' + TOTAL_SECTIONS + ' sections viewed';

  // Check for completion
  if (visitedCount === TOTAL_SECTIONS && !completionSent) {
    handleCompletion();
  }
}

Notice the ARIA attribute update. This ensures screen reader users receive the same progress information as sighted users. Accessibility isn't an afterthought here—it's built into the core functionality.

Marking Sections as Visited

When a learner opens an accordion section, the markSectionVisited function adds that section to the tracking Set, updates the visual indicator, and triggers a progress update. The function first checks whether the section was already visited to avoid unnecessary DOM manipulation.

function markSectionVisited(sectionNumber) {
  // Skip if already visited
  if (!visitedSections.has(sectionNumber)) {
    // Add to tracking Set
    visitedSections.add(sectionNumber);

    // Find and update the visual indicator
    const button = document.querySelector(
      '[data-section="' + sectionNumber + '"].accordion-button'
    );
    
    if (button) {
      const indicator = button.nextElementSibling;
      if (indicator && indicator.classList.contains('visited-indicator')) {
        // Swap classes for visual feedback
        indicator.classList.remove('unvisited');
        indicator.classList.add('visited', 'just-visited');

        // Remove animation class after completion
        setTimeout(function() {
          indicator.classList.remove('just-visited');
        }, 300);
      }
    }

    // Update progress display
    updateProgress();
  }
}

The just-visited class triggers a brief CSS animation that draws attention to the newly completed indicator. This micro-interaction reinforces the learner's action and creates a more polished experience.

Handling Completion and Rise 360 Integration

When all sections are visited, the handleCompletion function displays a success message and sends a postMessage to the parent window. This is how the embedded web object communicates with Rise 360's completion tracking system.

function handleCompletion() {
  // Prevent multiple triggers
  completionSent = true;

  // Show completion message
  completionMessage.classList.add('show');

  // Signal completion to Rise 360, Storyline, or parent application
  window.parent.postMessage({ type: 'complete' }, '*');

  // Debug logging
  console.log('Accordion completion triggered - postMessage sent to parent');
}

The postMessage API allows secure cross-origin communication between the iframe (your web object) and the parent window (Rise 360). The type: 'complete' message tells Rise 360 that the learner has finished this interaction, enabling the Continue button or unlocking the next lesson.

Listening for Bootstrap Accordion Events

Bootstrap 5 fires custom events when accordion sections open and close. The shown.bs.collapse event fires after a section finishes expanding, making it the ideal hook for tracking visits. We attach a single event listener to the accordion container and use event delegation to handle all sections.

// Get reference to accordion container
const accordion = document.getElementById('lockedAccordion');

// Listen for section expansions
accordion.addEventListener('shown.bs.collapse', function(event) {
  // Extract section number from data attribute
  const sectionNumber = parseInt(
    event.target.getAttribute('data-section'), 
    10
  );

  // Mark as visited if valid
  if (sectionNumber) {
    markSectionVisited(sectionNumber);
  }
});

Event delegation means you don't need to attach individual listeners to each accordion section. This approach is more efficient and automatically handles any number of sections without code changes.

Initializing the First Section

Because the first accordion section starts in an expanded state, learners might read it without ever triggering a shown.bs.collapse event. The initialization code handles this edge case by marking any initially-expanded section as visited when the page loads.

document.addEventListener('DOMContentLoaded', function() {
  // Find section that starts expanded
  const expandedSection = document.querySelector('.accordion-collapse.show');
  
  if (expandedSection) {
    const sectionNumber = parseInt(
      expandedSection.getAttribute('data-section'), 
      10
    );
    
    if (sectionNumber) {
      markSectionVisited(sectionNumber);
    }
  }
});

This ensures the progress bar starts at 10% (1 of 10 sections) rather than 0%, accurately reflecting what the learner sees when they first load the interaction.

Styling the Visual Indicators

The CSS creates two distinct states for the visited indicators. Unvisited sections display an empty circle, while visited sections show a green circle with a white checkmark. The transition property ensures smooth visual changes.

/* Base indicator styling */
.visited-indicator {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 10;
  transition: all 0.3s ease;
  pointer-events: none;
}

/* Unvisited state - empty circle */
.visited-indicator.unvisited {
  border: 2px solid #adb5bd;
  background-color: transparent;
  color: transparent;
}

/* Visited state - green checkmark */
.visited-indicator.visited {
  border: 2px solid #198754;
  background-color: #198754;
  color: white;
}

The pointer-events: none rule prevents the indicator from interfering with clicks on the accordion button. Without this, learners might accidentally click the checkmark instead of the button, causing confusion.

Complete Code

Above, in the header is the complete HTML file with all CSS and JavaScript included—click that download button. It includes a placeholder image reference that you'll need to customize. Find this section in the code and update the src attribute to match your image filename and extension, then revise the alt text to accurately describe your image:

!-- Left Image Column -->
    <div class="col-md-6 p-0">
      <img src="picture1.jpg" 
           alt="Team collaboration in a modern office environment" 
           class="img-fluid h-100">
    </div>

Using the Locked Accordion in Rise 360

To use this interaction in Rise 360, you need to embed it as a multimedia block with completion tracking enabled. First, upload your HTML file and any images (like picture1.jpg) to a web server or content delivery network. Then add a Multimedia Embed block in Rise 360 and paste the URL to your HTML file.

In the block settings, set the completion option to "Complete when web page sends complete message." This tells Rise 360 to listen for the postMessage from your accordion. The lesson won't let learners continue until they've opened all sections and the completion message fires.

If you're hosting the files locally for testing, remember that Rise 360 requires HTTPS URLs in published courses. Services like GitHub Pages, Netlify, or Amazon S3 provide free HTTPS hosting suitable for e-learning assets.

Using the Locked Accordion in Storyline

In Articulate Storyline, you can embed this as a Web Object. Create a folder containing your index.html and any required images, then zip the folder. In Storyline, insert a Web Object and select your zip file. The postMessage will communicate with Storyline's JavaScript, and you can use JavaScript to set a Storyline variable when the completion message is received.

Add this JavaScript trigger in Storyline to listen for the completion:

window.addEventListener('message', function(event) {
  if (event.data && event.data.type === 'complete') {
    var player = GetPlayer();
    player.SetVar('AccordionComplete', true);
  }
});

Create a True/False variable called AccordionComplete and set it to false by default. Use this variable to control navigation or display completion feedback within your Storyline project.

Troubleshooting Common Issues

If the progress bar isn't updating, check that your data-section attributes match between the button and collapse elements. Mismatched numbers prevent the tracking from working. Also verify that the TOTAL_SECTIONS constant matches the actual number of accordion items in your HTML.

If Rise 360 isn't recognizing completion, confirm the embed block is set to complete on message. The postMessage format must be exactly { type: 'complete' } for Rise 360 to recognize it. Check browser developer tools for any JavaScript errors that might prevent the message from sending.

For Storyline web object issues, ensure your JavaScript listener is attached to the correct slide and that the variable name matches exactly. Storyline variable names are case-sensitive, so AccordionComplete and accordioncomplete are different variables.

Key Takeaways

This locked accordion in Rise 360 provides a practical solution for ensuring learner engagement with required content. The technique combines Bootstrap's accordion functionality with custom JavaScript tracking to create an interaction that works seamlessly across Rise 360, Storyline, and standalone web pages.

The key technical concepts include using JavaScript Sets for efficient duplicate prevention, Bootstrap's custom events for tracking user interactions, and the postMessage API for cross-origin communication with LMS platforms. These patterns apply to many other interactive e-learning components beyond accordions.

Download the complete code files and start customizing them for your own courses. Have questions or improvements? Share them in the comments below!

Nathan Stoker

I build custom eLearning in Storyline, Rise and JavaScript, and I make the free tools and templates on this site. Need an interaction like this in your course? Let's talk.

Work with me · Browse templates

Related posts