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 @@ +
| Student | +Completed Tasks | +Pending Tasks | +Progress | +Engagement | +Grade | +Status | +
|---|---|---|---|---|---|---|
| {{student.name}} | + ++ {{student.completed}} + | + ++ {{student.pending}} + | + +
+
+
+ /
+
+
+
+ |
+
+ + {{student.engagement}} + | + ++ {{student.grade}} + | + ++ + + At Risk + + + + On Track + + + | + +