Forum Discussion

DanielBenton's avatar
DanielBenton
Community Member
17 days ago

Boost Your Storyline Game with JavaScript!

PREVIEW COURSE.

For as long as I can remember, corporate e-learning has relied heavily on multiple-choice questions to assess learners. It’s never felt like the best approach to me. Even before I stepped into L&D, I found it often tested someone’s ability to pick the best option, rather than truly assessing whether they knew the answer. That’s why I focus on using open-text questions whenever possible.

For this quiz, I used JavaScript to:

  • Create a typewriter effect for text displays.
  • Build a huge question bank with over 100 questions, with typo-tolerant marking using the Levenshtein algorithm. This allows answers with small spelling errors (like “Lichenstein” instead of “Liechtenstein”) to be marked correct.
  • Dynamically load and shuffle questions, ensuring no repeats within the same session.
  • Provide real-time scoring adjustments with immediate feedback.

Recently, I’ve been experimenting with OpenAI’s API to evaluate open-text answers and provide personalised feedback. While it’s incredible what AI can achieve, it’s not always practical or cost-effective. That’s where JavaScript comes in—it allows for powerful customisations directly within the project file, offering a practical alternative, or compliment to AI.

ChatGPT helped me convert these ideas into working code, and I’m happy to share it with you to adapt and enhance for your own projects. Let me know how you’d use these ideas in your e-learning modules—I’d love to see what you create! 🚀

I've shared the project master file, so feel free to explore, adapt, or reuse it in your own projects.

  • Hi Daniel, 

    Your courses are interesting but what if somebody doesn't know javascript. How can interseting courses be created in absence of javascript knowledge?

    Regards

    Malvika

    • DanielBenton's avatar
      DanielBenton
      Community Member

      Hi Malvika,

      Thank you, it’s a great point you’ve raised. You could build most (though not all) of the functionality in my recent course examples without JavaScript, but it would require many more triggers and variables. For example, building the open-text assessment natively in Storyline would involve creating individual triggers, conditions, and variables for every possible question and acceptable answer, which can become time-consuming and tricky to maintain.

      I often turn to JavaScript because it opens up so many possibilities in Storyline that go beyond what native triggers can achieve. It also keeps my projects much cleaner by reducing the number of variables and triggers required.

      I shared the .story file so you can unpack the code and see how it’s applied—this approach helped me a lot when I was starting out. Articulate Heroes has some amazing examples too. My personal favourite is by Zsolt Olah - https://www.rabbitoreg.com/examples/p99/#/

      These days, tools like ChatGPT make it even easier to get started. You can frame your ideas (e.g., “I want to create typo-tolerant open text assessments”), and it will help you translate them into usable JavaScript code for Storyline. That’s exactly how I built this project!

      JavaScript isn’t essential for creating great courses, but it’s an incredibly powerful tool for dynamic interactions, customization, and efficiency.

      Let me know if you decide to dive in—I’m happy to help where I can!

      Regards,

      Daniel

  • Thank you Daniel for guiding me. I would love to learn Javascript via chatgpt. Can I reach out to you for more thoughts and suggestions.