Repository navigation
Activity Engine Wiki
- Introduction
- Core Features
- Architecture Overview
- Code Structure Diagram
- Deployment Notes
- Local Installation
The Activity Engine is designed to manage assessments with a focus on three main functionalities:
- Automated grading of assessments.
- Tracking user progress through assessments.
- Detecting anomalies during assessment submissions.
This document details the workings of the engine, providing a clear understanding of how the code implements these features.
The grading module automates the evaluation of assessment submissions. Key points include:
- Parsing answer sheets.
- Comparing responses against a predefined answer key.
- Generating scores with detailed feedback for each question.
An important behavior in the assessment grading process is that only when a correct answer is given, the user is allowed to proceed and watch the next video. If the answer is incorrect, the system requires rewatching the same video to encourage better understanding before moving forward.
The code components manage input validation, scoring logic, and result reporting to ensure consistent evaluation of assessments.
This module monitors and reports the progress of each user during assessment sessions. Its functionality includes:
- Recording each assessment attempt.
- Tracking time spent and completion metrics.
- Updating progress data in real-time for dashboards or reports.
- The progress tracker component calculates the percentage based on the duration watched relative to the total video length.
- The frontend renders the percentage in a visually appealing format, using a progress bar along the sidebar.
The implementation integrates with user accounts to provide clear progress overviews, which are invaluable for both students and administrators.
In addition to monitoring standard assessment metrics, this module now checks for specific in-person examination conditions, including:
- Users signaling participation through hand raise actions.
- Verification that a single individual is present during the assessment.
- Detection to ensure no cell phone usage occurs during the session.
These checks support compliance with exam protocols and help maintain assessment integrity.
The module leverages statistical analysis, cross-checks against normal behavior patterns, and logs incidents for further investigation.
The system is structured into three main components corresponding to each core feature:
- The Grading Engine processes submission data and outputs scores.
- The Progress Tracker updates user performance metrics in near real-time.
- The Anomaly Detector monitors activity streams to catch irregular behaviors.
These components interact seamlessly, drawing input from assessment submissions and outputting detailed reports and flags, ensuring a robust system for educational assessment management.
Below is the structural diagram that connects the different modules in the Activity Engine:
activity_engine
|- src
| |- controller (contains different controllers for each API call functionality)
| |- middleware (contains googleAuthentication middleware responsible for authenticating the user)
| |- routes (contains different route files with all backend routes)
| |- repositories (contains all repository files)
| |- services (contains all services for each functionality)
| |- types (contains types for different elements)
| |- constant.ts (contains the URL of the LM engine)
| |- server.ts (Express server file)
|- prisma
| |- migrations (contains all migrations)
| |- schema.prisma (contains the Prisma schema or database schema for data storage)
Step 1: Download the Code From GitHub to Local Environment
https://github.com/Amritkumarchanchal/activity-deployment.git
Step 2: Download the Google Cloud CLI installer and create a project named CAL Activity Engine.
For guidance, refer to:
https://cloud.google.com/appengine/docs/standard/nodejs/building-app/creating-project?cloudshell=true
Step 3: Enable access to the required APIs in the Google Cloud Console (refer to the above documentation).
Step 4: Open your Google Cloud CLI on your PC, select your project, and navigate to the folder where the code is located (for example:
cd "C:\Users\mramr\Downloads\lms_engine-LMS3-Testing\lms_engine-LMS3-Testing” or the Activity Engine folder).
Step 5: Create two configuration files in your local code: app.yaml and .gcloudignore (similar to .env or .gitignore files).
-
Code for app.yaml:
runtime: nodejs20 env_variables: DATABASE_URL: "postgresql://postgres.ucvqgjbokcojtmhvcguc:9oSvDva1HQp0yH7B@aws-0-ap-south-1.pooler.supabase.com:PORT/postgres"
Step 6: Run these commands on your local machine to verify everything is working properly:
- Run
npm installto install all Node modules. - Run
npm run buildto create the dist folder. - Run
npx prisma migrateto handle database migrations. - Run
npm run devto start the development server.
Step 7: Once the application works locally, deploy the code to GCP with:
gcloud app deploy --no-cache
Step 8: After successful deployment, you'll see a confirmation message similar to:
Deployed service [default] to [https://cal-activity-engine.el.r.appspot.com/](https://cal-activity-engine.el.r.appspot.com/)
You can view logs by running: gcloud app logs tail -s default
And open your application in the web browser by executing: gcloud app browse
To install and run the Activity Engine locally, follow these highlighted steps:
-
Clone the Repository
Clone the GitHub repository to your local machine:git clone https://github.com/Amritkumarchanchal/activity-deployment.git -
Install Dependencies
Navigate to the project directory and run:npm install -
Build the Application
Compile the application with:npm run build -
Apply Database Migrations
Run the following command to manage database schema:npx prisma migrate -
Run the Development Server
Start the local development server using:npm run dev
Follow these steps to ensure a successful local installation and testing of the Activity Engine.
Dhananjaya Lab for Education Design IIT Ropar