From e411962a03a2e73aecb4cc952db359adac2e0fb3 Mon Sep 17 00:00:00 2001 From: Saleem Latif Date: Tue, 25 Feb 2025 13:31:24 +0500 Subject: [PATCH] feat: Added 3 new columns in module activity report. --- .../Admin/__snapshots__/Admin.test.jsx.snap | 4084 +++++++++++++---- .../Admin/tabs/ModuleActivityReport.jsx | 24 + .../Admin/tabs/ModuleActivityReport.test.jsx | 6 + 3 files changed, 3194 insertions(+), 920 deletions(-) diff --git a/src/components/Admin/__snapshots__/Admin.test.jsx.snap b/src/components/Admin/__snapshots__/Admin.test.jsx.snap index d0894c2a1c..c7775636e3 100644 --- a/src/components/Admin/__snapshots__/Admin.test.jsx.snap +++ b/src/components/Admin/__snapshots__/Admin.test.jsx.snap @@ -779,6 +779,138 @@ exports[` renders correctly calls fetchDashboardAnalytics prop 1`] = ` + + + + Learning Outcomes: Before + + + + + + + + + + + + Learning Outcomes: After + + + + + + + + + + + + Learning Outcomes % Difference + + + + + + + + renders correctly with dashboard analytics data renders # cou - - - - - -
- -
- - - - - - - - - - -`; - -exports[` renders correctly with dashboard analytics data renders # of courses completed by learner 1`] = ` -
-
-
-

- Learner Progress Report -

-
-
- edX logo + + + + Learning Outcomes % Difference + + + + + + + + + + + + +
+
+ +
+
+ + + + + + + + +
+`; + +exports[` renders correctly with dashboard analytics data renders # of courses completed by learner 1`] = ` +
+
+
+

+ Learner Progress Report +

+
+
+ edX logo
@@ -4095,48 +4359,31 @@ exports[` renders correctly with dashboard analytics data renders # of - - - - - -
-
+
+
-
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
`; @@ -7411,48 +7939,31 @@ exports[` renders correctly with dashboard analytics data renders colla - - - - - -
- -
- - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + @@ -9069,48 +9729,31 @@ exports[` renders correctly with dashboard analytics data renders full - - - - - -
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + + `; @@ -10727,48 +11519,31 @@ exports[` renders correctly with dashboard analytics data renders inact - - - - - -
- -
- - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + @@ -12385,48 +13309,31 @@ exports[` renders correctly with dashboard analytics data renders inact - - - - - -
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + + `; @@ -14043,48 +15099,31 @@ exports[` renders correctly with dashboard analytics data renders learn - - - - - -
- -
- - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + @@ -15701,48 +16889,31 @@ exports[` renders correctly with dashboard analytics data renders regis - - - - - -
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + + `; @@ -17359,48 +18679,31 @@ exports[` renders correctly with dashboard analytics data renders top a - - - - - -
- -
- - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + @@ -19066,48 +20518,31 @@ exports[` renders correctly with dashboard insights data renders dashbo - - - - - -
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + + `; @@ -20724,48 +22308,31 @@ exports[` renders correctly with enterprise budgets data renders budget - - - - - -
- -
- - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + @@ -22382,48 +24098,31 @@ exports[` renders correctly with enterprise groups data renders groups - - - - - -
- -
- - - - - - - - - + + + + + Learning Outcomes % Difference + + + + + + + + + + + + + +
+ +
+ + + + + + + + + `; @@ -23257,6 +25105,138 @@ exports[` renders correctly with error state 1`] = ` + + + + Learning Outcomes: Before + + + + + + + + + + + + Learning Outcomes: After + + + + + + + + + + + + Learning Outcomes % Difference + + + + + + + + renders correctly with loading state 1`] = ` className="pgn__table-actions" data-testid="table-actions" > -
+ +
+ + + + + +
+
+
+ + loading + +
+
+ + + + + +
+ + + Email + + + + + + + + + + + Course Title + + + + + + + + + - - - - - - - -
-
-
- - loading - -
-
- - - + + + + + + + + { }), accessor: 'log_viewed', }, + { + Header: intl.formatMessage({ + id: 'adminPortal.LPR.moduleActivityReport.table.header.learningOutcomesBefore', + defaultMessage: 'Learning Outcomes: Before', + description: 'Header for the learning outcomes before the user has started the course column in the module activity report table', + }), + accessor: 'avg_before_lo_score', + }, + { + Header: intl.formatMessage({ + id: 'adminPortal.LPR.moduleActivityReport.table.header.learningOutcomesAfter', + defaultMessage: 'Learning Outcomes: After', + description: 'Header for the learning outcomes after the user has completed the course column in the module activity report table', + }), + accessor: 'avg_after_lo_score', + }, + { + Header: intl.formatMessage({ + id: 'adminPortal.LPR.moduleActivityReport.table.header.learningOutcomesPercentageDifference', + defaultMessage: 'Learning Outcomes % Difference', + description: 'Header for the learning outcomes percentage difference for learning outcome before and after the course column in the module activity report table', + }), + accessor: 'avg_lo_percentage_difference', + }, ]} tableActions={[ { percentage_completed_activities: `${(i % 100)}%`, hours_online: `${i} Hours Online`, log_viewed: `${i} Log Views`, + avg_before_lo_score: 3.00, + avg_after_lo_score: 5.00, + avg_lo_percentage_difference: 50, }); } return data; @@ -59,5 +62,8 @@ describe('ModuleActivityReport', () => { expect(screen.getByText('% Activities Complete')).toBeInTheDocument(); expect(screen.getByText('Learning Hours')).toBeInTheDocument(); expect(screen.getByText('Log Views')).toBeInTheDocument(); + expect(screen.getByText('Learning Outcomes: Before')).toBeInTheDocument(); + expect(screen.getByText('Learning Outcomes: After')).toBeInTheDocument(); + expect(screen.getByText('Learning Outcomes % Difference')).toBeInTheDocument(); }); });
renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Email + Grade renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Course Title + % Activities Complete renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Module + Extension Requests renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Grade + Learning Hours renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - % Activities Complete + Log Views renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Extension Requests + Learning Outcomes: Before renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Learning Hours + Learning Outcomes: After renders correctly with loading state 1`] = ` className="d-flex align-items-center" > - Log Views + Learning Outcomes % Difference renders correctly with no dashboard insights data 1`] = ` + + + Learning Outcomes: Before + + + + + + + + + + + Learning Outcomes: After + + + + + + + + + + + Learning Outcomes % Difference + + + + + + + +