លំហសិក្សាកម្ពុជា លំហសិក្សាកម្ពុជា V1.0
ចូល ចុះឈ្មោះ

Final Report: 'Study Sprout' Learning Management System

មូលសង្ខេប / Abstract

StudySprout is a web-based Gamified Learning Management System developed using Flask, OOP, SQLAlchemy ORM, and SQLite/MySQL. It supports course management, lesson tracking, and role-based access for users such as Students, Professors, and Administrators. To improve student engagement, the system includes daily streaks, reward points, and course completion bonuses. Evaluation showed consistent data management, responsive navigation, request times under 100ms, and high user satisfaction.

ពាក្យគន្លឹះ






Final Report: ‘Study Sprout’ Learning Management System

 Using Object-Oriented Programming and Flask 3.0.3



for



Course: Object-Oriented Programming II

Class: CSM1



Authors



Bun Sahanou (ID: ST-00057), Thy Lyyong (ID: ST-00017), Ty Reaksa (ID: ST-000118), 

Vichet Thody (ID: ST-RE00064)




Lecturer


Sek Socheat



Academic Year


2026 - 2027





Abstract


Traditional e-learning management systems frequently suffer from low student engagement, lack of continuous progress tracking, and cumbersome administrative overhead. This report details the design, implementation, and evaluation of StudySprout, a web-based Gamified Learning Management System developed using the Flask framework, Object-Oriented Programming (OOP) principles, SQLAlchemy ORM, and relational database management systems (SQLite/MySQL). Edu Platform integrates core educational management functionality—such as course publishing, lesson tracking, and role-based administration—with gamification mechanisms including daily active streaks, point reward audits, and course graduation bonuses. The platform implements Role-Based Access Control (RBAC) across three primary user roles: Student, Professor, and Administrator. System evaluations demonstrate robust data consistency, responsive navigation, sub-100ms request performance, and high user satisfaction.



Keywords: Learning Management System, Flask, Gamification, Object-Oriented Programming, SQLAlchemy, Relational Database, Role-Based Access Control.



  1. Introduction


Background of Study 


The digital transformation of educational institutions has made e-learning platforms central to modern pedagogical delivery. However, first-generation learning management solutions primarily treat web portals as static document repositories, leaving students to consume content passively without immediate feedback loops. Empirical observations show that without interactive mechanics or visible milestone progress, student course completion rates drop dramatically over extended academic terms.

StudySprout was conceived to address these limitations by integrating behavioral gamification directly into the application architecture. By framing learning progress around actionable daily goals, point feedback, and peer achievement, the system transforms standard coursework into an active learning experience.


1.1. Problem Statement

In traditional educational environments and standard learning management setups, student engagement and administrative tracking present significant operational challenges. Instructors and platform administrators frequently grapple with:

  • Passive Student Engagement: Lack of continuous tracking mechanisms (such as learning streaks or dynamic reward points) leads to low course completion rates.

  • Manual Administrative Overhead: Difficulty in tracking system-wide user activity, user roles, and operational changes without proper audit logging.

  • Inflexible Database Integrations: Systems tied strictly to a single database environment often fail to provide seamless zero-configuration development alongside scalable production deployments.


1.2. Objectives and Success Criteria


Table 1.2 Objectives and Evaluation Criteria

Objectives

Measurable Success Criteria

Build user authentication and role-based access 

Users can register, log in, and log out securely; system supports Student, Professor, and Administrator roles with protected route access 

Design clean Object-Oriented Programming (OOP) layers 

Application architecture cleanly separates presentation, routing controllers, business services, and database data models with single-responsibility principles. 

Implement a relational database schema (SQLite / MySQL) 

Database design includes full Entity-Relationship Diagram (ERD), schema creation scripts, primary/foreign key constraints, transactional logs, and seed data. 

Develop interactive learning and course management features 

Professors can create and publish course tracks with lessons; students can enroll, read course materials, and track track completion percentages.

Implement gamification mechanics and automated scoring 

The system automatically increments daily activity streaks, records transaction logs for point distribution, and grants graduation milestone bonuses upon track completion. 

Provide administrative governance and audit logging 

Administrators can manage user profiles, modify account roles, moderate published course content, and inspect system audit history logs 

Test core business rules and system security 

Execution of structured integration and end-to-end test cases verifying system functionality, access control enforcement, and database reliability. 



1.3. Scope

  • Supported Capabilities: User registration/authentication, role switching, course creation and publishing, interactive lesson reader, point calculations, background streak maintenance, leaderboard rankings, and system audit logs.
  • System Boundaries: The current release operates as a responsive web application; native offline desktop binaries and native mobile applications are outside the current project scope.



1.4. Significance 

StudySprout enhances learning outcomes by rewarding consistent daily activity and milestone achievements. For educators, it streamlines course construction and publishing. For platform administrators, it ensures operational accountability through structured audit logs and governance tools. 



II. Literature Review and Development Background 

2.1. Analysis of Relation System


Table 2.1 Comparison of Existing Systems and Proposed System 

Platform / System 

Core Features 

Strengths 

Limitations 

Lessons Applied to Proposed System  

Traditional LMS (e.g. Moodle) 

Static course modules, assignments, manual grading. 

Highly stable, extensive ecosystem. 

Complex UI, lack of intrinsic gamification loops. 

Streamline UI/UX, embed native point rewards and active streak indicators 

Gamified Learning Apps (e.g. Duolingo) 

Daily streaks, experience points (XP), leaderboards. 

High engagement and daily retention. 

Focused primarily on language micro-learning rather than broader academic tracks. 

Adapt streak auto-reset and points logging for broader university and professional course tracks 

StudySprout (Proposed System) 

Dynamic tracks, lesson reader, RBAC governance, streak reset engine, point auditing

Combines academic course management with real-time gamified rewards and administrative auditing.

Requires active connection (web-based prototype).

Modular architecture with zero-config local SQLite fallback and production MySQL capability. 



2.2 Concepts and Technologies 


This section must define the main concepts and technologies used in the project, such as Programming, Object-Oriented Programming, Python 3, PyQt6, SQLite3, relational database UI/UX design and software testing. 


Table 2.2 Definitions of Main Concepts and Technologies

Concept or Technology 

Definition and Use in the Project

Object-Oriented Programming (OOP) 

Structures logic into modular entities, grouping attributes and behaviors for reusability. 

Flask Framework 

Lightweight web framework managing routing, sessions, and template rendering. 

Relational Database (RDBMS) 

Organizes data into structured tables with key relationships to ensure integrity. 

SQLAlchemy ORM 

Maps data models to database queries, supporting both SQLite and MySQL 

Role-Based Access Control (RBAC) 

Restricts route access and features based on assigned user permissions. 

Gamification Engine 

Implements reward loops like daily active streaks, points logging, and milestone bonuses.

UI/UX Design

Responsive visual layout with progress indicators to improve user experience.

Software Testing 

Automated integration checks to verify routes, security rules, and user workflows. 




III. System Analysis Design

3.1 User Stories & Stakeholder Matrix 


Table 3.1 Stakeholder Roles and Functional Requirements

Stakeholder Role

Primary Goal

Key Action/User Story

System Output

Student 

Learn interactively and maintain progress. 

Enroll in tracks, complete lessons, view streaks and point rankings.

Updated leaderboard rank and active streak count.

Professor

Build and distribute course content. 

Create course structures, add lessons, set point values, and publish. 

Published course visible in public catalog. 

Administrator

Oversee platform operations and security.

Manage users, alter roles, moderate content, and view system logs. 

Complete administrative audit trail. 


3.2. SDLC Model

Figure 3.2 Agile Inspired SDLC Workflow 


3.3. System Architecture Design 

The application employs a 4-Tier Layered Architecture:

  1. Presentation Layer: HTML5, Modern Glassmorphism CSS, dynamic Jinja2 templates.

  2. Controller Layer: Flask Blueprints (main, auth, student, professor, admin).

  3. Service Layer: Independent business logic engines (Streak Engine, Points Audit Service, Progress Calculation Service, Seed Service).

  4. Data Access Layer: SQLAlchemy ORM mapping Python structures to relational SQLite/MySQL database tables.

Figure 3.3 Study Sprout Learning Management System Architecture Design


3.4 OOP Design and Class Structure

The underlying database comprises seven interconnected tables:

  • users: Stores user attributes, hashed passwords, assigned role, accumulated points, active streak, and last active date.

  • courses: Stores course metadata, title, description, instructor foreign key, and publication state.

  • lessons: Stores individual lesson modules tied to a course, topic content, ordering index, and point rewards.

  • enrollments: Links users to courses with enrollment status (pending, in_progress, completed).

  • lesson_progress: Tracks completion states per student per lesson.

  • points_log: Audit log recording every point transaction, timestamp, student ID, and reason.

  • audit_logs: System operational log tracking administrative actions, user role modifications, resource deletions, and client IP addresses.


3.5 Database Design Using SQLite3 or RDBMS

Table 3.5 Database Design Distribution

Table Name

Field Name

Data Type

Key

Description

users

id

INT

Primary Key

Unique user identification number

-

user_code

VARCHAR(30)

-

Unique system code assigned to user

-

full_name

VARCHAR(100)

-

Full name of the registered user

-

email

VARCHAR(120)

-

Account email address for login

-

password_hash

VARCHAR(255)

-

Encrypted account password

-

total_points

INT

-

Accumulated gamification reward points

-

current_streak

INT

-

Active consecutive daily login/learning streak

-

longest_streak

INT

-

Record highest streak achieved

-

last_active_date

DATE

-

Date of last recorded system activity

-

created_at

TIMESTAMP

-

Timestamp of account creation

student_profiles

id

INT

Primary Key

Unique profile identifier

-

user_id

INT

Foreign Key

Links to users.id

-

student_id_number

VARCHAR(30)

-

Institutional student identifier

-

major

VARCHAR(100)

-

Field of study or degree program

-

cumulative_gpa

DECIMAL(3,2)

-

Academic grade point average

-

admission_date

DATE

-

Date of enrollment in institution

-

created_at

TIMESTAMP

-

Timestamp of profile creation

roles

id

INT

Primary Key

Unique role identifier

-

name

VARCHAR(50)

-

System role name (e.g., student, admin)

-

display_name

VARCHAR(80)

-

User-friendly role display label

-

created_at

TIMESTAMP

-

Timestamp of role creation

user_roles

user_id

INT

Foreign Key

Links to users.id

-

role_id

INT

Foreign Key

Links to roles.id

modules

id

INT

Primary Key

Unique system module identifier

-

name

VARCHAR(50)

-

Name of system module

-

code

VARCHAR(50)

-

Module short reference code

-

description

VARCHAR(255)

-

Summary of module functionality

-

created_at

TIMESTAMP

-

Timestamp of module creation

permissions

id

INT

Primary Key

Unique permission identifier

-

module_id

INT

Foreign Key

Links to modules.id

-

name

VARCHAR(80)

-

Permission action name

-

description

VARCHAR(200)

-

Explanation of granted access

-

created_at

TIMESTAMP

-

Timestamp of permission creation

role_permissions

role_id

INT

Foreign Key

Links to roles.id

-

permission_id

INT

Foreign Key

Links to permissions.id

courses

id

INT

Primary Key

Unique course track identifier

-

title

VARCHAR(150)

-

Name of the course

-

description

TEXT

-

Course track syllabus and overview

-

professor_id

INT

Foreign Key

Links to users.id (Instructor)

-

is_published

TINYINT(1)

-

Publication status flag

-

created_at

TIMESTAMP

-

Timestamp of course creation

lessons

id

INT

Primary Key

Unique lesson topic identifier

-

course_id

INT

Foreign Key

Links to courses.id

-

title

VARCHAR(150)

-

Title of individual lesson module

-

content

TEXT

-

Learning material and reading content

-

lesson_order

INT

-

Sequential order index within course

-

points_value

INT

-

Point reward for completing lesson

-

created_at

TIMESTAMP

-

Timestamp of lesson creation

lesson_progress

id

INT

Primary Key

Unique progress tracker identifier

-

student_id

INT

Foreign Key

Links to users.id

-

lesson_id

INT

Foreign Key

Links to lessons.id

-

is_completed

TINYINT(1)

-

Completion status flag

-

completed_at

TIMESTAMP

-

Timestamp when lesson was completed

enrollments

id

INT

Primary Key

Unique enrollment record identifier

-

student_id

INT

Foreign Key

Links to users.id

-

course_id

INT

Foreign Key

Links to courses.id

-

status

ENUM

-

Enrollment status (e.g., active, completed)

-

enrolled_at

TIMESTAMP

-

Date/time of track enrollment

-

completed_at

TIMESTAMP

-

Date/time of course graduation

assignments

id

INT

Primary Key

Unique assignment identifier

-

course_id

INT

Foreign Key

Links to courses.id

-

title

VARCHAR(150)

-

Title of assignment task

-

description

TEXT

-

Detailed assignment requirements

-

max_score

DECIMAL(5,2)

-

Maximum obtainable grade points

-

due_date

DATETIME

-

Submission deadline timestamp

-

created_at

TIMESTAMP

-

Timestamp of task creation

submissions

id

INT

Primary Key

Unique submission identifier

-

assignment_id

INT

Foreign Key

Links to assignments.id

-

student_id

INT

Foreign Key

Links to users.id

-

submission_text

TEXT

-

Submitted text content or file links

-

score

DECIMAL(5,2)

-

Graded points assigned by instructor

-

feedback

TEXT

-

Instructor feedback notes

-

status

ENUM

-

Submission status (e.g., submitted, graded)

-

submitted_at

TIMESTAMP

-

Timestamp when task was submitted

points_log

id

INT

Primary Key

Unique point transaction identifier

-

student_id

INT

Foreign Key

Links to users.id

-

points

INT

-

Numeric points added or deducted

-

reason

VARCHAR(100)

-

Transaction cause (e.g., lesson completed)

-

created_at

TIMESTAMP

-

Timestamp of point distribution

audit_logs

id

INT

Primary Key

Unique audit log identifier

-

user_id

INT

Foreign Key

Links to users.id

-

user_name

VARCHAR(100)

-

Name of user performing action

-

user_email

VARCHAR(120)

-

Email of user performing action

-

user_role

VARCHAR(50)

-

Role of user performing action

-

action

VARCHAR(50)

-

Administrative operation executed

-

target_type

VARCHAR(50)

-

Entity modified (e.g., User, Course)

-

target_id

INT

-

ID of target entity modified

-

target_name

VARCHAR(150)

-

Name/title of target entity

-

details

TEXT

-

Full technical details of action

-

ip_address

VARCHAR(45)

-

Client IP address of incoming request

-

created_at

TIMESTAMP

-

Timestamp of action execution


Figure 3.4 Entity Relationship Diagram (ERD)


  1. System Analysis 

4.1. Package & Project Directory Structure 

The application repository is organized into distinct logical modules:


app/

├── __pycache__/

├── assets/

├── content/lessons/

├── routes/

│   ├── __pycache__/

│   ├── admin.py

│   ├── auth.py

│   ├── main.py

│   ├── professor.py

│   └── student.py

├── services/

│   ├── __pycache__/

│   ├── audit_service.py

│   ├── boss_service.py

│   ├── focus_service.py

│   ├── pet_service.py

│   ├── points_service.py

│   ├── progress_service.py

│   ├── seed_content.py

│   ├── seed_service.py

│   └── streak_service.py

├── static/

├── templates/

├── __init__.py

├── decorators.py

└── models.py

database/

docs/ 


4.2. Key System Modules & Services 

  • Application Factory: Initializes web extensions, registers routing blueprints, sets up background scheduling tasks, and manages database connection checks.


  • Streak Tracking Engine: Computes continuous student learning activity. When a student completes a lesson within 24 hours of their last activity, their streak counter increases; if a daily window is missed, a scheduled background job automatically resets the streak to zero.


  • Points Audit Service: Guarantees that every point addition (from reading topics or achieving milestones) is saved as an immutable audit record in the database.


  • Progress Calculation Service: Evaluates overall course completion percentages, updates enrollment states, and awards graduation milestone bonuses once all lessons in a track are finished.


  • Role Governance & Access Protection: Enforces access permissions across student, professor, and administrator views, preventing unauthorized access.




V. Testing and Result

5.1 Test Scenario 


The section showcases Test ID indicating the user role being tested, followed by numerical value identifying the sequence of the test case: 

  • TS refers to Student user

  • TP refers to Professor user

  • TA refers to Administrator user 


Table 5.1 System Functionality Test and Results

Test ID 

Actions

Inputted Data

Actual Result

Status 

TS01

Sign In 

Click autofill password for ‘roles’ or fill email & passwords to sign in 

With correct inputted data, users are able to log in to their designated dashboard


PASS

TS02

Boss Fight (XP)

Under ‘Boss Arena’ function, select ‘Challenge Boss Now’ 

Students with correct answers are given certain XP after finishing a fight


PASS

TS03

Pomodoro Timer

Under ‘Focus Shrine’ function, click ‘Start Focus’ to start the timer 

Students can track their study time with curated timer and customizable break time


PASS

TS04

Student’s hall of fame

Under ‘Champions’ function

Users can oversee their total XP, active streaks and levels live 


PASS

TS05



Track progress

Under ‘Profile & Ledger’ function, click ‘Points History & Audit’

Students can check their points history & audit from their progress with amount of pointed awarded 


PASS

TS06



Profile update 

Under ‘Profile & Ledger’ function, click ‘Account Settings’, input data, click ‘Save Profile Changes’ 


Students can update, save profile changes such as Name displayed and Email address

PASS

TP01

Create new course


On ‘Instructor Studio’ dashboard, click ‘Create New Course’


Professor are able to create and input description for new courses 

PASS

TP02

Manage courses


On ‘Instructor Studio’ dashboard, click ‘Manage Lesson’ and ‘Edit Track Info’


Professor can edit courses they have created, delete and drafted 

PASS

TA01


Manage Users


On Administrator dashboard, click ‘Manage Users’, change accordingly, click ‘Save’


Admins are able to set role permission for each user 

PASS

TA02



Create new roles

On Administrator dashboard, click ‘RBAC Permissions’, click ‘Create New Role’


Admins can create new RBAC roles with curated permission 

PASS

TA03



Platform courses

Under ‘All Platform Courses’ function

Admins dashboard enable creating, alter, add, delete courses


PASS



5.2 Demo Results

Figure 5.2.1 Sign In Dashboard




Figure 5.2.2 User Student’s Dashboard


[1] Academy: main student dashboard providing access to the platform learning features.

[2] Quest Board: consist of functions where students can select a learning campaign, complete lessons, earn XP and unlock Boss Raid Battles.

[3] Champions: display all student’s level, active streaks, longest streaks, total XP and live leaderboard rankings.

[4] Character Sheet: provide overview of student’s profile with daily engagement, learning progress, active quests and enrolled courses.

[5] Boss Arena: allows students to challenge course-based boss fights, earn XP and test their knowledge. 

[6] Focus Shrine: a pomodoro-based timer to track study sessions with customized break time durations.




Figure 5.2.3 User Professor’s Dashboard


[1] Create New Course: enable professors to create new courses, define their curriculum and lessons.

[2] Manage Lessons: allows professors to add, delete and update within their course accordingly. 




Table 5.2.4 User Admin’s Dashboard


[1] RBAC Permissions: allows administrators to create roles and configure permission across all platform operations.

[2] Manage Users: provide an overview of users, their assigned  role and permissions and allows admin to create and appoint roles for users. 

[3] Manage Courses: provide an overview of courses, lead instructor, lessons and status while allowing administrator to inspect, edit and delete courses. 

[4] Audit Logs: showcase complete record of administrators and professors operations with timestamps and user details, with filtering options for specific roles. 



5.3 Performance/Security Notes


Performance Evaluation

Performance benchmark tests were conducted to evaluate rendering speed, component loading and dynamic UI updates with metrics using Safari Web Inspector (Timeline Profiler). 


Table 5.3 System Performance Evaluation and Execution Benchmarks

Test ID

Features Tested

Target Threshold

Actual Result 

Status

PE01

Student Dashboard Initial Load


< 1.0 s

391 ms

PASS

PE02

Boss Raid Fight Submission & Pts Processing


< 500 ms

267 ms

PASS

PE03


Students Live Ranks Calculation 


< 500 ms

203 ms

PASS

PE04

Log Out Dashboard


< 1.0 s

270 ms

PASS

PE05

Publish Course


< 200 ms

183 ms

PASS

PE06

Update Role for Users


< 200 ms

135 ms

PASS

PE07

Create New Roles


< 200 ms 

165 ms

PASS

PE08

Filter Database Audit & Activity Logs


< 200 ms

125 ms 

PASS



Security Measures

  • Authentication & Password Hashing: user passwords are securely salted and hashed using Bcrypt/Werkzeug before database storage. Plain-texted passwords are never stored or logged. 

  • Role-Based Access Control (RBAC): Backend middleware verifies user roles for every request and blocks unauthorized access with a ‘403 Forbidden’ response.

  • SQL Injection & XSS Prevention: Parameterized ORM queries protect against SQL injection while user inputs are sanitized before rendering to reduce Cross-Site Scripting (XSS) risks.

  • Gamification Logic & XP Protection: Experience Point (XP) calculations, quest completions and badge rewards are validated on the Flask backend, preventing client-side manipulation of points.  




  1. Conclusion and Future Development

6.1. Summary of Contributions


The StudySprout project successfully demonstrates a functional, gamified learning management system. Key achievements include:

  • Successful application of Object-Oriented Programming and modular architecture patterns.

  • Implementation of continuous motivation mechanics including streak tracking, audited points distribution, and graduation bonuses.

  • Delivery of Role-Based Access Control and administrative audit logging for system governance.

  • Flexible dual-database connectivity supporting both local zero-configuration development and production-grade database setups.


6.2. Limitation and Lessons learned

  • Prototype Scope: The application currently functions as a web-based platform; offline client-side caching and mobile application wrappers are not included in this phase.


  • Real-time Push Notifications: Leaderboards currently update upon page interaction rather than utilizing live WebSocket updates.



6.3. Future Development


Table 6.3 Future Development Plans

Improvement Item 

Description / Objective 

Priority 

Native Desktop Wrapper 

Build a desktop client launcher for standalone institutional computers.

Medium 

WebSocket Broadcasting 

Integrate real-time leaderboard updates and instant notification popups. 

Medium 

Cloud Storage Integration 

Enable direct video lesson uploads and downloadable media storage. 

High 

Automated Data Backup 

Implement one-click database export and snapshot routines for administrators. 

High 


References 

Flask Application 3.0.3 

Lecturer’s Notes



OOPIIFinalSlides.pdf
PDF ឯកសារ
ទាញយក អាន
ចែករំលែក
រក្សាទុក
ការផ្សព្វផ្សាយ
ការផ្សព្វផ្សាយ
មតិយោបល់ 0
ចូលគណនី ដើម្បីបញ្ចេញមតិ