Abstract 1 Introduction 2 Related Work 3 Storyline Personalization 4 Gamification Architecture 5 Course Generation Workflow 6 Conclusion and Future Work References

Designing a Multi-Narrative Gamified Learning Experience

Yannik Bauer ORCID DCC – FCUP, Porto, Portugal
CRACS – INESC TEC, Porto, Portugal
José Paulo Leal ORCID DCC – FCUP, Porto, Portugal
CRACS – INESC TEC, Porto, Portugal
Ricardo Queirós ORCID ESMAD, Polytechnic of Porto, Portugal
CRACS – INESC TEC, POrto, Portugal
Jakub Swacha ORCID Department of IT in Management, University of Szczecin, Poland José Paiva ORCID Pedagogical Innovation Center, Polytechnic of Porto, Portugal
CRACS – INESC TEC, Porto, Portugal
Abstract

The combination of storytelling and gamification in educational settings has emerged as a method to enhance student engagement and learning outcomes. Through an overarching narrative, course content can be connected while providing context for gamified exercises, creating a motivating and competitive learning experience. However, a narrative that resonates with one student may not interest others. The presented solution to this problem is to offer multiple narratives for students to choose from. This enables the students to engage with the material in ways that align with their interests and motivations. Yet, managing multiple narratives presents several challenges. Each narrative must cover all syllabus topics equally, and every exercise must be available across all narratives while maintaining consistent difficulty levels and learning objectives. This paper presents a systematic approach for creating gamified courses with multiple narratives. The methodology includes the development of a base course template and its narrative variations, along with transformation processes to generate exercises in the FGPE Ecosystem, namely AuthorKit and FGPE PLE. The final output is a single Moodle MBZ file that can be imported into Moodle, a widely adopted learning management system.

Keywords and phrases:
Gamification, Storytelling, Personalized Learning, Programming Education, Multi-Narrative
Copyright and License:
[Uncaptioned image] © Yannik Bauer, José Paulo Leal, Ricardo Queirós, Jakub Swacha, and José Paiva; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Applied computing Interactive learning environments
Funding:
This research was co-funded by the European Union, grant number 2023-1-PL01-KA220-HED-000164696.
Editors:
Ricardo Queirós, Mário Pinto, Filipe Portela, and Alberto Simões

1 Introduction

Storytelling and gamification are widely recognized as effective strategies for increasing student motivation, clarifying complex concepts, and improving the overall learning experience. When narrative elements are combined with game-like mechanics such as challenges, rewards, and visible progress, students are more likely to engage with the material and stay committed throughout the course.

However, traditional storytelling in education often follows a single storyline. This can be limiting, as not all students connect with the same type of narrative. While some may enjoy a bitcoin miner adventure, others might prefer a detective mystery or a real-world climate saviour simulation. Because student interests vary widely, a one-size-fits-all narrative may not be effective for a diverse classroom. To address this challenge, a multi-narrative approach was developed. Instead of forcing all students through the same storyline, this method allows learners to choose from different narratives while still working toward the same educational goals. Each narrative includes the same sequence of programming problems and core content, ensuring consistency across paths.

This paper presents a system for designing and delivering gamified courses with multiple narrative options. The course content is structured using XML templates, which define the story, lessons, and exercises of the different narratives. These templates are processed by an algorithm with XSLT transformations that generates the exercises compliant with the FGPE Ecosystem, so that they can be edited with Authorkit [8] and solved in FGPE PLE [9], and creates a Moodle-MBZ file which can be imported into the learning management system. The exercises in the FGPE PLE [9] are connected with Moodle via LTI and external Moodle tools. Therefore, the Moodle-based course benefits from the automatic evaluation and immediate feedback on code submission of the PLE.

The rest of this paper starts with a review of related work on gamification, storytelling in education, and personalized learning. It then introduces storyline personalization and shows how multiple narratives fit within a unified course structure. Next, it outlines the gamification strategy spanning both Moodle and FGPE PLE [9], followed by the course generation workflow using XML-based templates. Finally, it discusses current challenges, limitations, and future directions.

2 Related Work

The design of effective educational experiences has increasingly relied on the convergence of gamification, storytelling, and personalization. This convergence aligns with broader pedagogical trends advocating for learner-centered and engaging approaches, particularly in online and technology-enhanced learning contexts. This section reviews the state of the art in these three intersecting domains and situates our multi-narrative gamified programming course within current research efforts.

2.1 Gamification in Programming Education

Gamification has evolved into a foundational methodology in digital learning environments, integrating mechanics such as points, badges, levels, and progress bars to enhance motivation and drive learner behavior [3]. Beyond surface-level engagement, gamification has shown promise in promoting deeper learning strategies and persistence, especially in domains like computer science where learners often face high cognitive load [10].

In programming education, tools such as CodeCombat, CheckiO, and the FGPE platform [9] provide structured and gamified practice spaces. These environments leverage immediate feedback, goal-oriented missions, and challenge-based progression to scaffold learners’ development. Our approach builds upon these foundations by embedding gamified programming tasks within narrative contexts that amplify emotional involvement and thematic continuity.

2.2 Narrative and Story-Based Learning

Storytelling is a powerful cognitive tool that supports knowledge organization, memory encoding, and identity construction [1]. In education, narratives are employed not only to illustrate complex concepts but also to foster learner immersion and empathy [2]. This is particularly effective in online courses where student disengagement remains a major challenge [6].

Research in digital storytelling highlights its value in transforming passive consumption into active knowledge construction. When stories are integrated into interactive environments, they create what Jenkins describes as “participatory culture” [4], where learners take ownership of their learning trajectories. Our design leverages this narrative potential by offering multiple thematic paths – such as environmental quests or cybersecurity missions – that frame programming exercises in coherent and compelling worlds.

2.3 Personalization and Multi-Narrative Design

Personalized learning systems adapt content, pace, or pedagogical strategies to match individual learner profiles [7]. This approach enhances motivation and efficacy, especially when learners can exercise agency in shaping their learning experiences. A growing body of work emphasizes the value of “choice-based personalization”, where learners select among equivalent but stylistically varied learning paths [5].

Multi-narrative course structures are an emergent form of such personalization. Rather than adapting content dynamically based on algorithms, they provide students with narrative autonomy – selecting the story they feel most connected to while ensuring uniform coverage of learning outcomes. Swacha et al. [8] first articulated this model in the context of programming education, showing that narrative and gamification diversity can enhance engagement without compromising assessment fairness.

3 Storyline Personalization

Narratives are commonly used in education to provide context and boost engagement. In learning environments, a well-crafted story can help students understand abstract concepts, stay motivated, and feel more connected to the material, especially in online courses, where learners often work independently. However, a single storyline may not appeal to everyone, as students have different interests, cultural backgrounds, and learning preferences. Offering multiple narrative options allows learners to engage with content in a way that feels more relevant and motivating to them. A multi-narrative course, however, requires careful design. All versions must follow the same structure, and the learning topics and exercises need to align in content and difficulty. This ensures that all students achieve the same learning outcomes, regardless of the narrative they choose.

To support the creation of a multi-narrative course, an XML-based structure was designed to represent both the general course layout and its narrative-specific variations. A key design consideration was to clearly separate elements that remain consistent across all course versions from those that vary depending on the chosen storyline.

Table 1 outlines this distinction. The general elements are those shared across all narratives to ensure coherence, consistency in learning objectives, and fair assessment. These include the overall course objectives, the structure and sequence of lessons, predefined gamification mechanisms, the order and pedagogical objective of exercises, and core learning materials such as PDF files. By maintaining these aspects across all versions, students following different narratives are guaranteed to achieve the same educational outcomes.

Table 1: General and Narrative-Specific Course Elements.
General Elements Narrative-Specific Elements
Course objectives Narrative themes and plot
Course structure (number and topics of lessons) Naming of gamification elements (badge)
Gamification elements Exercises (statements, test cases, solutions)
Exercise topics and their sequence
Learning materials (e.g., PDFs)

The separation between general and narrative-specific elements ensures that the core pedagogical design remains consistent, while allowing for flexibility in storytelling and personalization. For example, although the exercise objectives and types stay the same, the way they are embedded in the narrative with different statements, datasets and therefore test cases differ giving students a more immersive and contextualized experience. However, it must be stated that this approach on the other hand can also introduce a risk of difficulty imbalance between narrative versions.

Because of this differentiation, the course XML is generated in two phases: first, a general structure file containing the overarching course goals, lesson plan, and exercise definitions; and second, individual XML files for each narrative version, where storylines and exercise contextualization are added. This workflow is described in more detail in Section 5.

4 Gamification Architecture

Gamification is a strategy used to boost student motivation and engagement by incorporating game-like elements into educational activities. By adding features such as challenges, rewards, and progress tracking, gamification encourages active participation and provides immediate feedback, which helps improve learning outcomes.

In the designed approach, students interact with two systems: Moodle and the FGPE PLE [9]. Moodle presents the overall course structure, lessons, and narrative, while the FGPE PLE [9] hosts the exercises, which are grouped into missions and accessed through Moodle. The FGPE PLE [9] was chosen because it supports more specific gamification features and allows for automatic evaluation of programming exercises.

Therefore, the setup introduces two levels of gamification. The first is global gamification, which takes place in Moodle and involves the structure of the course and how students progress through lessons. The second is local gamification, which occurs within the FGPE PLE [9]. Here, game elements are applied to the missions themselves, creating a more interactive and engaging experience for students as they complete the exercises.

4.1 Global Gamification

Global gamification means adding game-like features to the course structure, specifically the lessons. The main idea is that students need to show they understand the current material before moving forward. This is done by organizing the course into clear sections, where students must finish specific tasks and meet minimum grade requirements.

The course’s story and learning progress work together. As students move through the sections, they also move through the story. This gives them a sense of achievement in both learning and following the story. The connection helps keep students interested and shows them how far they’ve come.

Moodle, the learning management system, handles this structure. It keeps track of student progress, makes sure they meet requirements before moving to new sections, and records completed tasks. This automatic tracking ensures fair rules while showing students their progress through the course. Additionally, leaderboards can be implemented to foster healthy competition among students, motivating them to excel and compare their progress with peers.

Such an overall approach helps keep students interested throughout the course while giving them a clear path for learning.

4.2 Local Gamification

Local gamification involves applying gamification elements to the missions within the course. These elements include:

  • Points: Students earn points as they complete tasks, offering a simple metric for tracking progress.

  • Badges: Rewards for completing specific tasks or achieving certain milestones, helping students visualize their accomplishments.

  • Progress Indicators: Visual representations of a student’s progress, showing how much of the mission has been completed and how much is left.

  • Hints: Additional guidance provided to students when they struggle with exercises, helping them overcome challenges without giving away the complete solution.

  • Completion Requirements: Students must achieve a minimum grade threshold to complete a mission, ensuring they have mastered the necessary skills before moving forward.

These gamification features are built into the FGPE PLE [9], where students work on their missions. The system automatically sends their progress and results back to Moodle through the LTI connection, keeping everything in sync.

5 Course Generation Workflow

Refer to caption

Figure 1: Workflow to Generate a Multi-narrative Programming Course.

Figure 2: Schema of an XML document describing a Complete Course.

The developed workflow for generating a multi-narrative gamified course, shown in Figure 1, is divided into two types of actions: user actions, where the educator provides specific data, and algorithmic generations, which create the intermediate narrative versions and the final Moodle MBZ file for import. The different files used in this process follow the XML format, and transformations are handled using the specific APIs along with XSLT 3.

The first step for the teacher is to complete a course template. This includes defining the course objectives, overall structure, lesson topics, desired exercise topics, version themes, and gamification elements. Based on this template, an algorithm then generates an XML file for each narrative version, aligned with the defined objectives and structure, and referencing the exercises outlined in the template.

In each of these version-specific XML files, the teacher must provide the storyline for the different lessons and the version-specific exercises. After this step is finished, an algorithm processes the version files together with the initial course template to create one complete course XML file. During this process, the system also verifies that each version includes the exercises and lessons defined in the template. The structure of the file is shown in Figure 2. It includes elements inherited from the template, such as the course name, description, groups, module names, and exercises with their IDs, which are indicated in blue. The version-specific parts are shown in orange, including missions and detailed exercises, and come from the specific version XML files.

This separation into a course template and version XML files was intentional. Filling out a single large XML file can be overwhelming, making it harder to focus on both the overall objectives and individual narratives. By dividing the process, educators can first define a clear structure and learning goals, and then develop each narrative version step-by-step while maintaining coherence between versions and consistency in learning objectives.

Once the complete course XML is created, the algorithm generates the exercises using in AuthorKit [8], a tool designed for creating gamified programming exercises. These exercises are grouped into a game and imported into the FGPE PLE [9]. Additionally, a Moodle backup (MBZ) file is generated to allow easy import into Moodle, one of the most widely used Learning Management Systems. Within Moodle, the games of FGPE PLE referred to as “missions” in a gamification context are linked via LTI to the external tool. Each lesson’s different narrative versions are made visible only to the respective student groups. At the beginning of the course, students can select the narrative they wish to follow by choosing a group through the Group Choice plugin.

6 Conclusion and Future Work

In a world that is increasingly polarized and shaped by diverse individual interests, offering multiple narratives in educational settings has become more important. This work presents an approach and a roadmap for creating a gamified, multi-narrative programming course. It addresses the challenges of maintaining coherence across different narrative versions while ensuring they align with the same learning objectives and difficulty levels. These challenges are managed by, first, developing a general base course template that clearly defines the learning goals and exercise objectives. Once this foundation is in place, the specific narratives and corresponding exercises are created, incorporating gamification elements. These components are then integrated, and an algorithm generates the exercises within the FGPE PLE [9]. Finally, a Moodle MBZ file is produced to allow for an easy import into Moodle, one of the most widely used learning management systems.

This paper presents ongoing work, and the validation of the multiple-narrative approach is planned. It is important to gain deeper insights into potential improvements in student engagement, satisfaction, and learning outcomes when learners are allowed to choose their own narrative, enabling a more personalized learning experience. Additionally, the current course creation process, based on filling out XML files, should be further developed into a user-friendly interface to support wider adoption. With the increasing capabilities of large language models (LLMs), integrating them into the course creation workflow would increase the speed and ease for teachers. LLMs can assist in outlining course objectives, structuring content, and generating exercises, narratives, and supporting materials such as PDF documents.

Combining flexible narratives, AI-assisted content creation, and gamified elements opens up new possibilities for creating personalized and engaging programming education. It also has the potential to reduce the workload for educators, allowing them to focus more on supporting students with specific learning needs.

References

  • [1] Jerome Bruner. The narrative construction of reality. Critical inquiry, 18(1):1–21, 1991. doi:10.1086/448619.
  • [2] Chih-Kai Chang and Ting-Kuang Yeh. The impact of storytelling on online learner engagement: A design-based research approach. Educational Technology Research and Development, 68:1051–1070, 2020.
  • [3] Athanasios Christopoulos and Stylianos Mystakidis. Gamification in education. Encyclopedia, 3(4):1223–1243, 2023. doi:10.3390/encyclopedia3040089.
  • [4] Henry Jenkins. Confronting the Challenges of Participatory Culture: Media Education for the 21st Century. MIT Press, 2009.
  • [5] Astrid Martens and Corentin Leclercq. Adaptive storytelling in education: A personalized learning framework. In International Conference on Artificial Intelligence in Education, pages 567–572. Springer, 2019.
  • [6] Areej Mawasi, Peter Nagy, and Ruth Wylie. Systematic literature review on narrative-based learning in educational technology learning environments (2007–2017). In Melissa Gresalfi and Ilana Seidel Horn, editors, 14th International Conference of the Learning Sciences: The Interdisciplinarity of the Learning Sciences, ICLS 2020 - Conference Proceedings, volume 3 of Computer-Supported Collaborative Learning Conference, CSCL, pages 1213–1220, Nashville, United States, 2020. International Society of the Learning Sciences (ISLS).
  • [7] Nneamaka Onyebuchi, Ayeni Olusola, Nancy Hamad, Blessing Osawaru, and Ololade Adewusi. Ai in education: A review of personalized learning and educational technology. GSC Advanced Research and Reviews, 18:261–271, February 2024. doi:10.30574/gscarr.2024.18.2.0062.
  • [8] José Carlos Paiva, Ricardo Queirós, José Paulo Leal, and Jakub Swacha. FGPE AuthorKit - a tool for authoring gamified programming educational content. In Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE ’20, page 564, New York, NY, USA, 2020. Association for Computing Machinery. doi:10.1145/3341525.3393978.
  • [9] José Carlos Paiva, Ricardo Queirós, José Paulo Leal, Jakub Swacha, and Filip Miernik. Managing gamified programming courses with the fgpe platform. Information, 13(2), 2022. doi:10.3390/info13020045.
  • [10] Zehui Zhan, Luyao He, Yao Tong, Xinya Liang, Shihao Guo, and Xixin Lan. The effectiveness of gamification in programming education: Evidence from a meta-analysis. Computers and Education: Artificial Intelligence, 3:100096, 2022. doi:10.1016/j.caeai.2022.100096.