diff --git a/i18n/en.ts b/i18n/en.ts index 7ee8aabd73a1ecb08832d5253a8c38ef1c27bf58..c59190e1c683973b9445f513a18aaf4208c8d41d 100644 --- a/i18n/en.ts +++ b/i18n/en.ts @@ -41,6 +41,7 @@ export const lang_en: LangObj = { "Discard": "Discard", "Created at": "Created at", "Last updated at": "Last updated at", + "First accessed at": "First accessed at", "Last login at": "Last login at", "Information": "Information", "Search": "Search", diff --git a/i18n/i18nRoot.ts b/i18n/i18nRoot.ts index 0fdaa5e9656337501586e3611822741505cb6501..23287e2349384e3ae8ccce20d8acc25701183ef5 100644 --- a/i18n/i18nRoot.ts +++ b/i18n/i18nRoot.ts @@ -44,6 +44,7 @@ export interface LangObj { "Discard": string "Created at": string "Last updated at": string + "First accessed at": string "Last login at": string "Information": string "Search": string diff --git a/src/components/sites/allAccessibleExercisesSite/closedExercisesSite/listView.tsx b/src/components/sites/allAccessibleExercisesSite/closedExercisesSite/listView.tsx index a675b14adcfde08871f56903cb2cd23c205a4d9c..a5ea95456b91001017332e2c1faeb5525fdedf0f 100644 --- a/src/components/sites/allAccessibleExercisesSite/closedExercisesSite/listView.tsx +++ b/src/components/sites/allAccessibleExercisesSite/closedExercisesSite/listView.tsx @@ -131,6 +131,50 @@ class AllAccessibleExercisesList extends React.Component<Props, any> { } </span> </Table.HeaderCell> + <Table.HeaderCell + sorted={ + isCurrentSortingColumnPaginated<ExercisePreviewFromBackend>(this.props.sortByKey, 'lastUpdatedAt', + this.props.sortDirection) + } + > + <span className="clickable" + onClick={() => { + this.props.setSortByKey('lastUpdatedAt', + rotateSorting<ExercisePreviewFromBackend>(this.props.sortDirection, + this.props.sortByKey, + 'lastUpdatedAt', + ), + this.props.displayAsViaCode + ) + }} + > + { + getI18n(this.props.langId,'Last updated at') + } + </span> + </Table.HeaderCell> + <Table.HeaderCell + sorted={ + isCurrentSortingColumnPaginated<ExercisePreviewFromBackend>(this.props.sortByKey, 'firstAccessedAt', + this.props.sortDirection) + } + > + <span className="clickable" + onClick={() => { + this.props.setSortByKey('firstAccessedAt', + rotateSorting<ExercisePreviewFromBackend>(this.props.sortDirection, + this.props.sortByKey, + 'firstAccessedAt', + ), + this.props.displayAsViaCode + ) + }} + > + { + getI18n(this.props.langId,'First accessed at') + } + </span> + </Table.HeaderCell> <Table.HeaderCell> <span> <HelpPopup icon="flag outline" @@ -199,6 +243,20 @@ class AllAccessibleExercisesList extends React.Component<Props, any> { <HelpPopup defaultText={exercisePreview.shortDescription}/> } </Table.Cell> + <Table.Cell> + <span> + { + displayDateAndTime(exercisePreview.lastUpdatedAt, -1) + } + </span> + </Table.Cell> + <Table.Cell> + <span> + { + displayDateAndTime(exercisePreview.firstAccessedAt, -1) + } + </span> + </Table.Cell> <Table.Cell> <div> <Checkbox checked={exercisePreview.shouldNotCount} disabled/> diff --git a/src/components/sites/allAccessibleExercisesSite/openExercises/listView.tsx b/src/components/sites/allAccessibleExercisesSite/openExercises/listView.tsx index 2ae023cf507d93bf67b44e53cb37b5aa2ca4e918..ab2972ae140736381fe1d20afee4fe09751fbfc0 100644 --- a/src/components/sites/allAccessibleExercisesSite/openExercises/listView.tsx +++ b/src/components/sites/allAccessibleExercisesSite/openExercises/listView.tsx @@ -133,6 +133,50 @@ class AllAccessibleExercisesList extends React.Component<Props, any> { } </span> </Table.HeaderCell> + <Table.HeaderCell + sorted={ + isCurrentSortingColumnPaginated<ExercisePreviewFromBackend>(this.props.sortByKey, 'lastUpdatedAt', + this.props.sortDirection) + } + > + <span className="clickable" + onClick={() => { + this.props.setSortByKey('lastUpdatedAt', + rotateSorting<ExercisePreviewFromBackend>(this.props.sortDirection, + this.props.sortByKey, + 'lastUpdatedAt', + ), + this.props.displayAsViaCode + ) + }} + > + { + getI18n(this.props.langId,'Last updated at') + } + </span> + </Table.HeaderCell> + <Table.HeaderCell + sorted={ + isCurrentSortingColumnPaginated<ExercisePreviewFromBackend>(this.props.sortByKey, 'firstAccessedAt', + this.props.sortDirection) + } + > + <span className="clickable" + onClick={() => { + this.props.setSortByKey('firstAccessedAt', + rotateSorting<ExercisePreviewFromBackend>(this.props.sortDirection, + this.props.sortByKey, + 'firstAccessedAt', + ), + this.props.displayAsViaCode + ) + }} + > + { + getI18n(this.props.langId,'First accessed at') + } + </span> + </Table.HeaderCell> { this.props.hideShouldNotCountColumn === false && <Table.HeaderCell> @@ -168,9 +212,8 @@ class AllAccessibleExercisesList extends React.Component<Props, any> { } <Table.HeaderCell> <span> - { - getI18n(this.props.langId,'Working time in min') - } + <HelpPopup icon="wait" + defaultText={getI18n(this.props.langId,'Working time in min')}/> </span> </Table.HeaderCell> <Table.HeaderCell> @@ -214,6 +257,20 @@ class AllAccessibleExercisesList extends React.Component<Props, any> { <HelpPopup defaultText={exercisePreview.shortDescription}/> } </Table.Cell> + <Table.Cell> + <span> + { + displayDateAndTime(exercisePreview.lastUpdatedAt, -1) + } + </span> + </Table.Cell> + <Table.Cell> + <span> + { + displayDateAndTime(exercisePreview.firstAccessedAt, -1) + } + </span> + </Table.Cell> { this.props.hideShouldNotCountColumn === false && <Table.Cell> diff --git a/src/components/sites/doExerciseSite/doExerciseSite.tsx b/src/components/sites/doExerciseSite/doExerciseSite.tsx index 3d4e39210a9f1a76f0327ab0bb155ee4d6e3ddd6..94f0d86d15be317eae2f71caec43398ffab726aa 100644 --- a/src/components/sites/doExerciseSite/doExerciseSite.tsx +++ b/src/components/sites/doExerciseSite/doExerciseSite.tsx @@ -911,6 +911,7 @@ class doExerciseSite extends React.Component<Props & RouteComponentProps<Matched hasLimitedWorkingTime: this.props.doExercise.exerciseRelease.hasLimitedWorkingTime, availableWorkingTimeInMinutes: this.props.doExercise.exerciseRelease.availableWorkingTimeInMinutes, firstAccessedAt: this.props.doExercise.firstAccessedAt, + lastUpdatedAt: null, //not needed or known here shortDescription: '', shouldNotCount: false, releaseDurationType: this.props.doExercise.exerciseRelease.releaseDurationType, diff --git a/src/types/exercisePreview.ts b/src/types/exercisePreview.ts index ac704e8c2c334637f9dd2af587c5f5623fb0e17e..114e92fa154c43ed005ab285488fb4151682cede 100644 --- a/src/types/exercisePreview.ts +++ b/src/types/exercisePreview.ts @@ -100,9 +100,17 @@ export interface ExercisePreviewFromBackend { * (not actually accessed but could have accessed e.g. wehn he/she enters the release code) * used to calculate the left working time... * can be null because when accessed without code we know nothing about the (future) participation + * e.g. it is displayed in the visible for all area but the user has no participation for it */ readonly firstAccessedAt: Moment | null + /** + * the date time when the user last edited the exercise (e.g. created custom test, changed solution code) + * can be null because when accessed without code we know nothing about the (future) participation + * e.g. it is displayed in the visible for all area but the user has no participation for it + */ + readonly lastUpdatedAt: Moment | null + /** * true: is still released,false: not */