Skip to content

Integrate Enhanced Tutor Times Dashboard into 10.0.x#1079

Open
rammakablecode wants to merge 4 commits intodoubtfire-lms:10.0.xfrom
rammakablecode:resolve-merge-tutor-analysis-10x
Open

Integrate Enhanced Tutor Times Dashboard into 10.0.x#1079
rammakablecode wants to merge 4 commits intodoubtfire-lms:10.0.xfrom
rammakablecode:resolve-merge-tutor-analysis-10x

Conversation

@rammakablecode
Copy link

References:

Approved PR: thoth-tech#444
Depends on approved api PR: thoth-tech/doubtfire-api#83

Description

This PR integrates the approved enhancements from PR #444 into the 10.0.x branch. It transforms the Tutor Analytics view from a simple calendar timetable into a comprehensive data dashboard, leveraging the duration_minutes backend logic introduced in PR #83.

Key Motivations:

  • Previous frontend PRs to 9.x relied on dummy data. This version uses the GRAPE endpoint and is fully compatible with the updated session tracking backend from #83.
  • Reduced frontend computation:
    The frontend no longer performs time-delta calculations thanks to backend-calculated duration_minutes. Only filtering and O(n) calculations remain client-side.
  • Visual data trends:
    Grouped bar charts show trends in time spent and tasks assessed over time.
    At-a-glance metrics:
    Summary tiles display total hours, submissions opened, assessments made, and average minutes per assessment.

Dependencies

  • Added @swimlane/ngx-charts (v20.5.0) for data visualization.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Screenshot 2026-01-29 032756
  • Build & quality
    Production build: ng build --configuration production passes (AOT-safe)
    Linting: npm run lint passes (fixed any usage and unused imports)
  • Data & logic
    Date ranges: Custom ranges correctly include every day, even with zero activity
    Zero safety: Efficiency shows 0 instead of NaN when no assessments exist
    Filtering: Selecting a tutor updates both summary cards and charts
image

Testing Checklist:

  • Tested in latest Chrome

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link
Member

@b0ink b0ink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The angular module file seems to have a couple import issues, causing the build to fail, can you fix this?

Comment on lines -292 to +296
// import {GradeTaskModalComponent} from './tasks/modals/grade-task-modal/grade-task-modal.component';
// import {PrivacyPolicy} from './config/privacy-policy/privacy-policy';
import {GradeTaskModalComponent} from './tasks/modals/grade-task-modal/grade-task-modal.component';
import {PrivacyPolicy} from './config/privacy-policy/privacy-policy';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change and comment these imports out, as I believe these components are not yet present in 10.0.x

MatDialogModuleNew,
CalendarModule.forRoot({provide: CalendarDateAdapter, useFactory: adapterFactory}),
CodeEditorModule.forRoot(),
// HEAD (Main Branch) additions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

NgxGanttModule,
MatSidenavModule,
MonacoEditorModule.forRoot(),
// Feature Branch additions:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment

Comment on lines +315 to +317
// Feature Branch Imports
import {CommonModule} from '@angular/common';
import {NgxChartsModule} from '@swimlane/ngx-charts';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment and move these imports to line 10.

Does the CommonModule need to be imported?

(this.selectedUserId === null || e.userId === this.selectedUserId) &&
(!this.hideSessionsDuringTutorials || !e.duringTutorial) &&
e.duration >= 1,
e.duration >= 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We filter out sessions with less than 1 minute duration to hide any sessions that have ended but had no real activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants