Unleashing the Power of Accessibility with JavaScript in Articulate Storyline
Moataz Alaa
Learning Experiences Designer?? | eLearning Developer?? | Gamification Designer ?? | LMS Developer ?? | Authoring Tool - Developer (Articulate storyline, Adobe Captivate, Active Presenter, Articulate Rise) ??
Accessibility in eLearning is a crucial aspect in the design and development of online learning experiences. With the growing popularity of online education, it is imperative to ensure that all individuals, including those with disabilities, are able to participate and benefit from these courses.
However, despite the fact that creating an accessible course will increase the reach and number of people who can potentially access it, companies often overlook the importance of accessibility. This raises the question of why companies ignore this key aspect in eLearning.
To understand this better, let us take the example of "color blind accessibility." This feature requires adding three options for color blind disabilities, such as color blind, green weakness, and red weakness. Each mode requires changing the background, text, and icon colors, which can result in a significant increase in the number of slides. For instance, a 100-slide course with this feature added would become a 400-slide course.
The increased workload and complexity in adding accessibility features can be overwhelming for companies, as it can lead to larger file sizes and make editing more difficult. It can also be time-consuming, which is why companies may overlook accessibility in eLearning.
However, this does not mean that accessibility should be ignored. Instead, it is important to find a balance between accessibility and ease of editing to create inclusive and user-friendly eLearning courses for all learners.
Through this article, I will show my solution for the feature above(color blind accessibility) with JS code and Articulate storyline, this code can be executed into any Authoring tool.
Prerequisites:-
Let's start with write all lines of code first:-
function setColor(newBackgroundColor,newTextColor,newSvgColor){
}
Side note: Any Storyline file published is contained within a HTML 'div'(as a container) element and is assigned a class name 'slide-layer.
function setColor(newBackgroundColor,newTextColor,newSvgColor){
const slideLayer = document.querySelector('.slide-layer');
const textElements = document.querySelectorAll('text');
const svgPaths = document.querySelectorAll('svg path');
}
Side note: All shapes in Storyline are created as SVG elements.
function setColor(newBackgroundColor,newTextColor,newSvgColor){
const slideLayer = document.querySelector('.slide-layer');
const textElements = document.querySelectorAll('text');
const svgPaths = document.querySelectorAll('svg path');
? ?if (slideLayer) {
????slideLayer.style.backgroundColor = newBackgroundColor;
}
}
领英推荐
Let's change the text color also:-
function setColor(newBackgroundColor,newTextColor,newSvgColor){
const slideLayer = document.querySelector('.slide-layer');
const textElements = document.querySelectorAll('text');
const svgPaths = document.querySelectorAll('svg path');
? ?if (slideLayer) {
????slideLayer.style.backgroundColor = newBackgroundColor;
}
if (textElements.length > 0) {
textElements.forEach(text => {
text.setAttribute('fill', newTextColor);
});
}
}
function setColor(newBackgroundColor,newTextColor,newSvgColor){
const slideLayer = document.querySelector('.slide-layer');
const textElements = document.querySelectorAll('text');
const svgPaths = document.querySelectorAll('svg path');
? ?if (slideLayer) {
????slideLayer.style.backgroundColor = newBackgroundColor;
}
if (textElements.length > 0) {
textElements.forEach(text => {
text.setAttribute('fill', newTextColor);
});
}
if (svgPaths.length > 0) {
svgPaths.forEach(path => {
if (path.getAttribute('fill') =="color") {
path.setAttribute('fill', newSvgColor);
}
});
}
}
Finally we finished the part in Javascript let's start create a simple project in Articulate storyline and add text,background and some shapes.
We will start with one mode only, and you can apply it in the same way.
we put the code above and add to it the following.
setColor("#444654","white","#6200EE")
the result:
In conclusion, using JavaScript in Articulate Storyline to add accessibility features is a powerful tool that can help ensure that all learners, including those with disabilities, can access and understand course content. With a little knowledge and creativity, developers can create custom scripts that can improve accessibility in various ways.
And Remember: Accessibility is not an option. It is a right. So, try to find the best way that will reduce the time consuming and will make your course accessible.
Learning Experience Designer at Learnkhana | QA | E-learning Developer | ID | Character Building | Translator | Trainer
2 年Amazing ya Moataz, thanks for sharing ^^
?? Instructional Designer | ?? eLearning Developer | ?? Trainer | I design engaging and effective learning experiences that solve business problems and people enjoy | ?? Anime Lover | ?? Potterhead | ?? Comic Addict
2 年Great Job brother ^__^