ClassMG - Interactive Classroom Management System
Overview
ClassMG is a comprehensive classroom management application designed for interactive teaching and learning. The system enables real-time communication between teachers and students, interactive question sessions, and immediate feedback mechanisms, all within a unified digital classroom environment.
System Architecture
ClassMG is built on a client-server architecture:
- Client Application: Developed using HarmonyOS ArkTS for cross-device compatibility
- Communication Server: Node.js based server that enables real-time message passing and state synchronization
- Local Data Storage: Secure local storage for user credentials and session data
Core Features
1. Classroom Management
- Create Classroom: Teachers can create virtual classrooms with unique access codes
- Join Classroom: Students can join using classroom codes
Classroom Status: Real-time monitoring of active participants- End Classroom: Teachers can terminate sessions with proper notification to all participants
2. Real-time Communication
- Instant Messaging: Bi-directional communication between teachers and students
- Message Synchronization: Robust message delivery with automatic retry mechanisms
- Connection Status: Visual indicators for connection status with troubleshooting options
3. Interactive Questions
- Question Publishing: Teachers can create and publish multiple-choice questions
- Timed Responses: Configurable time limits for answering questions
- Answer Submission: Students can submit answers with immediate confirmation
- Result Analysis: Visual presentation of response statistics and correctness rates
4. User Experience
- Adaptive Layout: Responsive interface that works across different screen sizes
- Visual Feedback: Clear status indicators for all operations
- Error Handling: Comprehensive error notifications with recovery options
- Theme Customization: Personalized visual appearance settings
Operation Logic
Authentication Flow
- Users register with username and password (stored securely)
- Login verification against local credentials
- Role assignment (teacher or student) determines available features
Classroom Session Flow
- Teacher creates a classroom with a unique code
- Students join using the provided code
- Real-time synchronization establishes the classroom environment
- Teacher and students can exchange messages and participate in question sessions
- Teacher can end the classroom session, which notifies all participants
Messaging System
- Messages are composed and sent from the input area
- Local preview appears immediately for responsive UX
- Messages are transmitted to the server
- Server broadcasts messages to all connected devices
- Polling mechanism ensures message delivery, even after temporary disconnections
Question Management
- Teacher creates questions with multiple-choice options
- Students receive questions with configurable countdown timers
- Responses are collected and synchronized across devices
- Results are computed and displayed after the question ends
- Teachers can view detailed statistics while students see personal results
Technical Implementation
Communication Protocol
- HTTP-based API for classroom operations
- Polling mechanism for state synchronization
- JSON message format for data exchange
Data Security
- Local credential storage with encryption
- Classroom access controlled via unique codes
- Session validation for all operations
Synchronization Mechanism
- Server maintains the source of truth for classroom state
- Client polling ensures data consistency
- Conflict resolution strategies for concurrent operations
Error Handling
- Connection status monitoring
- Automatic reconnection attempts
- User-friendly error messages with recovery options
Server Setup
Prerequisites
- Node.js (v12 or higher)
- NPM (Node Package Manager)
Installation
- Install Node.js and NPM
- Clone or download the repository
- Install dependencies with
npm install
Running the Server
- Start with
npm start
ornode server.js
- Server will run on port 5243 by default
- Note your computer's IP address for client configuration
Client Configuration
Development Environment
- DevEco Studio (recommended)
- HarmonyOS SDK
Connection Setup
- Ensure all devices are on the same network
- Configure the server address in the client application
- Compile and deploy to testing devices
Troubleshooting
Connection Issues
- Verify all devices are on the same network
- Check server IP address and port configuration
- Use the built-in connection status checker in the application
Message Synchronization
- If messages aren't appearing across devices, check connection status
- Verify server is running properly
- Try reconnecting using the in-app troubleshooting button
Layout Problems
- If UI elements are misaligned or appear off-screen, restart the application
- Different device screen sizes may require application restart after significant layout changes
Notes for Developers
- The system uses a polling mechanism rather than WebSockets for compatibility reasons
- Message deduplication is implemented to handle potential duplicate delivery
- UI layouts are optimized for both tablet and smartphone form factors
- Debug logging can be enabled for troubleshooting purposes
Note: This document provides an overview of the ClassMG system. For detailed API documentation and developer guides, please refer to the technical documentation.
Languages
JavaScript
89.7%
TypeScript
10%
Shell
0.3%