From 6511f4dbef636537048cea8f8b94adffdfab1046 Mon Sep 17 00:00:00 2001 From: bkp385 Date: Sat, 9 May 2026 11:49:16 +0300 Subject: [PATCH] Added tutor analytics dashboard --- .../tutor-analytics/tutor-analytics.coffee | 65 +++++++ .../tutor-analytics/tutor-analytics.tpl.html | 160 ++++++++++++++++++ 2 files changed, 225 insertions(+) create mode 100644 src/app/tutor-analytics/tutor-analytics.coffee create mode 100644 src/app/tutor-analytics/tutor-analytics.tpl.html diff --git a/src/app/tutor-analytics/tutor-analytics.coffee b/src/app/tutor-analytics/tutor-analytics.coffee new file mode 100644 index 0000000000..c59d2a19a5 --- /dev/null +++ b/src/app/tutor-analytics/tutor-analytics.coffee @@ -0,0 +1,65 @@ +angular.module('doubtfire.tutor-analytics', []) + +.directive 'tutorAnalytics', -> + restrict: 'E' + replace: true + templateUrl: 'tutor-analytics/tutor-analytics.tpl.html' + + controller: ($scope) -> + + # Mock student analytics data + $scope.students = [ + { + name: 'John Smith' + completed: 8 + pending: 2 + engagement: 'High' + progress: 80 + grade: 'HD' + } + { + name: 'Sarah Lee' + completed: 5 + pending: 5 + engagement: 'Medium' + progress: 50 + grade: 'D' + } + { + name: 'Michael Brown' + completed: 3 + pending: 7 + engagement: 'Low' + progress: 30 + grade: 'C' + } + { + name: 'Emma Wilson' + completed: 9 + pending: 1 + engagement: 'High' + progress: 90 + grade: 'HD' + } + ] + + # Search model + $scope.searchText = '' + + # Count total students + $scope.totalStudents = $scope.students.length + + # Count at-risk students + $scope.atRiskCount = 0 + + angular.forEach $scope.students, (student) -> + if student.pending > 5 + $scope.atRiskCount++ + + # Determine if student is at risk + $scope.isAtRisk = (student) -> + student.pending > 5 + + # Calculate average progress + totalProgress = 0 + $scope.averageProgress = Math.round(totalProgress / $scope.students.length) \ No newline at end of file diff --git a/src/app/tutor-analytics/tutor-analytics.tpl.html b/src/app/tutor-analytics/tutor-analytics.tpl.html new file mode 100644 index 0000000000..b1803cff70 --- /dev/null +++ b/src/app/tutor-analytics/tutor-analytics.tpl.html @@ -0,0 +1,160 @@ +
+ + + + +
+ +
+
+
+ Total Students +
+ +
+

{{totalStudents}}

+
+
+
+ +
+
+
+ Average Progress +
+ +
+

{{averageProgress}}%

+
+
+
+ +
+
+
+ At-Risk Students +
+ +
+

{{atRiskCount}}

+
+
+
+ +
+ + +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+ +
+ Student Performance Analytics +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StudentCompleted TasksPending TasksProgressEngagementGradeStatus
{{student.name}} + {{student.completed}} + + {{student.pending}} + + +
+
/ +
+ + +
+ {{student.engagement}} + + {{student.grade}} + + + + At Risk + + + + On Track + + +
+ +
+ +
+ +
+ +
+ +
\ No newline at end of file