forked from JerryIdoko/starked-education
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreportService.ts
More file actions
33 lines (29 loc) · 1.2 KB
/
Copy pathreportService.ts
File metadata and controls
33 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { DataAggregationService } from './dataAggregation';
import { TrendAnalysisService } from './trendAnalysis';
export class ReportService {
static async generateCoursePerformanceReport(courseId: string) {
const stats = await DataAggregationService.getCourseCompletionStats(courseId);
return {
reportType: 'COURSE_PERFORMANCE',
generatedAt: new Date().toISOString(),
courseId,
metrics: {
totalEnrolled: parseInt(stats.total_enrolled || '0'),
completionCount: parseInt(stats.completed_count || '0'),
averageProgress: parseFloat(stats.average_progress || '0').toFixed(2) + '%'
},
summary: `Course ${courseId} has ${stats.total_enrolled} students with a ${parseFloat(stats.average_progress || '0').toFixed(1)}% average progress.`
};
}
static async generateUserProgressReport(userId: string) {
const activity = await DataAggregationService.getUserDailyActivity(userId, 30);
const patterns = TrendAnalysisService.analyzeActivityPatterns(activity);
return {
reportType: 'USER_PROGRESS',
generatedAt: new Date().toISOString(),
userId,
activitySummary: patterns,
detailedActivity: activity
};
}
}