From 4adb5ca089c0c907f983519b9e3487007712e7fb Mon Sep 17 00:00:00 2001 From: sjschlapbach Date: Mon, 23 Dec 2024 17:30:54 +0100 Subject: [PATCH] wip: add explanation for data table on participant activity performance --- .../StudentActivityPerformance.tsx | 83 ++++++++++--------- packages/i18n/messages/de.ts | 2 + packages/i18n/messages/en.ts | 2 + 3 files changed, 49 insertions(+), 38 deletions(-) diff --git a/apps/frontend-manage/src/components/analytics/performance/StudentActivityPerformance.tsx b/apps/frontend-manage/src/components/analytics/performance/StudentActivityPerformance.tsx index d04ce43358..3ad798556f 100644 --- a/apps/frontend-manage/src/components/analytics/performance/StudentActivityPerformance.tsx +++ b/apps/frontend-manage/src/components/analytics/performance/StudentActivityPerformance.tsx @@ -93,7 +93,6 @@ function StudentActivityPerformance({ return } - // TODO: add explanation what we can see in the plot (total score and completion percentage) // TODO: fix issue where column names in csv export correspond to access keys and, if possible, also include completion percentage therein return (
@@ -153,44 +152,52 @@ function StudentActivityPerformance({
{performances.length > 0 && selectedActivities.length > 0 ? ( - { - const activityName = activityNameMap[activityId] + <> + + {t('manage.analytics.participantActivityPerformanceDescription')} + + { + const activityName = activityNameMap[activityId] - return { - accessorKey: `${activityId}-totalScore`, - header: ({ column }: any) => { - return ( - - ) - }, - cell: ({ row }: any) => { - const rowData = row.original - return `${rowData[`${activityId}-totalScore`]} ${t('shared.generic.points')} (${rowData[`${activityId}-completion`]} %)` - }, - className: 'min-w-40', - } - }), - ]} - data={tableData ?? []} - csvFilename={`${course?.name.replace(' ', '-')}_participant_activity`} - className={{ - table: 'overflow-x-auto', - tableHeader: 'h-7 p-2', - tableCell: 'h-7 p-2', - }} - /> + return { + accessorKey: `${activityId}-totalScore`, + header: ({ column }: any) => { + return ( + + ) + }, + cell: ({ row }: any) => { + const rowData = row.original + return `${rowData[`${activityId}-totalScore`]} ${t('shared.generic.points')} (${rowData[`${activityId}-completion`]} %)` + }, + className: 'min-w-40', + } + }), + ]} + data={tableData ?? []} + csvFilename={`${course?.name.replace(' ', '-')}_participant_activity`} + className={{ + table: 'overflow-x-auto', + tableHeader: 'h-7 p-2', + tableCell: 'h-7 p-2', + }} + /> + ) : selectedActivities.length === 0 ? (