forked from doubtfire-lms/doubtfire-web
-
Notifications
You must be signed in to change notification settings - Fork 161
Enhanced Tutor Times Dashboard with Summary Cards and Activity Charts #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rammakablecode
wants to merge
3
commits into
thoth-tech:10.0.x
Choose a base branch
from
rammakablecode:feature-tutor-analysis-10x
base: 10.0.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Analytics & Session Tracking Handover | ||
|
|
||
| ## 1. Overview | ||
| The Tutor Analytics dashboard visualizes marking session data to provide insights into workload and efficiency. This document outlines the architecture implemented in the 10.0.x release and identifies specific data integrity observations, testing requirements and direction for future development. | ||
|
|
||
| ## 2. Architecture Status (Completed Work) | ||
| The following architecture has been implemented and verified in the 10.0.x branch: | ||
|
|
||
| * **Tracking Mode:** Automated / "Sticky Session" Logic. | ||
| * *Behavior:* Sessions are automatically created and extended to group user activity to continuous sessions. | ||
| * *Threshold:* A 15-minute inactivity window determines when a session closes. | ||
| * **Manual Timer:** (Mentioned in the Thoth-tec Documentation Website) Deprecated and removed from the UI to reduce tutor cognitive load. | ||
| * **Data Source:** * The `duration_minutes` field is now calculated and added on to the `MarkingSession` model in the backend (doubtfire-api). | ||
| * The frontend (doubtfire-web) dashboard consumes this pre-calculated value rather than performing date-diff logic client-side. | ||
| * **Visualization:** | ||
| * **Summary Cards:** Real-time metrics for Total Time, Tasks Assessed, Submissions Opened and Efficiency. | ||
| * **Activity Chart:** Grouped bar chart comparing "Hours Worked" and "Tasks Assessed" per day. | ||
|
|
||
| ## 3. Known Data Integrity Observations & Future Work | ||
|
|
||
| During implementation, code review of `doubtfire-api` and `doubtfire-web` identified three areas where data capture could be refined. | ||
|
|
||
| > **Note:** any changes to the logic below should be confirmed with the Product Owner, as they may alter historical data definitions or reporting metrics. | ||
|
|
||
| ### A. Zero-Minute Sessions (Backend) | ||
| * **Observation:** The dashboard displays valid sessions with `0 minutes` duration. | ||
| * **Root Cause:** The `SessionTracker` service uses a strict "Sticky Session" logic. | ||
| * *Scenario:* A tutor performs a single action (e.g., grading one student) at `12:00:00` and performs no further write actions. | ||
| * *Result:* `start_time` and `end_time` are identical (`12:00:00`), resulting in a 0-minute duration. | ||
| * **Impact:** This may result in the under-reporting of workload, as the reading time (cognitive load) preceding the action is not captured. | ||
| * **Suggested Improvement:** * Consider implementing a minimum duration floor (heuristic) in `SessionTracker`. | ||
| * *Example Logic:* On session creation, ensure `end_time` is at least `now + 5.minutes`. | ||
|
|
||
| ### B. Assessment Count Inflation (Backend) | ||
| * **Observation:** The "Tasks Assessed" metric can be higher than the actual number of unique students graded. | ||
| * **Root Cause:** `SessionTracker.record_assessment_activity` creates a `session_activity` record unconditionally every time the API endpoint is called. | ||
| * *Scenario:* A tutor clicks on a task multiple times without changing the status (e.g. re-saving 'Discuss' | ||
| status doubtfire-api/app/models/comments/discussion_comment.rb). | ||
| * *Result:* Multiple assessment activities are logged for a single logical action. | ||
| * **Suggested Improvement:** * Implement Dirty Checking or Hashing type solution in the Rails service to filter out redundant saves. | ||
| * *Example Logic:* Only call `record_assessment_activity` if there's a change in taskid. | ||
|
|
||
| ## 4. Future Contributions | ||
| * **Tutor Filtering:** The API can serve all tutor data to Convenors. The frontend requires a "Staff Selection" dropdown to filter the events array by user_id. | ||
|
|
||
| * **Granular Task Analytics:** To visualize time spent marking per Ontrack task, future teams should expose session_activities in the MarkingSessionEntity and calculate grouped durations on the frontend. | ||
|
|
||
| * **Threshhold & Date testing:** | ||
| - Ensure when running tests and asserting on session duration, call .reload on the model object. To ensure the API updates the database, but the local Ruby variable remains a stale snapshot. | ||
| - To force a session split in tests, ensure (travel 16.minutes) and ensure the previous session's end_time is properly persisted. | ||
| - Always use in_time_zone rather than to_time to avoid sub-second drift that can cause sessions to merge or split incorrectly during loops. |
rammakablecode marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.